Pages having Transaction & Lock tag
Lock Escalation is to change row locks into table lock. This method is dangerous and not effective. That is because it makes dead lock. In addition to that, vacancy of lock occurs.
Huge Row Locks Occurs
Sometimes a lot of row locks are necessary, in order to execute application. That is inevitable to keep data consistency.
On handling big data, number of records depends on master table's one also becomes big.
Read "Avoid Lock Escalation by Disk Swap" more
Concurrency Control of Transaction is implemented by records cache. This page explains how the cache is used.
Record Caches for Each Transaction
Record Caches are used to check which records are updated by local transaction.
Fast Concurrency Control
Alinous Elastic DB does not update data in the storage engine before committing the transaction.
Read "Execute Transaction Concurrently with Record Cache" more
Today is 14th February 2014. I'm going to implement Alinous Elastic DB from local mode, before remote mode, because it contains base of whole database architecture.
Distributed Database with Local Mode
Alinous Elastic DB has 2 execution modes, they are local mode and remote mode. It is not only scalable distributed database, but also high response database.
In local mode, database works on only local host. It works very fast in this mode, but not scalable. In addition to that, the database becomes portable.
Therefore, in following cases local mode is used.
Read "Implement from Local SQL Mode" more
In order to keep data consistency by transaction supporting ACID, locks are essential. Mainly READ COMMITTED isolation level uses them.
Transaction Isolation Level & Lock
Most of locks are done in READ COMMITTED isolation level. , because it often fails at COMMIT phase.SERIALIZABLE level is almost for lock free and read only transactions
Explicit Locks are done by following SQL statements explicitly.
- SELECT .. FOR UPDATE
- SELECT .. FOR SHARE
- LOCK TABLE
Table Locks are done by "LOCK TABLE" SQL statements. It locks entire table by either UPDATE or SHARE mode.
Read "Internal Lock Architecture of Alinous Elastic DB" more
Relational Database Management System has isolation levels. Alinous Elastic DB has 2 isolation levels, SERIALIZABLE and READ COMMITTED. They are different feature, and suitable usage.
Feature of Isolation Levels
The transaction of each isolation level executed different way in locking. Therefore their performance and way to keep consistency is different.
READ COMMITTED is the default isolation level, and it is best way to OLTP applications.
Read "Feature of Serializable & Read Committed Isolation Level" more
Distributed Relational Database Management Systems can commit transactions as parallel process. In order to implement that, implicit row lock is necessary.
Implicit Locks on Transaction Execution
When we start a transaction, and executing UPDATE, DELETE, and INSERT SQL Statements, they implicitly lock database objects.
UPDATE and DELETE SQL Statement
Implicit row lock is done on executing UPDATE, DELETE Statement, after started a transaction before end of it.
Both SQL Statements has WHERE clause in it. It requests scanning to storage engines. Then update lock is done for filtered rows.
Read "Implicit Row Lock and Parallel Transaction Commit" more
In order to make Distributed Database, especially Transactional RDBMS (Relational Database) supports remote transaction, fast, there are some points to solve.
Why Distributed Database is High Speed
Generally, distributed database is good at high scalability & high throughput. That is because it has some network nodes, and the CPUs in them works simultaneously.
The query benchmark is very fast, if it is independent task. As you add nodes, the number of transactions executed is linearly increases.
Weak Points of Distributed Database
But in actual use, it does not work like benchmark. It has some weak points.
Read "Distributed Transaction Performance for Scalability & Speed" more
The Storage Engine of Distributed Database has records in it. The format have to resolve ACID status with the record's information.
Especially on using partitioning, the format is very important to make the performance high.
Data Format of Storage Records
There are two types of policies in database records management supporting ACID. When the records are changed, one of following operations are done.
- Update or Delete the record
- Add a new record with new version
MySQL uses the first method, and PostgreSQL uses second one. The Alinous Elastic DB uses the second method like PostgreSQL.
Read "Storage Records Data Format for Partitioning" more