What is the current limit clipping
Scenes:
Spike activity, usually because of too much traffic, cause the application to hang, in order to solve this problem, the general message queue to join the front-end application.
effect:
- Can control the number of events over a certain threshold of this order directly discarded (spike once why I have not succeeded yet)
- You can ease the short-term, high-traffic overwhelmed application (application gets the order according to their maximum capacity)
What is the application of decoupling
Scenes:
Dual 11 is a shopaholic's Day, after a single user, the system needs to notify an order inventory system, the traditional approach is to order system inventory system call interface.
Disadvantages:
When the inventory system fails, the order will fail
case study
A ticketing website :
2014 Web site crashes due time and before the purchase of a poorly designed site architecture, website often appear concurrently Sheremetyevo
Millet official website buy mobile phones:
Use "message queue middleware" design, first come first get, even if you submit a request to buy, but not necessarily rush to get
Electronic business platform "spike panic buying":
Adopted a "message queue middleware" technologies, act as an important role in a highly concurrent environment
Under high concurrency RabbitMq messaging middleware Why you should play mediator
message queue
Message Queue (Message Queue, referred to as MQ), distributed high-availability clustering technology, provides news release subscription, the message track queries, the timing (delay) news, resources statistics, alarm monitoring and a series of cloud messaging services, enterprise-class Internet infrastructure core product
Knowledge Tree MQ message queue
Internet message queue as clipping limiting, application and other important means of decoupling, we should have the following knowledge.
Why RabbitMq
- ZeroMQ: scalable, flexible development using C language, not data persistence
- ActiveMQ: a long history of open-source projects, have been in use in many products, the situation is not good support larger number of queues, lost message prone to 4000 concurrent.
- Redis KV as a memory-based database, which provides news subscription service that can be used as MQ, there is less application cases, and inconvenient extension
- RocketMQ: Alibaba MQ middleware, used in its various products, information can be found quite small, incomplete
- RabbitMQ: erlang language itself combined with concurrent advantages, better performance, feature-rich management-side pages, news microsecond delay, support for multiple languages and supports AMQP client
RabbitMq principles of dialysis
RabbitMq binding way (** Topic Exchange, Direct Exchange, Fanout Exchange **)
** Topic Exchange: ** routing keys match, sending a message to a topic switch, it will look for a successfully matched bound to this key switch according to a routing queue wildcard match, then the message delivery
RabbitMq principle Summary
Switch, routing keys, queue:
RabbitMq not directly sent to the message queue inside, but is first sent to the switch, then the routing switch of our key message delivery queue to the corresponding
Each switch defines a different routing algorithms to deliver the message to a corresponding queue