Message Queues
FIFO (First in First Out): A priority attached with them that makes the queue a priority queue
From producer to consumer:
Message queues facilitate asynchronous behaviour.
Message queues are also used to implement notification systems just like Facebook notifications.
Publish Subscribe Model
Multiple consuemer receive the same message sent from a single or multiple producers. newspaper service
Exchanges Types: direct, topic, headers, fanout
The relationship between exchange and the queue is known as Binding.
Point to Point Model
Messaging protocols
AMQP Advanced Message Queue Protocol & STOMP Simple or Streaming Text Oriented Message Protocol
Technologies
RabbitMQ, ActiveMQ, Apache Kafka, ZeroMQ
Case study: notification systems&Real-time feeds
How to implement this notifcation system?
They involve machine learning, understanding the user behaviour, recommending new relevant information & integration of other modules with them
Pull-based approach
Two major issues:
-
Polling DB too often
-
Updates not real-time