Kendall
Kendall

Reputation: 27

What is the difference between MYSQL and SQLite multi-user functionality?

I am new to server side programming and am trying to understand relational databases a little better. Whenever I read about MYSQL vs SQLite people always talk about SQLite not being able to have multiple users. However, when I program with the Django Framework I am able to create multiple users on the sqlitedb. Can someone explain what people mean by multi-user? Thanks!

Upvotes: 1

Views: 1022

Answers (5)

user564548
user564548

Reputation:

Look at ScimoreDB. It's an embedded database that supports multi-process (or user) read and write access. It also can work as a client-server database.

Upvotes: 0

Guffa
Guffa

Reputation: 700800

When people talk about multiple users in this context, they are talking about simultaneous connections to the database. The users in this case are threads in the web server that are accessing the database.

Different databases have different solutions for handling multiple connections working with the database at once. Generally reading is not a problem, as multiple reading operations can overlap without disturbing each other, but only one connection can write data in a specific unit at a a time.

The difference between concurrency for databases is basically how large units they lock when someone is writing. MySQL has an advanced system where records, blocks or tables can be locked depending on the need, while SQLite has a simpler system where it only locks the entire database.

The impact of this difference is seen when you have multiple threads in the webserver, where some threads want to read data and others want to write data. MySQL can read from one table and write into another at the same time without problem. SQLite has to suspend all incoming read requests whenever someone wants to write something, wait for all current reads to finish, do the write, and then open up for reading operations again.

Upvotes: 2

IanH
IanH

Reputation: 191

Multi-user means that many tasks (possibly on many separate computers) can have open connections to the database at the same time.

A multi-user database provides things like locks to allow these tasks to update the database safely.

Upvotes: 0

Robert Harvey
Robert Harvey

Reputation: 180908

SQLite concurrency is explained in detail here.

In a nutshell, SQLite doesn't have the fine-grained concurrency mechanisms that MySQL does. When someone tries to write to a MySQL database, the MySQL database will only lock what it needs to lock, usually a single record, sometimes a table.

When a user writes to a SQLite database, the entire database file is momentarily locked. As you might imagine, this limits SQLite's ability to handle many concurrent users.

Upvotes: 0

Leandro
Leandro

Reputation: 2247

As you can read here, sqlite supports multi users, but lock the whole db. Sqlite is used for development ussualy, buy Mysql is a better sql for production, because it has a better support for concurrency access and write, but sqlite dont.

Hope helps

Upvotes: 0

Related Questions