The disadvantages of relational databases:
with the rise of Internet web2.0 Web site, the traditional relational database in dealing with web2.0 website, especially the super-large-scale and high-concurrency SNS type web2.0 pure dynamic website has appeared to be inadequate, exposing a lot of difficult problems to overcome , For example:
1. High performance-the need for higher database concurrency and read/write
web2.0 Web site based on user personalized information to generate dynamic pages in real-time and provide dynamic information, so basically can't use dynamic page static technology, so the database concurrency load is very high, often to achieve tens of thousands of read and write requests per second. The relational database is barely able to cope with tens of thousands of SQL queries, but with tens of thousands of requests for SQL write data, hard disk IO is already unbearable. In fact, for the ordinary BBS website, often there is a demand for high concurrent write requests.
2. Huge Storage-The need for efficient storage and access to massive amounts of data
For the large-scale SNS website, the daily user generates a huge amount of user dynamics, taking foreign friendfeed as an example, one months to reach 250 million user dynamics, for the relational database, in a 250 million records of the surface of the SQL query, the efficiency is extremely low even intolerable.
3. High Scalability && hi availability-requirements for database scalability and high availability
Currently Sina Weibo's Redis and Google's BigTable and Amazon's simpledb are using NoSQL databases.
NoSQL Benefits:
1. Easy to expand
There are a variety of NoSQL databases, but one common feature is the relationship-based nature of relational databases. There is no relationship between the data, so it is very easy to expand. Also invisible, at the level of architecture brings the ability to expand.
2, big Data volume, high performance
NoSQL databases have very high read and write performance, especially in the case of large data volumes. This is due to its non-relational nature, the database structure is simple. In general, MySQL uses Query cache, each time the table update cache is invalidated, is a large-grained cache, in the web2.0 for the interaction of frequent applications, Cache performance is not high. NoSQL's cache is record-level and is a fine-grained cache, so NoSQL has a lot of performance at this level.
3. Flexible Data Model
NoSQL can store custom data formats at any time without having to create fields in advance for the data to be stored. In the relational database, adding or deleting fields is a very troublesome thing. If it is a table with very large amounts of data, adding fields is simply a nightmare. This is especially true in the web2.0 era of large data volumes.
NoSQL can easily implement a highly available architecture without compromising performance. For example, the Cassandra,hbase model can also be highly available by copying the model.
NoSQL Database is the most mainstream of the document database, the database, key value database , three of them are representative mongodb,hbase and Redis respectively.
If you compare NoSQL to a weapon, you can do this (MySQL is a typical relational database, just like a comparison):
1, MySQL generation earlier, and with the lamp tide to mature.
Despite its not much improvement, the emerging Internet uses the most databases. Just like the traditional chopper, the structure is simple, hundreds of years without improvement. But without prejudice to the creation of a variety of knives, as long as there is one, can be competent in the kitchen most of the business. MySQL is the same, the core is stable. But Çeku, sub-tables, backup, monitoring, and other means are readily.
2, MongoDB is a new thing, provide more flexible schema,capped Collection, asynchronous submission, geographical location index, such as five flower 10 color functions.
Like the Swiss Army knife, not only can be used as a knife, but also open the cap, cut nails. But he is not better than MySQL, because there is lack of time to sharpen. One is the stability of the system itself, the second is the development, operation and maintenance needs more experience to be popular.
3, HBase is a bullying elephant soldier. Rely on the ecological environment of Hadoop, can have very good extensibility.
But like soldiers, users need to keep an elephant (Hadoop) to drive him.
4, Redis is the representative of key value storage, the most simple function. provides random data storage.
Like a stick, there is no extra structure. But that's why he has a particularly good elasticity. Just like the golden cudgel in empty hands, can pierce the day, small can become into a needle.
Against these two nightmares. The main purpose of the document database, such as MongoDB , is to provide a richer data structure that discards joins to accommodate online business . Of course, not MongoDB can not use the join, not to do data analysis, discuss this is a matter of opinion. So the document database is not more powerful than a relational database, and because of weak support for joins, the functionality is much weaker. When designing a relational model, it is usually only by considering the direct relationship of the data to define the data model. When designing a document Database model, you also need to consider how the app is used. Therefore, designing a good one document database schema is more difficult than designing a relational model. In addition, because the document database transaction support is also relatively weak, general NoSQL will only provide a row lock. This also adds more difficulty to the design schema. There are a lot of things to note about the use of document databases, and this article focuses only on the part of model design.
Features of the NoSQL database:
1. Kye-value database for extremely high read and write performance requirements
2. Document-oriented database to meet mass storage requirements and access
Document-oriented non-relational database mainly solves the problem is not high-performance concurrent read-write, but to ensure the massive data storage at the same time, with good query performance.
The document database is actually a more advanced key/value (Key/value) database that allows for the association of nested values on each key. The document database supports more efficient queries relative to the simple return of the entire BLOB (binary object) each time.
3. Distributed computing-oriented database for high scalability and availability
The distributed database system, which is composed of databases distributed on different nodes, forms a database service system with elastic scalability, such as the ability to add more data nodes without downtime, delete data nodes and so on.
4. Data storage does not require a fixed table structure, and there are no restrictions on the columns between each record. There is usually no connection operation.
5, can run on the cheap PC server cluster.
NoSQL non-relational databases