posted time Created time: 2017-02-14 Last updated time:

Implement from Local SQL Mode

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.

Local Mode

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.

  • On Debug and Development with Eclipse IDE
  • When high speed response, not scalability,  is necessary

Remote Mode

Remote mode is main mode to run on cloud server. In this mode, the database is scalable, with dynamic partitioning.


Both local and remote mode works on same framework of the database. It is written in Java, so extended classes of local mode's base class is remote mode's implementation.

The Java source codes are converted into C++ codes. Therefore, it was hard task to make Java to C++ compiler, but is was necessary to make a complex system like distributed database.

To complete local mode implementation means most of base implementation of distributed database, except replication and remote data management, is done.

SQL and Record format

The record format of local mode and remote mode is same. Therefore, by implementing local mode, about the format will be done, and tested.


In Alinous Elastic DB, SERIALIZABLE isolation level is for lock free database access, and READ COMMITTED is for OLTP.

Local mode has the framework to handle these isolation level. It is reusable in remote mode.

Locking Architecture

Locking architecture is almost same in both mode. Therefore, by local mode's implementation, the framework of locking will be done.

But following locks become distributed lock when we make the Region Manager scalable.

  • Table Lock
  • DML Lock
  • Unique Exclusive Lock

But internal implementation of these locks are same, therefore on remote mode, I can reuse these locking components.

Local mode as Storage Engine of Distributed Database

The data store used in local mode is also used in remote mode.

To make key value store with transaction is very hard task. But by this architecture, I can do it at once.

Go to Top