Page 1 of 1
Selecting a Database for Multiple Users
Posted: Thu Jul 25, 2013 6:50 pm
by acolburn
I'm a newbie in the world of LiveCode and also databases. To help me learn I've written a simple "CRUD" app, using SQLite--three tables, a few joins. I've been using it myself; all is well.
Now I'd like the app to be usable by a small group, sharing the database's data. Can I continue to use SQLite? (If so, where should the db file be? Will I need to change the code or db for use by multiple people?). Or, do I need a different db, living on a server (like MySQL)?
Thanks! -- Al C.
Re: Selecting a Database for Multiple Users
Posted: Fri Nov 15, 2013 1:42 pm
by Mark
Hi Al,
If multiple users use the same file from the same user account, they can use the same app and everything stays as you have it now.
If you have multiple user accounts on the computer, you can put the file in a folder that is shared by all accounts and have them all use the same app and file. Again, no problem.
If you have multiple computers on a network, you need some sort of a server. You might want to put a standalone on a server that listens on a socket for incoming requests from the clients. If the server puts all requests in a queue instead of executing requests simultaneously, it will all be pretty straightforward.
The most effective and stable and in the end also most simple solution would be to put MySQL on a server in a local network. That allows all clients to connect directly to the MySQL server, there is no need to write your own server standalone and you can leave the scripts in your client app largely unchanged.
If you want to use a database on a web server, available to all users on the internet who have your app, you will need to write some PHP or OnRev scripts. Your app will connect to the PHP scripts and PHP deals with the data in your database. Personally, I would choose PHP, because PHP is available almost everywhere. If you already have n OnRev hosting solution, you might use that.
Kind regards,
Mark
Re: Selecting a Database for Multiple Users
Posted: Wed Nov 27, 2013 4:25 pm
by MaxV
Re: Selecting a Database for Multiple Users
Posted: Wed Nov 27, 2013 4:30 pm
by MaxV
If you had may users that write simultaneously on the database, I should use the Berkley DB:
http://www.oracle.com/technetwork/produ ... index.html
This way you can use it by ODBC, and it's very similar to SQLite. Read here:
http://lessons.runrev.com/s/lessons/m/4 ... using-odbc
Re: Selecting a Database for Multiple Users
Posted: Wed Nov 27, 2013 4:51 pm
by FourthWorld
MySQL is arguably the leader for multi-user databases, and another good choice is the lightning-fast Valentina. Both are supported with externals written specifically for LiveCode.
Re: Selecting a Database for Multiple Users
Posted: Wed Nov 27, 2013 5:20 pm
by Mark
Hi,
The question is "Can I continue to use SQLite?" I believe the answer should be "Yes, if you really want to, but since you're thinking of using MySQL already, you might as well go with that". I don't think OP needs to be told that MySQL is leading and I wouldn't recommend Valentina in this particular case.
Kind regards,
Mark