The architecture of Redis and memcached in the app: horizontal split and vertical split

Source: Internet
Author: User
Tags redis server

Redis and memcached, both are today's very fire memory databases, to discuss the popularity of the current Redis with the most, in terms of performance, if you have Redis aof and RDB functions are all disabled, just to use Redis as a cache, Redis and mencached performance is not much difference, I believe that using Redis is not likely to just use its caching function it?

The main purpose of this article is to talk about the vertical splitting and horizontal splitting of Redis and memcached, where I use Redis as an example to make it easier to write.

One: Vertical split

the vertical split of Redis is actually similar to the vertical split of MySQL, our vertical split on MySQL is the sub-Library, then what is the sub-Library? Of course, according to the business Sub-Library, order database, commodity library, user base, etc., analogy to Redis is actually the same

Originally we may not have a small business, or a small amount of data, a Redis server is enough, so we put the goods, stores, inventory, promotion rules and so on data are put in, now the user volume up, a machine is not enough to save, Then we can be divided according to the business, the goods, stores, inventory on a single Redis server to store.

Two horizontal split

Horizontal splitting is when we use vertical splitting, the amount of data in some libraries is growing too fast, we also say that as a data shard, we split the product data into three pieces, Routing rules for shards we usually solve with hash redundancy and Hashi algorithm (Redis uses hash slots). Of course not to use horizontal splitting, Redis and memcached do not support this practice, we can only introduce middleware, Of course now redis3.0 can be a server cluster, but it is not stable function, and if you want to expand the need to manually redistribute the hash slot, it is inconvenient, and the Jedis client also has a bug, even the cluster will be stuck.


The architecture of Redis and memcached in the app: horizontal split and vertical split

Related Article

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.