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

BYOMQ: Build Your Own Message Queue

BYOMQ: Build Your Own Message Queue

Why we [re]built IronMQ

Reed Allman

April 08, 2016

More Decks by Reed Allman

Other Decks in Technology


  1. BYOMQ: Why We [re]Built IronMQ Reed Allman @rdallman10

  2. Making [another!] Case for NIH Reed Allman @rdallman10

  3. Beating A Dead Horse [again!] Reed Allman @rdallman10

  4. There

  5. Are

  6. Too

  7. Many

  8. Options

  9. Me Showing .gifs for 30 Minutes Reed Allman @rdallman10

  10. None
  11. NIH: Not Invented Here Syndrome A quick refresher: ...the tendency

    towards reinventing the wheel (reimplementing something that is already available) based on the belief that in-house developments are inherently better suited, more secure, more controlled, quicker to develop, and incur lower overall cost (including maintenance cost) than using existing implementations.
  12. Proof by Contradiction

  13. Throw this at ${USE_CASE}

  14. Out of the Box • Massive scale on commodity hardware

    in hours of easy set up • Battle tested, many bugs worked out, lots of docs, tools, guides, etc. • Operate JVM, hard not to code on JVM • Any and all problems associated with any of the boxes or how they fit together • And these are open source! Many boxes are not and suffer vendor lock-in • At mercy of those who understand it / time for fixing bugs, making improvements
  15. Could you do better?

  16. Different people come from different backgrounds and, based on that,

    find different tools useful. Ultimately you need to use the tools that let you get your job done most effectively, however that is defined in your particular case. - Russ Cox Go
  17. If it's a core business function -- do it yourself,

    no matter what. - Joel Spolsky Excel
  18. I felt that my team, which was supposed to be

    made up of distributed systems engineers, was really acting more as distributed system plumbers. - Jay Kreps Kafka
  19. None
  20. Pain meow or later?

  21. To the Queues!

  22. Our Requirements: • Easy to run (single binary ideal) in

    any environment & not hosted • Persisted, consistent and performant • Highly available -- fast recovery, no data loss, minimal downtime • Horizontally scalable • Timing based • FIFO • >= 1 time delivery • Multi-Tenant capable+ • Preferably built in Go, HTTP interface
  23. ...Scalable, Low-Latency, Persistent MQ for Job Processing

  24. None
  25. None
  26. What, briefly • Single Go binary per server • RocksDB

    embedded to store all metadata and messages • Built the distributed database - viewstamped replication, multi-master, gossip membership - scales across queues across nodes, auto-balanced • Linear scaling factor of .98 • Recovery time < 300ms • Simple HTTP interface, stupidly simple clients • Enqueue / Dequeue avg latency < 10ms for < 4KB messages
  27. None
  28. boom

  29. Results

  30. Full understanding and control makes for quick fixes, easy to

    add features
  31. Don’t have to build a daemon to add features, can

    bake everything in
  32. Takes a long time to get to stable

  33. Make all your own tools, plumb any data you want

  34. Build exactly what you need, optimized for what you are

  35. Use the language(s) you know and love

  36. My attempt to say profound shit: Be a builder, not

    a plumber.
  37. Questions?