Hello, everyone! I start my blog with most common trend No-SQL databases. Some of you heard about what it is, but I want to mention about more detail information without boring you. I put my references in the end of post.
Everybody knows relational databases such as MSSQL, Oracle, MySql etc. If we think opposite term, there is also no-SQLs which are not relational databases (That does not mean we do not need relational databases!). Why we need no-sqls? Recently, technology is changed and data is mass by day by. And we need to process these data and get some ideas from them. There are real-time applications (IoT) and really huge amount of data should be stored. At that point, these databases help you to store these data and process faster. But, we cannot use same syntax and language as we use in traditional SQL, because the systems are different.
So, what is advantages and disadvantages if we compare with traditional databases.
High Availability is one of them. Each query should be respond with success or fail. No timeout will be occured. Read/Write Performance is greater than SQLs (depends on design). Horizontal Scale, you can add a new server on system and this system will be scaled. Schemaless, you can hold any type of data. You don’t have to define data schema before insert data. And even you have just raspery pii. You can run you no-sqls on it. Easly.
But some No-Sqls work as fire&forget. You send insert query but then you dont know when it is written on DB. So, consistency is important here. For example, like button on facebook. You dont need consistency but you have to be fast. If you have sql databases and want to transform it to no-sql databases, It little bit hard. You need some design work. No tools for that.
CAP THEOREM (Eric Brewer)
Okay, this is a computer science and I think all of software engineer should know it. But I don’t want to explain it again and again, I will give a brief what CAP is and some references to learn deeply.
CAP theorem (Brewer’s theorem) says “You can choose at most two of attributes of distributed database”.
Consistency – All nodes and servers should have same data and same time.
Availability – All queries should be respond with fail or success. No timeout.
Partition Tolerance – Data will be divided small partition and store different places. To be more secure.
So you can read and follow these links for more information;
- Salome Simon’s Report
- Of course! Wikipedia
- It is Eric Brewer Post in 2012, after 12 years he claimed this theorem.
Types of NoSQL Databases;
I will try some of them and share my experiences with you. But firstly look into what they offer us.
Graph Base Database
Colum Store Database
Examples for All of Them
- Calculating average income? -> Relational Databases
- Building a shopping cart? -> Key-Value store
- Storing structed product information? -> Document databases
- Describing how a user got from point A to point B? -> Graph Base Store