Android Tutorial [B4X] CloudKVS - synchronized key / value store

christiantric

Member
Licensed User
Hi all,
I'm a novice in B4X and looking for a client-server/cloud data store solution.
Is this component still valid and supported?
I tried to start the B4JClient (attached in the first post) pointing to the demo server but is seems that doesn't respond.

Thanks in advance.
Christian
 

christiantric

Member
Licensed User
I'm testing CloudKVS to store values with image data (Byte array).
With inserts and updates everything's ok.
If I insert a new object with image I see the db size increasing accordinglly but if I delete the object the db size remains unchanged.

I delete with
B4X:
KVSUtils.Client.Put(KVSUtils.User, itemKey, Null)

Does CloudKVS implement a kind of "soft deletion"?
Isn't storing images a good idea? What's the best approach?
How could I delete data from database (local and remote)?
 

christiantric

Member
Licensed User
Integration to my previous post:
I looked into the db and noticed something weird: after deletion the values are null but the db size is high (see attached image).
How could we explain that?
 

christiantric

Member
Licensed User

Oh sorry, I will start a new thread the next time for my questions about CloudKVS, if any.
Thanks, I didn't know about this SQLite behaviour.
A "Vacuum" function to call from time to time would be usefull even for the client in my opinion.
 

OliverA

Expert
Licensed User
Longtime User
I looked into the db and noticed something weird: after deletion the values are null but the db size is high (see attached image).
How could we explain that?
This is how SQLite behaves by default.
I'm going to go one step further and say that almost all on disk databases behave that way. It is normal operating procedure. Disk access is slow and if a DB would compact (remove empty spaces) every time a record is deleted, it would kill its performance. Please note that freed up space is usually marked in such a way that a DB will reuse it. Of course there may be times when you would want to compact/de-frag/vacuum a DB and SQLite's site gives a good breakdown of these times:
I will update the server code to enable auto vacuum.
Please note SQLite's doc on this feature
So I think that auto_vacuum should be an OPTION for CloudKVS, in such a way that a user can specify its usage and let the user decide if the need the benefits of auto_vacuum.
 

jcohedman

Member
Licensed User
Longtime User
Hi Erel, first of all the cloud_kvs Server its amazing!!, im using it since 2017 in a lot of applications
I have a problem tough, the "log" folder its going bigger and bigger in some raspy servers that I made, and I cant find in the code the way to remove the option wich creates the .txt in the log folder.

Thanks again,

Juan Carlos
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…