DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > 5 Critical REST Services for Mobile Developers

5 Critical REST Services for Mobile Developers

Val Huber user avatar by
Val Huber
·
Nov. 18, 14 · Java Zone · Interview
Like (0)
Save
Tweet
4.25K Views

Join the DZone community and get the full member experience.

Join For Free

Editors note: Article written by Tyler Band for Espresso Logic.


Having built REST servers from scratch, I can confidently say that building REST server from scratch takes a lot of code and time.  There are several vendors which provide service platforms to connect and expose database tables as REST endpoints.  Once the endpoints are exposed, these are not quite ready for the mobile developers to consume yet as the API just looks relational rather than document oriented.   tFor the real challenges of building an enterprise mobile back-end server, here arehe 5 critical REST services every mobile development team must have:

  • Custom Resources Endpoints

  • Multi-table Update 

  • Optimistic Locking 

  • Pagination

  •  Access Control and Security

1. Custom Resource Endpoints – The main goal of a mobile developer is to limit the number of requests to the server.  The ability to create a nested muti-table document is essential.  These new resources should be able to ‘join’ data from multiple databases, tables, views, procedures, NoSQL, or other back-end services.  To the mobile front-end, it is all just JSON.

custom resource - rest services


2. Multi-table Update (Primary key propagation) – If we provide a new nested document that exposes a parent and its children then the server must handle the POST (insert) by knowing that the primary key of the parent is needed as a foreign key in one or more children (Shopping Cart Customer, Orders, and Items).  This then introduces the need for multi-table transactions – it inserts or if a validation fails the transaction is rolled back.


3. Optimistic Locking – Most of the database experts are wondering how a mobile front-end is going to handle state-less transactions.  Best practice is to hash the row and include this in the GET request.  This avoids having to add a timestamp to every single table.

rest services - optimistic locking


4. Pagination – The mobile front-end can always append a search filter to every request.  Best practice is to allow page limits to be specified at the server. These batch limits should be applied to each nested level of the document and a forward link to the next batch to simplify the mobile developers paging.


5. Role-based access control & row/column security – The corporate security policy around identity management (aka. authentication) and role-based access to resources must extend to the REST services as well. This means that the users role(s) will determine which resource endpoints are exposed and what operations this role can perform (e.g. READ, INSERT, UPDATE, DELETE).   Further, the service must extend down to each table to add a filter to every request (e.g. an employee can only see his/her own records).


Many vendors will connect you to your database, but you will need to ask these 5 questions and make sure your back-end team can deliver.  The folks at Espresso Logic have been around databases for decades and have seen these types of issues.  Their elegant and simple point-and-click approach and the fully integrated features are out-of-the box and not an after-thought.  One feature I failed to mention is the POST/PUT response includes a complete transaction and business logic summary of all the new values in every table that was impacted by the changes.  This is a true performance gift for mobile refresh. Check more about our REST API here.

REST Web Protocols mobile Database Relational database dev

Published at DZone with permission of , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Tools and Integrations to Significantly Improve Code Review in GitHub
  • Key Metrics and Measurements to Track Project and Product Performance
  • Working With Geospatial Data in Redis
  • No Sprint Goal, No Cohesion, No Collaboration

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo