SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
Databases suck for Messaging
          Alexis Richardson


      Oxford Geek Night May 2009




                  1
Computers were
meant to get rid
of this




                   2
A new kind of fail?




                      3
Solution - use a database?




    4
Databases were
meant to get rid
of this too




                   5
I want to know
when THIS
changes




                 6
Problem - databases suck for messaging


     DATA is facts (“state”) persisted on disk

     Databases are great for storing facts and asking questions about them

     If you know what to ask them and are willing to keep asking them



     INFORMATION is always changing

     Networks are great pushing changes (“messages”) to recipients

     Databases are not optimised for this




                                         7
Social applications store data




                                 8
Social applications store data




And there’s terabytes of it


                                 9
Social applications store data




And there’s terabytes of it

      Enterprises are made of people too
          So: the same issues arise
                                 10
I want to know
when THIS
changes




                 11
Email doesn’t scale




                      12
Information gets old - real quick




                                    13
But current
information is
valuable




                 14
Example: Flickr


     Flickr is a vast database of social objects

     Filtered by interest and relationships

     So - tell me what’s currently relevant

     Without sending me more emails....




                                          15
Polling sucks




                16
What’s going on here? We are trapped in the database world view




                   Example due to Brett Slatkin and Brad Fitzpatrick at Google
                  http://code.google.com/p/pubsubhubbub/wiki/WhyPollingSucks

                                                  17
How do we defeat this evil?




                              18
Can we apply the Hollywood Principle?




                                  19
Can we apply the Hollywood Principle?




         Hint: phone calls and SMS don’t
            travel through databases

                                  20
Email push is direct




                       to:blaine
           alexis       “blah”     blaine




                             21
Email push is direct




                       to:blaine
           alexis       “blah”     blaine
                        “blah”
                        “blah”
                        “blah”
                        “blah”



                             22
Polling is just reverse spam




                               to:alexis
           alexis                 “?”      blaine
                                  “?”
                                  “?”
                                  “?”
                                  “?”



                                     23
Publishing to a queue (“topic”) takes the spam burden off the receiver




           alexis                                          blaine

          PUSH                                              PUSH
                     auth                          filter
                    “blah”“blah”“blah”“blah”“blah”
                            topic: “from alexis”

                                     24
And you can use pubsub and queues in all sorts of ways




                                   25
Databases are not meant to do Pubsub
        SELECT * FROM queue WHERE done = 0 ORDER BY created LIMIT 1




                                      26
A true story


     most people would just create a simple "queue" table

     and: SELECT * FROM queue WHERE done = 0 ORDER BY created LIMIT 1

     “concurrency issues on that thing now - inserting into the queue occasionally takes
     longer than doing the task that needs to be executed synchronously”

     “middle management did not want to have "new third party software" because it
     would be too much Operations to learn and manage”

     so they decided for the time being a MySQL based queue would be sufficient (only
     few million messages/day) and implemented it in PHP/MySQL resulting in lots of dev
     hours for implementation / testing, and more hours because of performance issues ..

     so i think we have spent about the same amount of time as we would to get a
     descent thing up and running, but now we're stuck with a lame and unscalable mysql
     database machines that is dressed as a message broker


                                            27
Flickr from a Pubsub point of view


     Flickr = people publishing to a vast set of streams (photostreams)

     Users express interest through subscription

     I don’t need to see everything - only changes on what I follow



     This seems better - but what’s missing?
     - I am still trapped by the database world view.
     - I still poll for changes (that’s what RSS does)
     - I want the PUSH that email gave me, without the spam.....




                                          28
Characteristics of PUBSUB


    A means of authenticated communication (network transport)
     - eg HTTP, OAuth

    An addressable place to publish to
     - Usually a topic, feed, endpoint or address.

    A way to name, enrol, share, and discover these addressable places
     - For example “blaine@twitter.com” or - TBD!

    A way to deliver and ack delivery (or “take responsibility”)

    The above is in fact a distributed object system




                                               29
How do you solve a problem like Flickr/Twitter/...

                                        Database              Pubsub/MQ
                                      Objects serialised as   Messages organised
                      Data
                                        rows in tables          into streams


                    Interest            Filter by query        Durable “follow”


                                               Pull
                  Notification                                       Push
                                        (polling sucks!)

                  Buffering    Put = add row to table         PUT and GET are
              (non-idempotent) Get = delete top row             symmetric

                                      Overheads tend to       Data flows out to
                     Scale
                                       grow indefinitely         destinations

                                            30
You might need messaging if ... you need to monitor data feeds




                                                    (CC) Kishore Nagarigari



                                    31
You might need messaging if ... you need a message delivered responsibly




                                   32
You might need messaging if ... you need things done in order




                                                     (CC) David Mach


                                    33
You might need messaging if ... you are using the cloud




                                    34
Thank you!
RabbitMQ is a messaging server that just works!




                  Im in yr serverz,
                  queueing yr messagez
                   Photo credit: http://flickr.com/photos/53366513@N00/67046506/

                                              35                                   copyright (c) Rabbit Technologies Ltd.

Weitere ähnliche Inhalte

Was ist angesagt?

Alphorm.com Formation CCNA 200-301 version 2020 (1of6) : Les Fondamentaux des...
Alphorm.com Formation CCNA 200-301 version 2020 (1of6) : Les Fondamentaux des...Alphorm.com Formation CCNA 200-301 version 2020 (1of6) : Les Fondamentaux des...
Alphorm.com Formation CCNA 200-301 version 2020 (1of6) : Les Fondamentaux des...
Alphorm
 

Was ist angesagt? (20)

Monthly Dashboard example
Monthly Dashboard exampleMonthly Dashboard example
Monthly Dashboard example
 
Zero Trust Enterprise Network at Adobe
Zero Trust Enterprise Network at AdobeZero Trust Enterprise Network at Adobe
Zero Trust Enterprise Network at Adobe
 
Develando la esencia del cifrado de datos
Develando la esencia del cifrado de datos Develando la esencia del cifrado de datos
Develando la esencia del cifrado de datos
 
Bir Ransomware Saldırısının Anatomisi. A'dan Z'ye Ransomware Saldırıları
Bir Ransomware Saldırısının Anatomisi. A'dan Z'ye Ransomware SaldırılarıBir Ransomware Saldırısının Anatomisi. A'dan Z'ye Ransomware Saldırıları
Bir Ransomware Saldırısının Anatomisi. A'dan Z'ye Ransomware Saldırıları
 
Unit 4
Unit 4Unit 4
Unit 4
 
Mikrotik RouterOS Security Audit Checklist by Akbar Azwir
Mikrotik RouterOS Security Audit Checklist by Akbar AzwirMikrotik RouterOS Security Audit Checklist by Akbar Azwir
Mikrotik RouterOS Security Audit Checklist by Akbar Azwir
 
Thesis on Image compression by Manish Myst
Thesis on Image compression by Manish MystThesis on Image compression by Manish Myst
Thesis on Image compression by Manish Myst
 
Güvenli Veri Silme ve Dosya Kurtarma
Güvenli Veri Silme ve Dosya KurtarmaGüvenli Veri Silme ve Dosya Kurtarma
Güvenli Veri Silme ve Dosya Kurtarma
 
Cryptography-Known plain text attack
Cryptography-Known plain text attack Cryptography-Known plain text attack
Cryptography-Known plain text attack
 
Alphorm.com Formation CCNA 200-301 version 2020 (1of6) : Les Fondamentaux des...
Alphorm.com Formation CCNA 200-301 version 2020 (1of6) : Les Fondamentaux des...Alphorm.com Formation CCNA 200-301 version 2020 (1of6) : Les Fondamentaux des...
Alphorm.com Formation CCNA 200-301 version 2020 (1of6) : Les Fondamentaux des...
 
Criptografía
CriptografíaCriptografía
Criptografía
 
CRYPTOGRAPHY & NETWORK SECURITY - unit 1
CRYPTOGRAPHY & NETWORK SECURITY -  unit 1CRYPTOGRAPHY & NETWORK SECURITY -  unit 1
CRYPTOGRAPHY & NETWORK SECURITY - unit 1
 
MAC-Message Authentication Codes
MAC-Message Authentication CodesMAC-Message Authentication Codes
MAC-Message Authentication Codes
 
Fiche projet réseau local d'une entreprise moderne
Fiche projet réseau local d'une entreprise moderne Fiche projet réseau local d'une entreprise moderne
Fiche projet réseau local d'une entreprise moderne
 
Information security awareness, middle management
Information security awareness, middle managementInformation security awareness, middle management
Information security awareness, middle management
 
Secure cloud storage
Secure cloud storageSecure cloud storage
Secure cloud storage
 
Chapter3
Chapter3Chapter3
Chapter3
 
basic encryption and decryption
 basic encryption and decryption basic encryption and decryption
basic encryption and decryption
 
Big Data in the Cloud
Big Data in the CloudBig Data in the Cloud
Big Data in the Cloud
 
projet sur le vpn presentation
projet sur le vpn presentationprojet sur le vpn presentation
projet sur le vpn presentation
 

Andere mochten auch

Apache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in actionApache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in action
dejanb
 
Rabbit mq messaginginthecloud_v_mworld_2010_ms
Rabbit mq messaginginthecloud_v_mworld_2010_msRabbit mq messaginginthecloud_v_mworld_2010_ms
Rabbit mq messaginginthecloud_v_mworld_2010_ms
Rabbit MQ
 
Etsy Activity Feeds Architecture
Etsy Activity Feeds ArchitectureEtsy Activity Feeds Architecture
Etsy Activity Feeds Architecture
Dan McKinley
 

Andere mochten auch (10)

RabbitMQ + CouchDB = Awesome
RabbitMQ + CouchDB = AwesomeRabbitMQ + CouchDB = Awesome
RabbitMQ + CouchDB = Awesome
 
Facebook style notifications using hbase and event streams
Facebook style notifications using hbase and event streamsFacebook style notifications using hbase and event streams
Facebook style notifications using hbase and event streams
 
Easy enterprise application integration with RabbitMQ and AMQP
Easy enterprise application integration with RabbitMQ and AMQPEasy enterprise application integration with RabbitMQ and AMQP
Easy enterprise application integration with RabbitMQ and AMQP
 
Apache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in actionApache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in action
 
Rabbit mq messaginginthecloud_v_mworld_2010_ms
Rabbit mq messaginginthecloud_v_mworld_2010_msRabbit mq messaginginthecloud_v_mworld_2010_ms
Rabbit mq messaginginthecloud_v_mworld_2010_ms
 
Introduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQIntroduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQ
 
Etsy Activity Feeds Architecture
Etsy Activity Feeds ArchitectureEtsy Activity Feeds Architecture
Etsy Activity Feeds Architecture
 
Advanced messaging with Apache ActiveMQ
Advanced messaging with Apache ActiveMQAdvanced messaging with Apache ActiveMQ
Advanced messaging with Apache ActiveMQ
 
WebSphere MQ tutorial
WebSphere MQ tutorialWebSphere MQ tutorial
WebSphere MQ tutorial
 
An introduction to fundamental architecture concepts
An introduction to fundamental architecture conceptsAn introduction to fundamental architecture concepts
An introduction to fundamental architecture concepts
 

Ähnlich wie Why databases suck for messaging

Developmental Psychology Theoretical Approaches Essay
 Developmental Psychology Theoretical Approaches Essay Developmental Psychology Theoretical Approaches Essay
Developmental Psychology Theoretical Approaches Essay
Patty Buckley
 

Ähnlich wie Why databases suck for messaging (12)

Social media & sentiment analysis splunk conf2012
Social media & sentiment analysis   splunk conf2012Social media & sentiment analysis   splunk conf2012
Social media & sentiment analysis splunk conf2012
 
Tim Estes - Generating dynamic social networks from large scale unstructured ...
Tim Estes - Generating dynamic social networks from large scale unstructured ...Tim Estes - Generating dynamic social networks from large scale unstructured ...
Tim Estes - Generating dynamic social networks from large scale unstructured ...
 
Tutorial
TutorialTutorial
Tutorial
 
Information Architecture 3.0 (Second Life)
Information Architecture 3.0 (Second Life)Information Architecture 3.0 (Second Life)
Information Architecture 3.0 (Second Life)
 
Gareth millwood interrogating the archived uk web
Gareth millwood   interrogating the archived uk webGareth millwood   interrogating the archived uk web
Gareth millwood interrogating the archived uk web
 
Introduction to the Semantic Web
Introduction to the Semantic WebIntroduction to the Semantic Web
Introduction to the Semantic Web
 
Secular Technological Tailwinds
Secular Technological TailwindsSecular Technological Tailwinds
Secular Technological Tailwinds
 
Systems that learn and reason | Frank Van Harmelen
Systems that learn and reason | Frank Van HarmelenSystems that learn and reason | Frank Van Harmelen
Systems that learn and reason | Frank Van Harmelen
 
Sharing Data Across Memory Institutions
Sharing Data Across Memory InstitutionsSharing Data Across Memory Institutions
Sharing Data Across Memory Institutions
 
Developmental Psychology Theoretical Approaches Essay
 Developmental Psychology Theoretical Approaches Essay Developmental Psychology Theoretical Approaches Essay
Developmental Psychology Theoretical Approaches Essay
 
Breaking the catalog
Breaking the catalogBreaking the catalog
Breaking the catalog
 
Big Data
Big DataBig Data
Big Data
 

Kürzlich hochgeladen

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Why databases suck for messaging

  • 1. Databases suck for Messaging Alexis Richardson Oxford Geek Night May 2009 1
  • 2. Computers were meant to get rid of this 2
  • 3. A new kind of fail? 3
  • 4. Solution - use a database? 4
  • 5. Databases were meant to get rid of this too 5
  • 6. I want to know when THIS changes 6
  • 7. Problem - databases suck for messaging DATA is facts (“state”) persisted on disk Databases are great for storing facts and asking questions about them If you know what to ask them and are willing to keep asking them INFORMATION is always changing Networks are great pushing changes (“messages”) to recipients Databases are not optimised for this 7
  • 9. Social applications store data And there’s terabytes of it 9
  • 10. Social applications store data And there’s terabytes of it Enterprises are made of people too So: the same issues arise 10
  • 11. I want to know when THIS changes 11
  • 13. Information gets old - real quick 13
  • 15. Example: Flickr Flickr is a vast database of social objects Filtered by interest and relationships So - tell me what’s currently relevant Without sending me more emails.... 15
  • 17. What’s going on here? We are trapped in the database world view Example due to Brett Slatkin and Brad Fitzpatrick at Google http://code.google.com/p/pubsubhubbub/wiki/WhyPollingSucks 17
  • 18. How do we defeat this evil? 18
  • 19. Can we apply the Hollywood Principle? 19
  • 20. Can we apply the Hollywood Principle? Hint: phone calls and SMS don’t travel through databases 20
  • 21. Email push is direct to:blaine alexis “blah” blaine 21
  • 22. Email push is direct to:blaine alexis “blah” blaine “blah” “blah” “blah” “blah” 22
  • 23. Polling is just reverse spam to:alexis alexis “?” blaine “?” “?” “?” “?” 23
  • 24. Publishing to a queue (“topic”) takes the spam burden off the receiver alexis blaine PUSH PUSH auth filter “blah”“blah”“blah”“blah”“blah” topic: “from alexis” 24
  • 25. And you can use pubsub and queues in all sorts of ways 25
  • 26. Databases are not meant to do Pubsub SELECT * FROM queue WHERE done = 0 ORDER BY created LIMIT 1 26
  • 27. A true story most people would just create a simple "queue" table and: SELECT * FROM queue WHERE done = 0 ORDER BY created LIMIT 1 “concurrency issues on that thing now - inserting into the queue occasionally takes longer than doing the task that needs to be executed synchronously” “middle management did not want to have "new third party software" because it would be too much Operations to learn and manage” so they decided for the time being a MySQL based queue would be sufficient (only few million messages/day) and implemented it in PHP/MySQL resulting in lots of dev hours for implementation / testing, and more hours because of performance issues .. so i think we have spent about the same amount of time as we would to get a descent thing up and running, but now we're stuck with a lame and unscalable mysql database machines that is dressed as a message broker 27
  • 28. Flickr from a Pubsub point of view Flickr = people publishing to a vast set of streams (photostreams) Users express interest through subscription I don’t need to see everything - only changes on what I follow This seems better - but what’s missing? - I am still trapped by the database world view. - I still poll for changes (that’s what RSS does) - I want the PUSH that email gave me, without the spam..... 28
  • 29. Characteristics of PUBSUB A means of authenticated communication (network transport) - eg HTTP, OAuth An addressable place to publish to - Usually a topic, feed, endpoint or address. A way to name, enrol, share, and discover these addressable places - For example “blaine@twitter.com” or - TBD! A way to deliver and ack delivery (or “take responsibility”) The above is in fact a distributed object system 29
  • 30. How do you solve a problem like Flickr/Twitter/... Database Pubsub/MQ Objects serialised as Messages organised Data rows in tables into streams Interest Filter by query Durable “follow” Pull Notification Push (polling sucks!) Buffering Put = add row to table PUT and GET are (non-idempotent) Get = delete top row symmetric Overheads tend to Data flows out to Scale grow indefinitely destinations 30
  • 31. You might need messaging if ... you need to monitor data feeds (CC) Kishore Nagarigari 31
  • 32. You might need messaging if ... you need a message delivered responsibly 32
  • 33. You might need messaging if ... you need things done in order (CC) David Mach 33
  • 34. You might need messaging if ... you are using the cloud 34
  • 35. Thank you! RabbitMQ is a messaging server that just works! Im in yr serverz, queueing yr messagez Photo credit: http://flickr.com/photos/53366513@N00/67046506/ 35 copyright (c) Rabbit Technologies Ltd.