Bottleneck of relational database

Source: Internet
Author: User

relational database bottlenecks

High concurrent read and write requirements

Website user concurrency is very high, often up to tens of thousands of read and write requests per second, for the traditional relational database, hard disk I/O is a big bottleneck.

High-efficiency reading and writing of massive data

The amount of data generated per day is huge, and for relational databases, it is very inefficient to query in a table that contains huge amounts of data.

High scalability and availability

In the Web-based architecture, the database is the most difficult to scale out, when the number of users and access to an application system is increasing, the database is not as simple as Web server and app server to add more hardware and service nodes to expand performance and load capacity. For many websites that need to provide 24-hour uninterrupted service, it is very painful to upgrade and extend the database system, which often requires downtime maintenance and data migration.

Many of the features of a relational database are no longer needed for a Web site:

Transactional consistency

Relational database has a lot of overhead in maintaining the consistency of things, and now many web2.0 systems are not very good at reading and writing of things.

Read realistic time Sex

For a relational database, it is certainly possible to read this data immediately after inserting a piece of data, but for many Web applications it is not required to be so high-real-time, such as after sending a message, it is only a matter of seconds or even more than 10 seconds before you can see that the dynamic is completely acceptable.

Complex SQL, especially multi-table association queries

Any large data volume of the Web system, are very taboo multiple large tables of association queries, as well as complex data analysis type of complex SQL report query, especially the SNS type of Web site, from the requirements and product class angle, to avoid the emergence of this situation. Often more than just a single table of primary key query, as well as single table simple conditional paging query, the function of SQL greatly weakened.

The most important cause of poor performance in a relational database is the association query for multiple tables, as well as complex SQL report queries with complex types of data analysis.
In order to ensure the acid property of the database, we must try to design according to its required paradigm, and the tables in the relational database are all stored in a formatted data structure. The composition of each tuple field is the same, even if not all of the fields are required for each tuple, but the database assigns all the fields to each tuple, which makes it easy to link between the banner tables, but from another point of view it is also a factor in relational database performance bottlenecks.

Note: Database transactions must have acid characteristics, acid is atomic atomicity, consistency consistency, isolation isolation, durability persistence.

    The non-relational database presents another idea, for example, to store with a key value pair, and the structure is not fixed, Each tuple can have a different field, and each tuple can add some of its own key-value pairs as needed, so that it is not limited to fixed structures and can reduce the overhead of some time and space. In this way, users can add the fields they need as needed, so that in order to get different information of the user, it is not necessary to query the multi-tables in the relational database. The query can be completed only by taking the corresponding value out of the ID. However, the non-relational database has little constraints, and he is not able to provide a query that is provided by SQL, where this is the case for field property values. And it is difficult to embody the integrity of the design. He is only suitable for storing some simpler data, and SQL database is more appropriate for data that requires more complex queries.

4. Relational database V.s. Non-relational database
      The most important feature of a relational database is transactional consistency: traditional relational database read-write operations are transactional, with acid characteristics, This feature enables relational databases to be used in almost any system that requires consistency, such as a typical banking system.
      However, in the Web application, especially in the SNS application, consistency is not so important, user a sees the content and User B to see the same User C content update inconsistency is tolerable, or, Two people see the time difference between data updates for the same friend it's tolerable for a few seconds, so the biggest feature of a relational database is useless here, at least not so important.
      Conversely, the huge cost of relational databases in order to maintain consistency is that their read and write performance is poor, and SNS such as Weibo, Facebook and other applications, the concurrent reading and writing capabilities are very demanding, relational database has been unable to cope with (in reading, Traditionally in order to overcome the relational database defects, improve performance, are to increase the level of memcache to static Web pages, and in SNS, the change is too fast, memchache is powerless to do so, it is necessary to use a new data structure storage to replace the relational database. The other feature of
      relational database is that it has a fixed table structure, so its extensibility is very poor, and in SNS, the upgrade of the system, the increase of function, often means the huge change of data structure, this relational database is also difficult to cope with, New structured data storage is required.
      Therefore, the non-relational database comes into being, because it is impossible to meet all the new requirements with a data-structure storage, therefore, the non-relational database is strictly not a database, it should be a collection of data structure storage methods.

5. Non-relational database classification
Because the non-relational database itself is natural diversity, and the occurrence of a short time, so do not want to relational database, there are several databases can unified Jiangshan, non-relational database is very much, and most of them are open source.
These databases, in fact, most of the implementation is relatively simple, in addition to some commonalities, a large part of the specific needs of the application to appear, therefore, for this kind of application, has very high performance. Depending on the structure method and the application situation, the following categories are mainly divided into:
Key-value database for high-performance concurrency reading and writing:
The main features of the Key-value database, even with extremely high concurrent read and write performance, Redis,tokyo Cabinet,flare is the representative of this class.
Document-oriented database for massive data access:
This type of database is characterized by the ability to quickly query data in massive amounts of data, typically for MongoDB and COUCHDB
Distributed Database for extensibility:
The problem that this kind of database wants to solve is that the traditional database has the expansibility flaw, this kind of database can adapt to the increase of data quantity and the change of structure.

This article is excerpt from the Web.

Original title: From relational database to non-relational database

Original address: http://blog.csdn.net/robinjwong/article/details/18502195

Bottleneck of relational database

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.