Chapter 6. Data
Access to local data storage is a signature feature of native application models. Web applications do not have access to local data storage other than browser cookies. Recently, there has been an effort to address these needs, particularly with the proposed HTML 5 APIs for structured client storage.
Palm webOS supports the HTML 5 Database APIs and provides two specific APIs for simple data creation and access:
- Depot
A wrapper on the HTML 5 APIs for simple object storage and retrieval.
- Cookie
A simplified interface to browser cookies, this is a single object store for small amounts of data.
You will have to evaluate your needs to determine which solution is the best.
Cookies are best used for synchronous access to small amounts of data, such as preferences, version numbers, and other state information.
Both HTML 5 databases and Depot are intended to support caches for offline access and to help with performance issues while accessing online data.
Depot is recommended for storing simple objects without a schema design or manual transaction and query handling; otherwise, use an HTML 5 database.
For disconnected applications that require a data store, an HTML 5 database is the best solution.
Whichever solution you select, it is critical that you provide some local caching for offline use, as stale data is better than no data for most applications. Conversely, you should provide a dynamic source for your data, as it’s best to update the source data when the device is connected. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access