On 2017/10/27 11:52 AM, Bart Smissaert wrote:
Is this BedrockDB something that could be used to connect to a server and
run SQL and avoid the problems (mainly slowness) that SQLite would
have in this situation?

and

Chris Locke wrote:
My work environment is mainly Windows servers/users.  SQLite 'works' but is
obviously unsupported (file locking, etc).
Could BedrockDb help in this area?  Sounds like it works 'locally' but
'networkably' (is that a word?!)  Couldn't find any Windows-friendly builds
or guides.
Even assuming it could be set up, it also looks like there aren't .Net
drivers or 'wrappers' for it?



This is not directly a client-server architecture, but you can achieve the same result by having a server with a DB node and a local node that you connect to locally, so you simply talk to your local node which in turn communicates to the server. The main difference between that and a client-server setup is that you experience no latency whatsoever, to your app it's as-if the server exists on the local machine (which is technically exactly the case), and of course the full dataset exists in two places, locally and on the server (at least 2, but it is recommended to have 3 places), which may be unwanted if local storage is really tight, but then SQLite would also not have worked for you.

I'm not sure it will work well for a many-client-server DB setup, since each client would have a full dataset and I'm not sure BedrockDB scales well in terms of having, say, more than 1000 nodes or such, but that is probably better answered by the Bedrock people.

There are client-server wrappers for SQLite, but Bedrock's main aim is to make your server data distributed among different servers, not to be a client-server interface.

If you want a client-server setup that's easy and free, simply pop an Apache service on your server with PHP (See XAMPP for a free stack that works in WIndows too), write one simple PHP script that gets a query from the POST variables and then responds with CSV format (or JSON or whatever you like) to whatever the query wanted. PHP understands SQlite and MSSQL and MySQL and Postgres etc, and you can do this in under an hour. (I'm happy to hand out working PHP for this if anyone is interested).

Since it's PHP you can later make it more robust to add security keys, users, sessions, everything that any ol' DB server offers. The connecting app simply makes an http post call to the server, saying hey this is me (perhaps adding a session, security tokens etc. later), gimme this query please.

Further, implementing your own server-side stored Procedures in PHP is too easy. And then later you can move all of this to a Linux server (also) if you please with zero effort, then using BedrockDB to keep your data replicated and live among all your servers.[1]

Maximum easy, Maximum flexibility, Maximum scalability and Maximum compatibility across platforms and completely free. (You do pay a little bit of processing wait time more for PHP to pack your data from the DB cursor into some format before sending it, but that is in the order of milliseconds, usually not noticeable to the client, and user-clients should never deal with millions of rows of data, do that stuff server-side).

Anyway, that's how we do it.

Cheers,
Ryan


[1]: PHP doesn't understand BedrockDB yet, but it understands SQLite / MySQL and Bedrock uses SQLite and has a MySQL connector.

_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to