High Availability of relational databases and nosql Databases

Source: Internet
Author: User

Recently I am reading nosql. A major advantage of nosql over relational databases is high availability. Therefore, some questions are raised:

Why does nosql achieve high availability while relational databases suffer from criticism in this regard?

Relational Database Service

Oracle and sqlserver are both distributed databases.

Definition of distributed databases in wiki:

Http://en.wikipedia.org/wiki/Distributed_database

Description of the distributed database in oracle11g (from 9i to 11g, there is no change in the distributed database from the documentation ):

Http://docs.oracle.com/cd/B28359_01/server.111/b28310/ds_concepts001.htm

One key point is that the distributed database in Oracle connects different database instances in the network. There is no data replication or synchronization between the instance and the instance, and only one copy of all data is available. That is to say, there is no redundant data stored in the distributed database, and reading and writing specific data can only happen on fixed nodes. Such a distributed database does not improve availability, because only when data is redundant can read and write data be distributed to different nodes.

The implementation of distributed databases in SQL Server is not much different from that in Oracle. The corresponding implementation is linked database and synonyms.

Since Oracle and sqlserver are highly consistent (not just distributed, but the way databases work in all aspects), I think there will be no essential difference between Oracle and sqlserver in terms of data processing capabilities.

Here we will introduce the concept of replication in relational databases. As I mentioned earlier, manufacturing redundant data can improve availability. So how does a relational database create redundant data, and why does the redundant data in a relational database cannot be used to improve availability.

The following statement references the content of the Oracle official document given above.

The termReplicationRefers to the operation of copying and maintaining database objects in multiple databases belonging to a distributed system. While replication relies on distributed database technology, database replication
Offers applications benefits that are not possible within a pure distributed database environment.

Most commonly, replication is used to improve local database performance and protect the availability of applications because alternate data access options exist. For example, an application may normally access a local database rather than a remote server
To minimize network traffic and achieve maximum performance. Furthermore, the application can continue to function if the local server experiences a failure, but other servers with replicated data remain accessible.

Replication in relational databases is mainly used for Disaster Tolerance, rather than improving availability. Data redundancy involves synchronization and transactions. In highly consistent relational databases, synchronizing data in Multi-box may cause more costs for processing transactions, but may reduce availability.

Nosql

Therefore, nosql can use data redundancy to improve availability. The root cause is that nosql databases are not strongly consistent, but ultimately consistent.

Let's see how MongoDB works.

MongoDB supports asynchronous replication of data between servers for fail over and redundancy.Only one server (in the Set/shard) is active for writes(The primary, or master) at a given time-this is to allow strong consistent (atomic)
Operations. One can optionally send read operations to the secondaries when
Eventual consistency
Semantics are acceptable.

The preceding focus is that read operations can be distributed to different nodes only when the final consistency is acceptable to achieve high availability.

If strong consistency is to be achieved, there will be no essential difference with relational databases.

However, some nosql databases, such as hbase, claim that they have achieved strong consistency and high availability.

I also heard about the use of nosql for strong consistency projects. It is not clear how to do it. There is time to study again.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.