B4J Question How to implement & deploy CloudKVS REST API for Web App usage?

DonManfred

Expert
Licensed User
Longtime User
Setup a jServer and store the needed information in a Database (mysql, sqlite, whatever) or Files.
See aerics Web Api Template as an starting-point

configure all your Webapps to "send anything you want to store to the jServer" or even "request Data from the jServe" there.

It is up to you to build anything. You already have the tools to do.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
For Web App as the client, you want a real-time synchronization?
You may need to use a timer or sleep with interval to call a function that communicate with the APIs. The browser also has localStorage or cache or cookie to store the local copy. If you want more security, you may want to encrypt the data using AES or other algorithm.
If it is just a passive local storage then just ignore the timer.
 
Last edited:
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
CloudKVS solves a specific and quite complicated use case where devices are working offline and later need to synchronize the data. Web apps by their nature are online.
This is exactly why I asked this question. On the web side one can have indexed DB to store the data using key value pairs when offline and where there is no internet connection.

Now its the CloudKVS side that I have been wondering about and how it can do the syncing when one is back online from a web app perspective.

The CloudKVS then is a perfect example of the use case I need. I guess the schema of both offline and online dB should be the same.

I just haven't thought it through about how all this could work yet but via REST API.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The client code saves all operations in a local SQLite db, serialized with B4XSerializator.
Once there is a connection it sends all the operations with a REST API to the server.

You will need to implement something similar without B4XSerializator. I guess that it won't be too complicated to use JSON instead. Managing the queue itself is the challenging part.
 
Upvote 0
Top