SlideShare a Scribd company logo
one system to rule
     them all
RabbitMQ + CouchDB = Awesome
the challenge
• write a backend that scales well
• handle various frontends (web, iPhone, ...)
• runs “somewhere in the cloud”
• easy to maintain and extend
the solution
RabbitMQ
+CouchDB
=Awesome
Part I
RabbitMQ

• AMQP based Message Queue
• lots of additional transports (XMPP, HTTP,
  STOMP, ...)
• erlang based
frontend    frontend   frontend




daemon       RabbitMQ




daemon        daemon         daemon
• every functionality gets a backed daemon
• every daemon has a queue associated
• communication via a JSON message that
  gets passed around
the JSON message
RabbitMQ + CouchDB = Awesome
{
    "response": {
        "expiry": 710,
        "ts": "1234425918",
        "name": "Lenz Gschwendtner",
        "last4": 0,
        "cc_type": "master"
    },
    "data": {
        "options": {
            "billing_id": "E16003D4-B312-BEA23D9AB789"
        },
        "command": "billing_info"
    },
    "meta": {
        "lang": "en",
        "reply_to": "B312-E16003D4-BEA23D9AB789",
        "platform": "iwmn"
    }
}
works great for ...

• RPC style communication
• if the flow through the system is static
• fast transactions
gets fiddly when ...

• there are asynchronous callbacks from
  outside
• message flow can change based on various
  factors
• tasks can take days to complete
Part II
workflows
RabbitMQ + CouchDB = Awesome
... again ...
what we have ...

• various frontends
• backend daemons
• JSON messages
what we need


• a way to describe message flow
• a easy flexible way to write and update it
CouchDB
... to the rescue
RabbitMQ + CouchDB = Awesome
workflow

• really only a path definition through
  backends
• some sort of condition management
• a backend definition
{
    "_id": "f7a4408898e5...a05b4181045",
    "_rev": "3-633060011",
    "name": "billing_info",
    "type": "workflow",
    "user": "iwmn",
    "path": [
        "logger",
        "billing",
        "billing_iwmn_cc"
    ]
}
... and the backend
      definition
{
    "_id": "33adf2e3efc3...f423929f057ac",
    "_rev": "3-3507820969",
    "conn": "rpc",
    "type": "worker",
    "name": "billing_iwmn_cc",
    "location": "billing.cc",
    "description": "the CC interface",
    "command": "billing_verify_cc"
}
now we need a
workflow daemon
frontend    frontend   frontend




daemon       RabbitMQ         workflow




daemon        daemon         daemon
where are we now?

• we can call backends as before
• we can call workflows via the workflow
  queue
• we can manage workflows in CouchDB
Part III
asynchronous callbacks
RabbitMQ + CouchDB = Awesome
problem

• we start a workflow
• we call some external API
• the external API somehow notifies us
  (Mail, Callback URL, ...) about progress
• we need to continue in the workflow
we need a persistent
   message store
{
    "_id": "22cd37afd06c82129adb665d3150f570",
    "_rev": "3-2669449653",
    "status": "done",
    "last_update": 1252296819,
    "name": "E16003D4-F8DB-11DD-B312-BEA23D9AB789",
    "message": {
        "response": {
            "expiry": 710,
            "name": "Lenz Gschwendtner",
            "last4": 0,
            "cc_type": "master"
        },
        "data": {
            "options": {
                 "billing_id": "E16003D4-F8DB-11DD-B312-BEA23D9AB789"
            },
            "command": "billing_info"
        },
        "meta": {
            "lang": "de",
            "name": "E16003D4-F8DB-11DD-B312-BEA23D9AB789",
            "orig_reply_to": "D234ADE8-9B64-11DE-A92C-E5EF11C6FBDB",
            "reply_to": "workflow",
            "user": "iwmn",
            "log": [
                "logger",
                "billing",
                "billing.iwmn.info"
            ],
            "platform": "iwmn"
        }
    },
    "created": 1252296815,
    "type": "bill"
}
one more problem
  how do we correlate messages
... with some CouchDB
       awesome ...
• the backend daemon for the callback polls a
  view in CouchDB

• we can search for any value in the request
  we sent

• all we need is a view that searches for the
  very value this external API uses as
  correlation ID
external   frontend    frontend   frontend
callback



       daemon         RabbitMQ         workflow




       daemon          daemon         daemon
me
Lenz Gschwendtner
CTO iWantMyName
   @norbu09
credits

• RabbitMQ
• CouchDB
• Erlang and Perl
more credits

• http://www.flickr.com/photos/djpd
• http://www.flickr.com/photos/lilyapp
• http://www.flickr.com/photos/b-tal
• http://www.flickr.com/photos/mikebaird
• http://www.flickr.com/photos/eyetwist

More Related Content

PDF
Everything You Always Wanted to Know About Kafka’s Rebalance Protocol but Wer...
PDF
아라한사의 스프링 시큐리티 정리
PDF
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
PDF
Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...
PPT
Astricon 2010: Scaling Asterisk installations
PPTX
Tuning kafka pipelines
ODP
Introduction to Apache solr
PDF
SQL for NoSQL and how Apache Calcite can help
Everything You Always Wanted to Know About Kafka’s Rebalance Protocol but Wer...
아라한사의 스프링 시큐리티 정리
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...
Astricon 2010: Scaling Asterisk installations
Tuning kafka pipelines
Introduction to Apache solr
SQL for NoSQL and how Apache Calcite can help

What's hot (7)

PDF
카프카 기반의 대규모 모니터링 플랫폼 개발이야기
PPTX
Reverse proxy & web cache with NGINX, HAProxy and Varnish
PPT
Oracle High Availabiltity for application developers
PDF
Fast Insight from Fast Data: Integrating ClickHouse and Apache Kafka
PPTX
Schema registry
PDF
簡介 Linux 的 Network Namespace 功能
PPTX
SPARQL Cheat Sheet
카프카 기반의 대규모 모니터링 플랫폼 개발이야기
Reverse proxy & web cache with NGINX, HAProxy and Varnish
Oracle High Availabiltity for application developers
Fast Insight from Fast Data: Integrating ClickHouse and Apache Kafka
Schema registry
簡介 Linux 的 Network Namespace 功能
SPARQL Cheat Sheet
Ad

Similar to RabbitMQ + CouchDB = Awesome (20)

PPTX
It's 10pm: Do You Know Where Your Writes Are?
PDF
Streaming Operational Data with MariaDB MaxScale
PDF
OSMC 2016 - ZMON Zalandos OS approach to monitoring in the cloud and DCs by J...
PDF
OSMC 2016 | ZMON: Zalando's OS approach to monitoring in the cloud and DCs by...
PPTX
IOOF IT System Modernisation
PDF
ZMON: Monitoring Zalando's Engineering Platform
PPTX
Intro to node and mongodb 1
PDF
Introduction to Marionette Collective
ODP
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
ODP
Intravert Server side processing for Cassandra
PDF
Streaming Way to Webscale: How We Scale Bitly via Streaming
PPTX
How bol.com makes sense of its logs, using the Elastic technology stack.
PDF
IBM MQ - Monitoring and Managing Hybrid Messaging Environments
PDF
Actors or Not: Async Event Architectures
PPTX
Working with PowerVC via its REST APIs
PPTX
Architecting Secure and Compliant Applications with MongoDB
PPT
ELK stack at weibo.com
PPTX
Beyond the Basics 2: Aggregation Framework
PDF
MongoDB Europe 2016 - Debugging MongoDB Performance
PDF
3452 - Managing your applications
It's 10pm: Do You Know Where Your Writes Are?
Streaming Operational Data with MariaDB MaxScale
OSMC 2016 - ZMON Zalandos OS approach to monitoring in the cloud and DCs by J...
OSMC 2016 | ZMON: Zalando's OS approach to monitoring in the cloud and DCs by...
IOOF IT System Modernisation
ZMON: Monitoring Zalando's Engineering Platform
Intro to node and mongodb 1
Introduction to Marionette Collective
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
Intravert Server side processing for Cassandra
Streaming Way to Webscale: How We Scale Bitly via Streaming
How bol.com makes sense of its logs, using the Elastic technology stack.
IBM MQ - Monitoring and Managing Hybrid Messaging Environments
Actors or Not: Async Event Architectures
Working with PowerVC via its REST APIs
Architecting Secure and Compliant Applications with MongoDB
ELK stack at weibo.com
Beyond the Basics 2: Aggregation Framework
MongoDB Europe 2016 - Debugging MongoDB Performance
3452 - Managing your applications
Ad

More from Lenz Gschwendtner (14)

PDF
Docker intro
PDF
Scaling web apps_with_message_queues
PDF
Iwmn architecture
KEY
Linuxconf 2011 parallel languages talk
PDF
Cloud architectures
PDF
Mojolicious
PDF
realising ideas
PDF
PDF
MPI, Erlang and the web
PDF
RabbitMQ for Perl mongers
PDF
PDF
Umleitung: a tiny mochiweb/CouchDB app
Docker intro
Scaling web apps_with_message_queues
Iwmn architecture
Linuxconf 2011 parallel languages talk
Cloud architectures
Mojolicious
realising ideas
MPI, Erlang and the web
RabbitMQ for Perl mongers
Umleitung: a tiny mochiweb/CouchDB app

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Approach and Philosophy of On baking technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Big Data Technologies - Introduction.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Review of recent advances in non-invasive hemoglobin estimation
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Approach and Philosophy of On baking technology
Per capita expenditure prediction using model stacking based on satellite ima...
MIND Revenue Release Quarter 2 2025 Press Release
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation theory and applications.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MYSQL Presentation for SQL database connectivity
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation_ Review paper, used for researhc scholars
Reach Out and Touch Someone: Haptics and Empathic Computing
Big Data Technologies - Introduction.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
The AUB Centre for AI in Media Proposal.docx
A comparative analysis of optical character recognition models for extracting...
Review of recent advances in non-invasive hemoglobin estimation

RabbitMQ + CouchDB = Awesome

  • 1. one system to rule them all
  • 4. • write a backend that scales well • handle various frontends (web, iPhone, ...) • runs “somewhere in the cloud” • easy to maintain and extend
  • 8. RabbitMQ • AMQP based Message Queue • lots of additional transports (XMPP, HTTP, STOMP, ...) • erlang based
  • 9. frontend frontend frontend daemon RabbitMQ daemon daemon daemon
  • 10. • every functionality gets a backed daemon • every daemon has a queue associated • communication via a JSON message that gets passed around
  • 13. { "response": { "expiry": 710, "ts": "1234425918", "name": "Lenz Gschwendtner", "last4": 0, "cc_type": "master" }, "data": { "options": { "billing_id": "E16003D4-B312-BEA23D9AB789" }, "command": "billing_info" }, "meta": { "lang": "en", "reply_to": "B312-E16003D4-BEA23D9AB789", "platform": "iwmn" } }
  • 14. works great for ... • RPC style communication • if the flow through the system is static • fast transactions
  • 15. gets fiddly when ... • there are asynchronous callbacks from outside • message flow can change based on various factors • tasks can take days to complete
  • 20. what we have ... • various frontends • backend daemons • JSON messages
  • 21. what we need • a way to describe message flow • a easy flexible way to write and update it
  • 23. ... to the rescue
  • 25. workflow • really only a path definition through backends • some sort of condition management • a backend definition
  • 26. { "_id": "f7a4408898e5...a05b4181045", "_rev": "3-633060011", "name": "billing_info", "type": "workflow", "user": "iwmn", "path": [ "logger", "billing", "billing_iwmn_cc" ] }
  • 27. ... and the backend definition
  • 28. { "_id": "33adf2e3efc3...f423929f057ac", "_rev": "3-3507820969", "conn": "rpc", "type": "worker", "name": "billing_iwmn_cc", "location": "billing.cc", "description": "the CC interface", "command": "billing_verify_cc" }
  • 29. now we need a workflow daemon
  • 30. frontend frontend frontend daemon RabbitMQ workflow daemon daemon daemon
  • 31. where are we now? • we can call backends as before • we can call workflows via the workflow queue • we can manage workflows in CouchDB
  • 35. problem • we start a workflow • we call some external API • the external API somehow notifies us (Mail, Callback URL, ...) about progress • we need to continue in the workflow
  • 36. we need a persistent message store
  • 37. { "_id": "22cd37afd06c82129adb665d3150f570", "_rev": "3-2669449653", "status": "done", "last_update": 1252296819, "name": "E16003D4-F8DB-11DD-B312-BEA23D9AB789", "message": { "response": { "expiry": 710, "name": "Lenz Gschwendtner", "last4": 0, "cc_type": "master" }, "data": { "options": { "billing_id": "E16003D4-F8DB-11DD-B312-BEA23D9AB789" }, "command": "billing_info" }, "meta": { "lang": "de", "name": "E16003D4-F8DB-11DD-B312-BEA23D9AB789", "orig_reply_to": "D234ADE8-9B64-11DE-A92C-E5EF11C6FBDB", "reply_to": "workflow", "user": "iwmn", "log": [ "logger", "billing", "billing.iwmn.info" ], "platform": "iwmn" } }, "created": 1252296815, "type": "bill" }
  • 38. one more problem how do we correlate messages
  • 39. ... with some CouchDB awesome ...
  • 40. • the backend daemon for the callback polls a view in CouchDB • we can search for any value in the request we sent • all we need is a view that searches for the very value this external API uses as correlation ID
  • 41. external frontend frontend frontend callback daemon RabbitMQ workflow daemon daemon daemon
  • 44. more credits • http://www.flickr.com/photos/djpd • http://www.flickr.com/photos/lilyapp • http://www.flickr.com/photos/b-tal • http://www.flickr.com/photos/mikebaird • http://www.flickr.com/photos/eyetwist