I'm using Erel's CloudKVS-solution for more than 3 years in one of my projects and it is perfect for our needs. We are using it with up to 120 clients with only small data and it seems, that the server is far below his potential. I now want to provide it for other units. It think, max. 10 units. Each unit has also up to 120 clients. I think, SQLite is completely adequate for our needs, but in all threads over SQlite, my question is not finally answered:
My idea is now, to set up one table for each unit with
B4X:
Public Tabelname As String
..
....
sql.ExecNonQuery("CREATE TABLE " & Tablename & " (user TEXT, key TEXT, value BLOB, id INTEGER, time INTEGER, PRIMARY KEY (user, key))")
sql.ExecNonQuery("CREATE INDEX id_index ON " & Tablename & " (id)")
and with a server-filter to decide, which table is needed based on the user and password. With this solution, i don't have to touch the old table and we could further use it. Is that a feasible way or do i develop in a wrong direction?
If the table is in the same database you will still have locking of the complete file when you write to any table. That is how I remember sqlLite. I did do a CloudKVS years ago for MySql. It was for Erels V1 of CloudKVS. I know he has done other version so I do not know if it will work, That should work for many more clients clients.
Well, It's Erels... [B4X] CloudKVS - synchronized key / value store... with the b4j server using a MySQL back-end. This is a moderate programmer project. Not really for a new-bee. Thanks Erel!!!!! https://www.b4x.com/android/forum/threads/b4x-cloudkvs-synchronized-key-value-store.63536/ Not...
What does it means? I'm using wal-mode and it is only one server-application, which writes to the different tables. What do i have to do?
Thanks your for your efforts...
Thank you very much for your reply. I saw your example of the cloudkvs with MySQL. For my use, it is much more easier to use SQLite.
What does it means? I'm using wal-mode and it is only one server-application, which writes to the different tables. What do i have to do?
Thanks your for your efforts...
Oh yeah, Forget about WAL mode.
I think your idea of different tables is just fine. Basically though you have to try it and see how the performance is.
It is of course feasible but you do need to carefully learn the code and see that you don't break anything. I cannot say it without doing some work.
The key is made of two values. You can use the first value to distinguish between the different units. This way you don't need to change anything in CloudKVS client or server code.
Thank you for your efforts, Erel and JakeBullet70!
Not to change the code of the CloudKVS is the best solution, i think.
The key is made of two values. You can use the first value to distinguish between the different units. This way you don't need to change anything in CloudKVS client or server code.