jeudi 28 mai 2015

Concurrency in embedded (in-proces) databases H2, Hsqldb, Apache Derby, SQLite (JDBC)

Is it possible to use embedded databases concurrently (read/write) on the same machine (no server) with different processes. And what about concurrent read/writes in one multithreaded process?

Iam trying to find out how the concurrency is solved in HSQL,H2, Apache Derby and SQLite (via xerial JDBC) but i dont understand well those locking mechanism (MVCC, OCC etc) so i need someone to correct what i have found.

  1. H2: Only one process possibly multithreaded can be connected to the database.
    • Table level locking for writes read operations doesnt require lock and can be done concurrently with write (N readers one writer)
    • MVCC - table or row level locking for writes (N readers one writer??)
  2. Hsql: Seems completely same as H2 but there are some differences in MVCC mechanism
  3. Apache Derby (JavaDB): Only one process possibly multithreaded can be connected to the database.
    • Table level locking or row level locking for writes. Read operations doesnt require lock and can be done concurrently with writes (N readers one writer)
  4. SQLite (xerial JDBC): multiple processes can connect simultaneously but only one can do writting operations. (database locking).
    • when there is a write lock other processes or threads cant perform read and write operations??

Aucun commentaire:

Enregistrer un commentaire