Upgrade to Pro — share decks privately, control downloads, hide ads and more …

An overview of Zaqar's persistent transport implementation

vkmc
October 29, 2015

An overview of Zaqar's persistent transport implementation

Zaqar is the messaging and notifications service for OpenStack that allow users to build scalable, reliable and high-performing applications. It has a REST API that can be used by developers to transport messages between different components in their cloud applications through different communication patterns, such as producer/consumer or publisher/subscriber.

In Zaqar's v1, only a WSGI controller is available as a transport solution. This controller is enough for most of the use cases required by users like, for example, task distribution, broadcasting and point to point messaging.

But when the storage and recovery of messages is incremented to rates over 10.000 messages per second -- in cases like activity tracking in a website or log aggregation -- this transport is very inefficient.

To accomplish an adequate performance for this type of loads is necessary the implementation of a streaming interface. That is, long living connections with minimum overhead in which the messages can be freely pushed.

The websocket driver, the latest addition to the Zaqar project, aims to cover this use cases.

vkmc

October 29, 2015
Tweet

More Decks by vkmc

Other Decks in Programming

Transcript

  1. 3 TL;DR Messaging and Notifications for OpenStack To produce an

    OpenStack messaging service that affords a variety of distributed application patterns in an efficient, scalable and highly-available manner, and to create and maintain associated Python libraries and documentation. What is Zaqar? Mission statement
  2. 4 What is Zaqar? ...and in OpenStack itself!* It aims

    to connect applications running on the cloud... *for certain scenarios… don’t get too excited Main goal
  3. 5 What is Zaqar? - It’s not like RabbitMQ or

    QPID - It’s not a queue service - It’s not an email service What Zaqar is not
  4. 10 Storage MongoDB SQLAlchemy Redis Transport WSGI Juno Kilo Zaqar

    architecture Storage backends and transmission mechanisms supported over time Liberty Storage MongoDB SQLAlchemy (mgmt only) Redis Swift (TBD) Transport WSGI Websocket Mitaka Storage MongoDB SQLAlchemy (mgmt only) Redis Transport WSGI Websocket (beta) Storage MongoDB SQLAlchemy (mgmt only) Redis Transport WSGI Websocket
  5. 12 WSGI works well for the majority of the use

    cases… … but when an streaming interface is required, the WSGI transport is not the best. Why we need persistent transport
  6. 13 Persistent transport Long-lived connections with minimal overhead - Raw

    TCP - HTTP long polling - Websocket - WAMP (Web Application Messaging Protocol)
  7. 14 Websocket This technology provides a full-duplex communication channel over

    a single TCP socket - Efficient - Simple - Firewall friendly - Standard
  8. 15 Design Several aspects to define - Message format -

    Message serialization - Connection protocol and security - Third-party libraries to use
  9. { “action”: “”, “headers”: {}, “body”: {} } 16 Message

    format - Action: queue_create - Headers: X-Project-ID, Client-ID, X-Auth-Token, Date, Accept, User-Agent - Body: {“queue_name”: “mitaka”} How should the message structure look like?
  10. 17 Message serialization - JSON - Protocol Buffers - MsgPack

    - Cap ‘n’ Proto How to achieve practicality and performance?
  11. 18 Connection protocol and security - Connection protocol. Websocket uses

    port 80 or 443. Websockets requests are interpreted as an HTTP GET. - Security. Websocket has its secure version (wss). This is complemented with the usage of Keystone auth tokens. How we do transactions and ensure they are safe?
  12. 19 - Autobahn - SockJS - SocketIO - ws4py Third

    party libraries What libraries are we going to use in our implementation?
  13. # Queue creation {“action”: “queue_create”, “headers”: {}, “body”: {“queue_name”: “samplequeue”}}

    # Message post {“action”: “message_post”, “headers”: {}, “body”: {“queue_name”: “samplequeue”, “messages”: [{“body”: “message1”, “ttl”: 3600}, ...]}} # Claim creation {“action”: “claim_create”, “headers”: {}, “body”: {“queue_name”: “samplequeue”, “limit”: 10, “ttl”: 300, “grace”: 300}} # Subscription creation {“action”: “subscription_create”, “headers”: {}, “body”: {“queue_name”: “samplequeue”, “subscriber”: “sampleclient”, “ttl”: 300, “options”: {}}} 22 Zaqar Websocket API Queues, messages, claims and subscription creation
  14. 26 Horizon use case Zaqar websocket for table updates Horizon

    Zaqar Ceilometer Nova Cinder Neutron Glance