Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Local Storage

Entities
Offline Scenarios
Local Storage Entities
Entity Actions
Server Database vs Local Storage
Best Practices
Offline Scenarios

Mobile applications may require offline


access to data
● Stand alone apps
○ Store all the data locally

● Caching
○ Store data on the app that rarely changes

● Offline functionalities
○ Store some of the data locally

2
Local Storage Entities

● Local Storage Entities are persisted in


each device internal storage

● Local Storage Entities have a similar


structure to a Database Entity

3
Local Storage Entities

● Local Storage Entities are persisted in


each device internal storage

● Local Storage Entities have a similar


structure to a Database Entity
○ Defined by attributes
○ Attributes must have a basic data type

● There are no Static Entities in Local


Storage

4
Creating Local Storage Entities

● Created like a Database Entity


○ Id attribute is created automatically

5
Creating Local Storage Entities

● Created like a Database Entity


○ Id attribute is created automatically
○ Attributes can be added as usual

6
Creating Local Storage Entities

● Created like a Database Entity


○ Id attribute is created automatically
○ Attributes can be added as usual

● Can be created from Database Entities


○ Select the desired attributes from the
Database Entity
○ Service Studio automatically creates the
Local Storage Entity

7
Entity Actions

● Common CRUD operations


automatically created:
○ Create: CreateLocalCustomer
○ Retrieve: GetLocalCustomer
○ Update: UpdateLocalCustomer
○ Delete: DeleteLocalCustomer

● CreateOrUpdateAll and DeleteAll Entity


Actions to help data synchronization

● Entity Actions can be used directly in


Client Actions

8
Reference Attributes

● Local Storage attributes can reference


other Entities

● Attributes can be set with Identifier Data


Types
○ Delete Rule automatically set to Ignore

9
10
Best Practices

● Avoid storing sensitive data on the


device
○ Devices can be lost or stolen
○ Minimum subset of data to allow
key offline tasks

● Design a lightweight Local Storage


○ Use only the attributes you need
○ Keep only the records you need

11
Questions?
Thank you

You might also like