mysql redis mongodb

MySQL Overview:

Relational Database. Whether or index data are stored in the hard disk. To use the time before switching to memory. It can solve far more than the amount of data memory.

There are different ways on different storage engines.

Query SQL statement is traditional, with a more mature system, a high degree of maturity.

Share open-source database is constantly adding, MySQL page share continues to grow.

Cons: massive data when solving efficiency will be significantly slower.

MySQL Features:

1. c and c ++ prepared, and used to test a variety of compiler, source code to ensure portability

2. Support for multiple operating systems

3. The API provides a variety of programming languages

4. Support multi-threading, make full use of CPU resources

SQL query optimization algorithms, effectively speed up the search

5. To provide multi-language support, common coding such as: GB2312, BIG5, UTF8

6. Provide TCP / IP, ODBC and JDBC database connectivity and other ways

Provided for use in management, check, optimize database operations management tools

7. large databases. Can be solved has tens of millions of records in a large database

8. Support multiple storage engines

9. MySQL uses a dual-authorized software mining policy, divided communities and commercial versions, because of its small size, high speed, low cost of ownership, especially open source this feature, the development of small and medium websites have chosen MySQL as website database

10. MySQL data using standard SQL language in the form of

11. Mysql can be customized, mining using the GPL, you can modify the source code to develop their own system MySQL

12. DDL changes online function

13. Copy the global transaction identifier

14. A copy machine without collapse from

15. Copy multi-threaded slaves

The difference between MySQL, MongoDB, Redis database: Big Data Analytics to learn

 

MongoDB Overview:

It is an in-memory database, the data is in memory inside.

Most operations on the data in memory, but the memory is not a simple MongoDB database.

MongoDB is written in C ++ language, it is an open source database distributed file system based storage.

In the case of high load, add more nodes, you can ensure server performance.

MongoDB should be designed to use the WEB scalable high performance data storage processing scheme.

Disadvantages: use accounts for a large space

MongoDB features:

1. free mode: You can store different structure of the document in the same database

2. The set-oriented storage: a form suitable for storage JSON-style documents

3. The full index support, for any property index

4. Copy and high workability: support data replication between servers, the main support - are copied from each other between the patterns and the server. The main purpose is to provide redundant replication and automatic failover

The automatic sheet: a horizontal support database cluster, dynamically additional machine

6. rich query: support a rich query expressions, query the amount of instruction in JSON form tag can easily query the array and embedded objects in the document

7. Quick-place upgrade: the query optimizer analyzes the query expression, and generate an efficient query plan

8. Efficient conventional storage: binary data and large object support

The difference between MySQL, MongoDB, Redis database: Big Data Analytics to learn

 

Redis:

It is an out-of-memory database.

Persistence way: Redis All data is in memory, the persistence with RDB way or by aof way.

Redis features:

1. Redis support persistence of data, data in memory can be saved to disk, restart time can be loaded with again.

2. Redis not only support simple key-value data types, while also providing list, set, stored set, hash and other data structures.

3. Redis data backup data backup support, i.e., master-slave mode,

4. The high performance - Redis can be read speed of 110,000 times / s, write speed is 81000 times / s

The rich data types -Redis support binary case Strings, Lists, Hashes, Setes and Ordered Sets the data type of the operation.

6. atom - Redis all operations are atomic, while performing atomic Redis supports full and after several operations.

7. The feature-rich - Redis also supports publish / subscribe, notification, key expiration and so on characteristics.

The difference between MySQL, MongoDB, Redis database: Big Data Analytics to learn

 


Comparing the amount of data and performance:

When enough physical memory used, Redis> MongoDB> MySQL

When the physical memory is not used, Redis and MongoDB will use virtual memory.

In fact, if Redis To start the virtual memory, it is very significant to either add memory, you should either change the database.

However, MongoDB not the same, only, to ensure that the service, write data than the cold, such thermal data in physical memory, less mmap exchange.

MongoDB was able to guarantee performance. Some data on T use MongoDB stores.

MySQL, MySQL do not need to worry about the amount of data under the relationship with memory. However, the relationship between the amount of memory with thermal data will greatly affect the performance reflected.

When physical memory and virtual memory are not enough to use, in addition to MySQL expected nothing you have chosen.

In fact, from the data storage principle point of view, I prefer the MongoDB database classified as hard, but with the mmap as a means of accelerating it.


Different scenarios:

1, MongoDB suitable for use in:

① website data: for real-time insert, update and query, and has a highly scalable real-time data replication and storage required for the site;

② Cache: because of the high performance, are also suitable as the buffer layer of the information infrastructure, the system is rebooted, the structures underlying persistent cache to avoid overloading the data source;

③ large-size, low-value data is the best choice for MongoDB, when using traditional relational database to store small amounts of data may be more expensive, again before many programmers often choose traditional file storage

④ high scalable scene, is a very tens or hundreds of servers who make up the database

⑤ the use of the object and the json data storage, MongoDB bson data format of the document format is ideal for storage and query.

2, while mysql is more suitable for use in:

① transactional system height. Such as a bank's accounting system or traditional relational database is still more practical for use in atomic complex transactions require a lot of procedures should be used

② traditional business intelligence should be used, will generate highly optimized for BI query database-specific issues, for such use, the data warehouse may be a more appropriate choice

3, Redis should be used:

In memory of all the data to do when ① the cache -redis

② can replace the traditional database should be used in certain scenarios - social class should be used for example

③ in a small number of large systems, smart achieve small number of specific functions: session sharing, shopping cart

Guess you like

Origin www.cnblogs.com/fan-1994716/p/11923087.html