Professional Documents
Culture Documents
in Mobile Apps
Public
Speakers
Raca Jha
The information in this presentation is confidential and proprietary to SAP and may not be disclosed without the permission of
SAP. Except for your obligation to protect confidential information, this presentation is not subject to your license agreement or
any other service or subscription agreement with SAP. SAP has no obligation to pursue any course of business outlined in this
presentation or any related document, or to develop or release any functionality mentioned therein.
This presentation, or any related document and SAP's strategy and possible future developments, products and or platforms
directions and functionality are all subject to change and may be changed by SAP at any time for any reason without notice.
The information in this presentation is not a commitment, promise or legal obligation to deliver any material, code or functionality.
This presentation is provided without a warranty of any kind, either express or implied, including but not limited to, the implied
warranties of merchantability, fitness for a particular purpose, or non-infringement. This presentation is for informational
purposes and may not be incorporated into a contract. SAP assumes no responsibility for errors or omissions in this
presentation, except if such damages were caused by SAPs intentional or gross negligence.
All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially
from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, which speak only
as of their dates, and they should not be relied upon in making purchasing decisions.
Public
Avoid OData Services Overload
Understand how your OData service performs
Products Entityset
1000 rows
1000 rows HTTP response1: Top 1000 rows skipping 1000 rows
Pros:
Reduces size of the payload
Improves performance
Cons:
Client driven and is not controlled by the backend
Possibility of timeout issues, if client requests large number of rows
Products Entityset
500 rows
Pros:
Reduces size of the payload
Improves performance
Controlled on the server side
Minimize timeout issues
Cons:
Client forced to make multiple calls to retrieve entire dataset
Products Entityset
Products Entityset
Products Entityset
Modified
rows
Pros:
Implementation effort is rather small
Effective for comparatively small tables
Easier to debug and test
Reduces size of the payload
Cons:
Does not optimize performance of the backend
Response time for large entitysets are higher
Products Entityset
CREATE new
row
UPDATE row
DELETE row
Pros:
Optimizes performance of the backend
More scalable
Reduces size of the payload
Cons:
Implementation effort is slightly more complex
Public
Overview
Public
Offline relationships without $expand
Use case
The app needs relationships while offline
To improve refresh performance, the use of OData server-provided deltas is desirable
To reduce load on the OData server, use of the sharing feature is desirable
Shared data should be related to non-shared data
Problems
OData V2 does not support deltas when $expand are used
Shared and non-shared data need to be separated in the defining requests
Solution
Expose referential constraints for the Associations in the $metadata and separate the defining requests
Public
Reading data in pages
Use case
The app needs to display the data to the end user
Problems
The device can only display a limited amount of data at one time
Loading all entities into memory is not feasible
Solution
Use paging
The app can use client driven paging ($top and $skip) or server driven paging
Public
Updating entities without constructing URLs
Use case
The app needs to have the ability to modify and create new entities
Keys are generated by the OData server for new entities
While offline, both newly created entities and entities downloaded from the server need to be updated
Problem
Keys for locally created entities will be generated and therefore cannot be constructed by the app
Solution
OData is a hypermedia driven protocol
Use the links returned by the OData server (for all entities) rather than constructing URLs
Public
Creating relationships without deep inserts
Use case
The app needs to create multiple related new entities while offline
The involved relationships have a to many end
Problem
Offline OData does not support deep insert operations when at least one end of the relationships is to many
Solution
Use Content-ID referencing in a batch request
Public
Appendix
Public
Using delta token and $skiptoken together
Introducing soft state
Steps involved:
1. Obtain entire table content and delta token as a snapshot
1000 rows 1000 rows
2. Keep entire table content and delta token in soft state session
Until the delta token is sent
3. Split table data with $skiptoken last chunk contains delta token
500 rows 500 rows
HTTP response1: Top 1000 rows from soft state
HTTP request1: Products
<link rel=next href=Products?$skiptoken=1000/>
1000 rows
HTTP response2: Top 1000 rows skipping 1000 rows from soft state
1000 rows
<link rel=next href=Products?$skiptoken=2000/>
HTTP response3: Top 1000 rows skipping 2000 rows from soft state
500 rows
<link rel=delta href=Products?!deltatoken=201608050830/>
HTTP request2: Products?$skiptoken=1000
HTTP request3: Products?$skiptoken=2000
matt.borges@sap.com
milton.chandradas@sap.com
Technology RIG
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate
company) in Germany and other countries. Please see http://www.sap.com/corporate-en/about/legal/copyright/index.html for additional trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its
affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or SAP affiliate company products and
services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as
constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop
or release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated companies strategy and possible future
developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time
for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-
looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place
undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.