Backendless provides a very powerful and easy-to-use API to work with your server-side cache. The API is multi-platform, which means clients written in different languages can exchange data using the centralized server-side cache storage. The caching API can accept any arbitrary object, a primitive value, or an array of objects/primitive values. Additionally, the caching system can be strongly typed – a client app can specify the type that should be used to deserialize the object.
The example below places an arbitrary object into cache. The object is mapped to a name which identifies it in the context of the application. Then the object is retrieved using the same name:
The Person class used in the example is a basic POJO. Notice it does not implement the Serializable interface (it could if you needed it to do so), nor does it need to implement any other interface:
The Caching API supports other useful features, like checking if an object exists in cache, or extending an objects life in cache. These and other features are reviewed in other posts of the Recipe blog series.
You can view the Backendless documentation here to learn more about the Caching API.