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.
Selecting a Database for Multiple Users
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Selecting a Database for Multiple Users
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
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
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Selecting a Database for Multiple Users
Read here: http://www.sqlite.org/whentouse.html
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: Selecting a Database for Multiple Users
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
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
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- VIP Livecode Opensource Backer
- Posts: 10053
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Selecting a Database for Multiple Users
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Selecting a Database for Multiple Users
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 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
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode