Redis as a high-performance key-value database has the following characteristics:
1. A variety of data models (String, Hash, List, set, and sorted set)
2. Persistent-bgsave (using RDB snapshots, in the form of a landing instruction, fork a process to dump the entire memory onto the hard disk (fork consumes a lot of memory and IO), or use the AoF log method similar to MySQL to record each updated log. The former has higher performance, but may cause some degree of data loss, the latter is the opposite. )
3. Master-Slave synchronization (to improve read performance is very useful, also triggered the fork)
4. Distributed scalability:
4.1 2.8 Previous Versions: Consistent with memcached, can be implemented on the client side, or using proxies, Twitter has developed proxy twemproxy for Redis and memcached.
4.2 3.0 later version: Redis cluster is a distributed and allow a single point of failure Redis Advanced version, it does not have a central node, the status of each node consistent, with a linear scalable function.
5. Redis only uses a single core, while memcached can use multicore
6. memcached single Key-value size is limited, one value maximum only supports 1MB, while Redis maximum support 512MB
7. Memcached is only a memory cache, the reliability is not required, and Redis is more inclined to the memory database, so the reliability requirements are higher
8. Cold standby mechanism: periodically copy the Redis database file to a packaged backup. While the operating system in the copy file, it seems to use a lot of memory to do file cache and did not release in time. Adjusted the operating system kernel parameters, turned off the cache, temporarily resolved the problem.
Reliability on:
Memcached does not support data persistence, the data disappears after power outage or restart, but its stability is guaranteed. Redis supports data persistence and data recovery, allowing a single point of failure, but at the same time paying performance costs.
Application Scenario:
Memcached: The dynamic system to reduce the database load, improve performance, do caching, suitable for more read less write, large amount of data (such as a large number of users to query user information, friends information, article information, etc.).
Redis: Suitable for high read and write efficiency requirements, data processing business complex and high security requirements of the system (such as Sina Weibo count and micro-blog publishing part of the system, data security, read and write requirements are very high).
Mongo
Disk mapped Memory Database
Value is the document type, value serialization based on Bson
Application Scenario:
Suitable for multiple write less reads, such as logs and backups
SQL vs NoSQL:
In MySQL, the backpack actually has nothing to do with the role, only through the 1 Role ID mapping the past, the artificial fragmentation of the relationship between the data. The whole concept of a hard and alive, called Structured query let you learn
In NoSQL, only the database is treated as a storage point, and the data for each role is a complete piece. You can keep it with you. Each role is queried by ID, and no other.
As a then, game development becomes unusually simple. MySQL role in the door query 4~5 time to get the data. And NoSQL breath all found out, save without increment, direct disk can be
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.