Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Microservice communication with RabbitMQ - Tetiana Chupryna

77 views

Published on

Video: https://youtu.be/QogP24IONFc

Ruby Meditation #19
November 25, 2017
Kyiv

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Microservice communication with RabbitMQ - Tetiana Chupryna

  1. 1. Ruby Meditation #19 Microservice communication with RabbitMQ Tetiana Chupryna
  2. 2. Disclaimer. Language
  3. 3. Татьяна Чуприна
  4. 4. Татьяна Чуприна Person of a million names
  5. 5. Тетяна Чуприна
  6. 6. Тетяна Чуприна
  7. 7. Tetiana Chupryna
  8. 8. Tetyana Chuprina
  9. 9. Tetjana Chuprina
  10. 10. Tetyiaana Chuprina
  11. 11. Tetiana Chupyra
  12. 12. Tetiana Chuprynas
  13. 13. Tania
  14. 14. Agenda ❖ Inter-service communication problematics ❖ JSON over HTTP option ❖ Message queues option ❖ RabbitMQ ❖ Integration with Ruby
  15. 15. –Steven McConnell, Code complete “Important developments often arise out of analogies. By comparing a topic you understand poorly to something similar you understand better, you can come up with insights that result in a better understanding of the less-familiar topic.” The importance of Metaphors
  16. 16. Luggage for dummies
  17. 17. Luggage for dummies
  18. 18. Luggage for dummies Drop-off
  19. 19. Luggage for dummies Drop-off Sorting
  20. 20. Luggage for dummies Drop-off Sorting
  21. 21. Luggage for dummies Drop-off Sorting Sorting
  22. 22. Luggage for dummies Drop-off Sorting c a r o u s e l Sorting
  23. 23. Luggage for dummies Drop-off Sorting c a r o u s e l Sorting
  24. 24. Game changer
  25. 25. Event-based system
  26. 26. Scalable
  27. 27. Maintainable
  28. 28. Back to clouds
  29. 29. Microservice communication ?? ? ? ? ? ? ? ? ? ? ?? ? ? ?
  30. 30. Inter-service communication ❖ New problem which doesn’t exist in monolith ❖ So many ways to success ❖ So many pitfalls
  31. 31. JSON over HTTP Re use API at least Basic Auth 100% control
  32. 32. JSON over HTTP
  33. 33. You can’t be 100% sure
  34. 34. Design failure to success
  35. 35. Sidekiq to the resque ❖ Handle “other side” failures gracefully ❖ Retry if needed
  36. 36. Procs ❖ Easy ❖ Quick ❖ Dirty ❖ Great choice for small apps
  37. 37. Cons ❖ Bad in scaling ❖ Pain for maintenance ❖ Net::HTTP
  38. 38. Inter-service communication
  39. 39. Break it. Make it. ❖ Decouple service interaction ❖ Keep messages in temporary storage (mailbox?) ❖ Make all asynchronous
  40. 40. Message queues ❖ Message-oriented middleware ❖ Applicable not only for web-applications ❖ Async communication protocol
  41. 41. Kafka JBossMessaging Oracle OpenMQ mail.ru Tarantool
  42. 42. RabbitMQ
  43. 43. Reasons to use ❖ Written in Erlang ❖ Fast&Reliable ❖ Easy to setup ❖ Client libraries on all major languages (Ruby yippee!) ❖ Advanced Message Queuing Protocol
  44. 44. In a nutshell
  45. 45. Direct exchange routing
  46. 46. Fanout exchange routing
  47. 47. Topic exchange
  48. 48. Queue properties ❖ Name ❖ Durable ❖ Exclusive ❖ Auto-delete ❖ Arguments
  49. 49. Bindings ❖ Direct: by routing_key ❖ Multiple bindings ❖ Mask routing
  50. 50. Security ❖ TLS (transport layer security) ❖ SSL ❖ authentication ❖ authorization
  51. 51. Setup Rabbit ❖ Install and run ❖ No painful dependancies
  52. 52. Bunny ❖ Ruby client for RabbitMQ ❖ Lightweight ❖ Up&go
  53. 53. Bunny usage
  54. 54. Sneakers ❖ Background processing framework for Ruby and RabbitMQ ❖ Can be used for high workload ❖ Up&go (as always)
  55. 55. Worker
  56. 56. Procs ❖ Scalable ❖ Maintainable ❖ Lightweight
  57. 57. Cons ❖ Need additional infrastructure eq(Money) ❖ Overkill for small projects ❖ Need additional knowledge
  58. 58. Afterwords ❖ Decoupling message flow from app changes app design and in general makes all easier. ❖ Decoupling message flow makes programs more safe and scalable. ❖ Message queues are a save choice for inter-service communication where RabbitMQ is a solid option. ❖ Ça dépend
  59. 59. Share your stories of inter-service communication
  60. 60. Massive thanks
  61. 61. Thanks Thanks ThanksThanks Thanks Thanks Thanks Thanks Thanks Thanks ThanksThanks Thanks Thanks ThanksThanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks ThanksThanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks

×