Explanation of BASE and ACID System Models

Explanation of BASE and ACID System Models

Hello everyone, In this article we are going to talk about two database system models. These are BASE and ACID models. We will talk about what they are and we will make some examples on them.

Let's get started.

Huge number of projects are using databases. Sometimes, chosing the database is not easy especially in big projects. Because there are too many databases. After we decide database then we need to specify managing the data and data models.

Before database selection step frst we need to specify our requirements.
  • Will the Database be distributed or not
  • Is consistancy very important or not
  • Is Availability more important than responding.

In this point there are two basic system model: ACID and BASE model. We need to know them firstly. Also we need to know CAP theorem to basic theorem of these models.

Then let's first talk about CAP theorem to understand both models well.

CAP theorem explains that a system can not provide consistency, availability and partition tolerance at the same time. System can provide only two of them at the same time. You can reach the detailed article via : Explanation of CAP Theorem

Seperation of these two models is depends on CAP theorem

What are these system models promise :
  • BASE model promise high availability.
  • ACID model promise consistency

BASE Model

BASE model provides the highly availability. So according to CAP theorem BASE selects the consistency or partitioned tolerance. If a system is distributed we need to select the partition tolerance otherwise we need to take care of consistency. With non-relational databases BASE system model is hugely using. We can see BASE system model in MongoDB, Cassandra, etc...

What BASE stands for:
  • Basically Available states that a distributed system promises the always responding but it does not promise the always consistency. All nodes of a database cluster can create a response for the request.
  • Soft State states the database model does not promise the immediate consistency. If we are working with partitioned databases a respond may be not last updated data. Some technics are available to improve the consistency of distributed systems.
  • Eventually Consistent states a distributed system promise to try to make database consistent. Nodes of the database cluster are communication with each other in some ways to update their datas for providing consistency.
Some examples of BASE System model :
Most of social medi applications are using BASE model. NoSql databases are using BASE model like MongoDB, Cassandra, DynamoDB, Redis. A good modeled NoSql database is a very good way to manage huge amount of data.

ACID Model

ACID database model promises the highly consistency of the database. A database model is always respond the last updated data. ACID database model can not be used in distributed systems. Because in distributed systems, data consistency is not 100%. So we can only increase the availability. Before responsing to the request database firstly make sure data is updated.

ACID stands for:
  • Atomic states the transactions after a transaction performed, there will be no problem at the database. If there is a problem during the transaction the process, process is stopped and changings are being rolled back.
  • Consistent states the after transaction the data is stay in database and almost respond the last updated data.
  • Isolated states the transactions are not affect each other and do not disturb each others process while transactions are performing.
  • Durable states the data is always stored even electricity is lost. It means data are not storing on volatile memories. When the power supplied datas are still there.
Some examples of ACID System model :

We can see the ACID model at banking databases. MSSQL, MySql, Oracle, PostgreSQL and other relational databases are examples of ACID model. Some of NoSQL databases are trying to provide the ACID properties. They are trying to increase consistency and also they are providing the Durable property with writing the datas on hard disk.

How to select the good system model for our project
No body can say one of them is the best option without knowing the requirements of the project.
  • If consistency is essential we can use ACID model.
  • If highly availability is essential we can use BASE model.

That is all in this article.

Have a good system designing.

Burak Hamdi TUFAN


Tags


Share this Post

Send with Whatsapp

Post a Comment

Success! Your comment sent to post. It will be showed after confirmation.
Error! There was an error sending your comment. Check your inputs!

Comments

  • There is no comment. Be the owner of first comment...