Selecting a Database for Multiple Users

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
acolburn
Posts: 6
Joined: Fri Jul 12, 2013 9:26 pm

Selecting a Database for Multiple Users

Post by acolburn » Thu Jul 25, 2013 6:50 pm

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.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Selecting a Database for Multiple Users

Post by Mark » Fri Nov 15, 2013 1:42 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Selecting a Database for Multiple Users

Post by MaxV » Wed Nov 27, 2013 4:25 pm

Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Selecting a Database for Multiple Users

Post by MaxV » Wed Nov 27, 2013 4:30 pm

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
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10053
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Selecting a Database for Multiple Users

Post by FourthWorld » Wed Nov 27, 2013 4:51 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Selecting a Database for Multiple Users

Post by Mark » Wed Nov 27, 2013 5:20 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply