SlideShare a Scribd company logo
Messaging
“Just pick something”
A little about myself
● Sean Kelly
o Also known as Stabby
● I went from .NET to Ruby to Go
o But my favorite language is SQL
● Core maintainer of Tapjoys:
o Chore - https://github.com/Tapjoy/chore
o Dynamiq - https://github.com/Tapjoy/dynamiq
● I love IPAs
Speaking of Tapjoy...
We do…
● 1.8 Billion Requests per minute
o And almost as many messages per day
● ~170 Million Jobs per day
● All on ~750 EC2 instances and private
servers
● A stocked double-kegerator
o Right now: Pinner IPA / Cisco Summer of Lager
What is “Messaging”
Like, jobs and stuff?
Messaging is...
● A way to share important events, without
needing to know who's listening
● A way to handle processing events and
information at a larger scale
● Not all that unlike “background jobs”
o Jobs: “I’ll do this later”
o Messaging: “Other people will do this later”
How does this fit into my
app?
It sure sounds cool
Messaging and You
Let’s say you’ve got a great new app, and for a
while things are fine
Monolith
1.0
Messaging and You
Eventually, you need to push work out of band
Monolith
1.2
Jobs
Messaging and You
Now you have several services, and they all
need to share info
Monolith
1.5
Jobs
One-off which
becomes a
core part of
your business
Jobs
Failed
attempt at
Micro
Service
Reporting
System
Sure, but how can you
actually use Messaging?
Those weren’t even very good drawings
They didn’t have lines or anything
What types of Messaging are there?
● 1:1, traditional “Queueing”
o Basic push / pull model of doing work
o Common with asynchronous job processing
o RabbitMQ, ActiveMQ, SQS, Disqueue, Dynamiq, NSQ
● Fanout
o Broadcast style publishing, all listeners get a copy
o Ex: A game pushing out notifications of an update
o Most technologies with 1:1 queues support this in some way
What types of Messaging are there?
● Routing
o Intelligent fanout, routes to listeners based on message
metadata
o Newsgroups: Subscribe to food.charcuterie.*, get bressola
o RabbitMQ does this pretty well
● Streaming
o Persistent connection, constant source of raw bytes
o Twitter's Firehose is one example
o Kafka is a current popular choice
o Really popular with the Scala / Spark crowd
OK, so my Apps and
Services need to talk
Can’t I just stick it all in a shared database
and be done with it?
No
You certainly cannot
Some things, maybe
But not everything, it just doesn’t scale that
way
Why not just stick it all in a DB?
● You can some share of your data this way
o Depends on the use case, type of information
o This is outside the scope of this talk
● Databases are not designed for delivering
messages
o Any “queue” tables will be ridiculously contended
o No atomic “pull” options
So, what does Tapjoy do?
You guys must have solved this, right?
At Tapjoy, we use...
● RabbitMQ
o Moves analytics events to reporting endpoints by way of complex filesystem / s3 approach
o Single node with sharded queues
o Rabbit HA cannot handle our scale
● SNS / SQS
o SNS in some newer projects, mostly for fanout
o SQS for all traditional background jobs
● Kinesis
o Pilot integration for a new analytics pipeline
o Being supplanted with Kafka
● Kafka
o New analytics pipeline
o Used to distribute metrics to both the new endpoint as well as the existing one for
verification
● Dynamiq
o Inhouse Open Source SNS/SQS-alike built on top of Riak 2.0
o Currently used to circumvent complicated and slow legacy messaging service
But I’m not really here to
talk about Tapjoy
Not entirely
I’m more interested in you
So, what do I pick?
There are so many choices, and they all
seem like they’d work
I’m not really here to tell
you what to pick, either!
I’d rather talk to you about how to pick, and
how you integrate your choices
Distributed Systems are all about tradeoffs
Ask: What are my actual needs?
● Planning for 2 years down the road is smart
o But solutions right now get shit done
o Include a cost projection with scale estimates
● Build a prototype (or two)
o Try to iterate quickly
o Understand how you’d use whatever you choose
o Don’t be afraid to move on
o Look at multiple client libraries
Ask: What is my latency tolerance?
● Publishing Messages
o How much time can your app tolerate for publishing?
o What does publish latency look like during an issue?
o Consider the worst-case scenario when planning
● Consuming Messages
o Can you run multiple consumers without impacting
the service?
● End to End
o How fast is the whole experience, round trip?
Ask: What level of durability?
● Client
o Batched VS Unbatched / Streaming
o Acknowledged writes
● Server
o Messages held in memory VS disk
o Messages highly-available?
o Recover from network partitions safely?
o At-Most-Once VS At-Least-Once
 Exactly-Once is something of a myth
Ask: What about throughput?
● How many producing clients do you have
● How many messages per second will they submit
o Does message size impact performance?
● What size should the cluster be?
o Super cluster VS specialized clusters
● How many consumers it takes to keep pace
o With room to grow
Ask: What does failure mean?
● What does a message publishing error
mean?
● What does a delay in the processing pipeline
mean?
● What does a “lost” or failed message mean?
● What does a total failure of the messaging
system mean?
Ask: What behavior do I want?
Is it…
● CA?
o Not distributed, will be difficult to scale past 1 box
o Traditional RDBMS systems are typically CA
● CP?
o Good if you need strongly consistent data
o Partitions can cause data unavailability
● AP?
o Good if you need complete availability
o Eventual consistency can often be “good enough”
Okay, so I lied a little bit
I’ll give you one recommendation
Do you have...
● Relatively small (< 256kb) message sizes?
● Not so strict (~50ms) latency requirements?
● Throughput on the order of 100m or less per
month?
● A tolerance or capability to handle the
occasional duplicate message?
● No concern around being locked into a
vendor-specific technology?
Go use SNS and SQS
immediately
Leave here now and just do it
It’s easy, it’s cheap (at that scale), and you
don’t need to maintain it
Ok, so I picked
“something”
Anything else to know?
You don’t have to choose just 1
● It’s a falsehood that you need 1 perfect
technology
o Each has strengths, weaknesses, and ideal use
cases
● Don’t be afraid to use something else
o If you’re lucky, your app lives long enough to see
many different infrastructure needs
Avoid direct implementations
● Wrap the notion of Publishing in an interface
o Most technologies look surprisingly similar to publish
o You can wrap this in a simple interface, and switch
implementations as needed
● Consuming is usually unique per technology
o Just write a new one
o Trying to interface this part is probably more trouble
than it’s worth
o Play to the unique strengths of the technology
Interfacing your Messaging choices
● Sending messages is often as simple as a name and a chunk of
data
o Define a simple interface for pushing arbitrary data towards a
named endpoint
o A name and a string of JSON is usually enough to get going
o At Tapjoy, we use our Chore library to handle abstracting
message publishing from messaging technologies
● Destinations are independent from messages
o You could need to switch sending messages to a new
technology
o You could have 2 or more different systems depending on the
information in a given message
How do I change messages safely?
● Wrap messages in a simple envelope
o Keep metadata about the message distinct from metadata
about the event it describes
● Define schemas for message bodies
o Schemas give you a catalogue of message definitions, and the
ability to version them
o At Tapjoy, we use our TOLL to build endpoint-agnostic clients
based on schemas, and register them to use Chore publishers.
● Consumers need older schemas
o Lets them reason about how to handle older messages
o Keep a backlog of N older versions, drop support for > N
In Conclusion
Keep in mind
● Distributed Systems - all about tradeoffs
o Never trade “P”
● Understand your needs
o Latency, Throughput, Availability, Durability
● Understand how it fits into your architecture
● Interfaces are your friend
o They can give you a lot of flexibility
Keep in mind
● Use schemas and versioning to support changes to
messages themselves
● Just pick something
o Build a prototype, or two (or three)
o Your second try will probably go better
o SNS/SQS is a decent choice, if latency isn’t a
concern
● Tapjoy is a great place to work on these kinds of
problems at huge scale
Messaging
“Just pick something”
Sean Kelly
@StabbyCutyou

More Related Content

Similar to Messaging

Running Neo4j in Production: Tips, Tricks and Optimizations
Running Neo4j in Production:  Tips, Tricks and OptimizationsRunning Neo4j in Production:  Tips, Tricks and Optimizations
Running Neo4j in Production: Tips, Tricks and Optimizations
Nick Manning
 
What drives Innovation? Innovations And Technological Solutions for the Distr...
What drives Innovation? Innovations And Technological Solutions for the Distr...What drives Innovation? Innovations And Technological Solutions for the Distr...
What drives Innovation? Innovations And Technological Solutions for the Distr...
Stefano Fago
 

Similar to Messaging (20)

Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...
Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...
Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...
 
Running Neo4j in Production: Tips, Tricks and Optimizations
Running Neo4j in Production:  Tips, Tricks and OptimizationsRunning Neo4j in Production:  Tips, Tricks and Optimizations
Running Neo4j in Production: Tips, Tricks and Optimizations
 
Running Neo4j in Production: Tips, Tricks and Optimizations
Running Neo4j in Production:  Tips, Tricks and OptimizationsRunning Neo4j in Production:  Tips, Tricks and Optimizations
Running Neo4j in Production: Tips, Tricks and Optimizations
 
What drives Innovation? Innovations And Technological Solutions for the Distr...
What drives Innovation? Innovations And Technological Solutions for the Distr...What drives Innovation? Innovations And Technological Solutions for the Distr...
What drives Innovation? Innovations And Technological Solutions for the Distr...
 
Going Multiplayer With Kafka With Ben Gamble | Current 2022
Going Multiplayer With Kafka With Ben Gamble | Current 2022Going Multiplayer With Kafka With Ben Gamble | Current 2022
Going Multiplayer With Kafka With Ben Gamble | Current 2022
 
Learning to Translate with Joey NMT
Learning to Translate with Joey NMTLearning to Translate with Joey NMT
Learning to Translate with Joey NMT
 
Scalable, good, cheap
Scalable, good, cheapScalable, good, cheap
Scalable, good, cheap
 
4Developers 2015: Mikroserwisy - szanse, dylematy i problemy - Łukasz Sowa
4Developers 2015: Mikroserwisy - szanse, dylematy i problemy - Łukasz Sowa4Developers 2015: Mikroserwisy - szanse, dylematy i problemy - Łukasz Sowa
4Developers 2015: Mikroserwisy - szanse, dylematy i problemy - Łukasz Sowa
 
Microservices 101: opportunities, dilemmas and problems
Microservices 101: opportunities, dilemmas and problemsMicroservices 101: opportunities, dilemmas and problems
Microservices 101: opportunities, dilemmas and problems
 
Image captioning with Keras and Tensorflow - Debarko De @ Practo
Image captioning with Keras and Tensorflow - Debarko De @ PractoImage captioning with Keras and Tensorflow - Debarko De @ Practo
Image captioning with Keras and Tensorflow - Debarko De @ Practo
 
How do you eat a whale? cloud expo 2017
How do you eat a whale?   cloud expo 2017How do you eat a whale?   cloud expo 2017
How do you eat a whale? cloud expo 2017
 
TDC 2020 - Implementing a Mini-Language
TDC 2020 - Implementing a Mini-LanguageTDC 2020 - Implementing a Mini-Language
TDC 2020 - Implementing a Mini-Language
 
How do you eat a whale velocity 2017
How do you eat a whale   velocity 2017How do you eat a whale   velocity 2017
How do you eat a whale velocity 2017
 
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi
 
Developing a Globally Distributed Purging System
Developing a Globally Distributed Purging SystemDeveloping a Globally Distributed Purging System
Developing a Globally Distributed Purging System
 
I Know What You Did Last Summer
I Know What You Did Last SummerI Know What You Did Last Summer
I Know What You Did Last Summer
 
Distributed systems and consistency
Distributed systems and consistencyDistributed systems and consistency
Distributed systems and consistency
 
DotNet 2019 | Pablo Doval - Recurrent Neural Networks with TF2.0
DotNet 2019 | Pablo Doval - Recurrent Neural Networks with TF2.0DotNet 2019 | Pablo Doval - Recurrent Neural Networks with TF2.0
DotNet 2019 | Pablo Doval - Recurrent Neural Networks with TF2.0
 
Roots and Routes: Crowdsourced Manuscript Transcription Workshop
Roots and Routes: Crowdsourced Manuscript Transcription WorkshopRoots and Routes: Crowdsourced Manuscript Transcription Workshop
Roots and Routes: Crowdsourced Manuscript Transcription Workshop
 
Humans should not write XML.
Humans should not write XML.Humans should not write XML.
Humans should not write XML.
 

Recently uploaded

Recently uploaded (20)

Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
iGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockiGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by Skilrock
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 

Messaging

  • 2. A little about myself ● Sean Kelly o Also known as Stabby ● I went from .NET to Ruby to Go o But my favorite language is SQL ● Core maintainer of Tapjoys: o Chore - https://github.com/Tapjoy/chore o Dynamiq - https://github.com/Tapjoy/dynamiq ● I love IPAs
  • 3. Speaking of Tapjoy... We do… ● 1.8 Billion Requests per minute o And almost as many messages per day ● ~170 Million Jobs per day ● All on ~750 EC2 instances and private servers ● A stocked double-kegerator o Right now: Pinner IPA / Cisco Summer of Lager
  • 5. Messaging is... ● A way to share important events, without needing to know who's listening ● A way to handle processing events and information at a larger scale ● Not all that unlike “background jobs” o Jobs: “I’ll do this later” o Messaging: “Other people will do this later”
  • 6. How does this fit into my app? It sure sounds cool
  • 7. Messaging and You Let’s say you’ve got a great new app, and for a while things are fine Monolith 1.0
  • 8. Messaging and You Eventually, you need to push work out of band Monolith 1.2 Jobs
  • 9. Messaging and You Now you have several services, and they all need to share info Monolith 1.5 Jobs One-off which becomes a core part of your business Jobs Failed attempt at Micro Service Reporting System
  • 10. Sure, but how can you actually use Messaging? Those weren’t even very good drawings They didn’t have lines or anything
  • 11. What types of Messaging are there? ● 1:1, traditional “Queueing” o Basic push / pull model of doing work o Common with asynchronous job processing o RabbitMQ, ActiveMQ, SQS, Disqueue, Dynamiq, NSQ ● Fanout o Broadcast style publishing, all listeners get a copy o Ex: A game pushing out notifications of an update o Most technologies with 1:1 queues support this in some way
  • 12. What types of Messaging are there? ● Routing o Intelligent fanout, routes to listeners based on message metadata o Newsgroups: Subscribe to food.charcuterie.*, get bressola o RabbitMQ does this pretty well ● Streaming o Persistent connection, constant source of raw bytes o Twitter's Firehose is one example o Kafka is a current popular choice o Really popular with the Scala / Spark crowd
  • 13. OK, so my Apps and Services need to talk Can’t I just stick it all in a shared database and be done with it?
  • 14. No You certainly cannot Some things, maybe But not everything, it just doesn’t scale that way
  • 15. Why not just stick it all in a DB? ● You can some share of your data this way o Depends on the use case, type of information o This is outside the scope of this talk ● Databases are not designed for delivering messages o Any “queue” tables will be ridiculously contended o No atomic “pull” options
  • 16. So, what does Tapjoy do? You guys must have solved this, right?
  • 17. At Tapjoy, we use... ● RabbitMQ o Moves analytics events to reporting endpoints by way of complex filesystem / s3 approach o Single node with sharded queues o Rabbit HA cannot handle our scale ● SNS / SQS o SNS in some newer projects, mostly for fanout o SQS for all traditional background jobs ● Kinesis o Pilot integration for a new analytics pipeline o Being supplanted with Kafka ● Kafka o New analytics pipeline o Used to distribute metrics to both the new endpoint as well as the existing one for verification ● Dynamiq o Inhouse Open Source SNS/SQS-alike built on top of Riak 2.0 o Currently used to circumvent complicated and slow legacy messaging service
  • 18. But I’m not really here to talk about Tapjoy Not entirely I’m more interested in you
  • 19. So, what do I pick? There are so many choices, and they all seem like they’d work
  • 20. I’m not really here to tell you what to pick, either! I’d rather talk to you about how to pick, and how you integrate your choices Distributed Systems are all about tradeoffs
  • 21. Ask: What are my actual needs? ● Planning for 2 years down the road is smart o But solutions right now get shit done o Include a cost projection with scale estimates ● Build a prototype (or two) o Try to iterate quickly o Understand how you’d use whatever you choose o Don’t be afraid to move on o Look at multiple client libraries
  • 22. Ask: What is my latency tolerance? ● Publishing Messages o How much time can your app tolerate for publishing? o What does publish latency look like during an issue? o Consider the worst-case scenario when planning ● Consuming Messages o Can you run multiple consumers without impacting the service? ● End to End o How fast is the whole experience, round trip?
  • 23. Ask: What level of durability? ● Client o Batched VS Unbatched / Streaming o Acknowledged writes ● Server o Messages held in memory VS disk o Messages highly-available? o Recover from network partitions safely? o At-Most-Once VS At-Least-Once  Exactly-Once is something of a myth
  • 24. Ask: What about throughput? ● How many producing clients do you have ● How many messages per second will they submit o Does message size impact performance? ● What size should the cluster be? o Super cluster VS specialized clusters ● How many consumers it takes to keep pace o With room to grow
  • 25. Ask: What does failure mean? ● What does a message publishing error mean? ● What does a delay in the processing pipeline mean? ● What does a “lost” or failed message mean? ● What does a total failure of the messaging system mean?
  • 26. Ask: What behavior do I want? Is it… ● CA? o Not distributed, will be difficult to scale past 1 box o Traditional RDBMS systems are typically CA ● CP? o Good if you need strongly consistent data o Partitions can cause data unavailability ● AP? o Good if you need complete availability o Eventual consistency can often be “good enough”
  • 27. Okay, so I lied a little bit I’ll give you one recommendation
  • 28. Do you have... ● Relatively small (< 256kb) message sizes? ● Not so strict (~50ms) latency requirements? ● Throughput on the order of 100m or less per month? ● A tolerance or capability to handle the occasional duplicate message? ● No concern around being locked into a vendor-specific technology?
  • 29. Go use SNS and SQS immediately Leave here now and just do it It’s easy, it’s cheap (at that scale), and you don’t need to maintain it
  • 30. Ok, so I picked “something” Anything else to know?
  • 31. You don’t have to choose just 1 ● It’s a falsehood that you need 1 perfect technology o Each has strengths, weaknesses, and ideal use cases ● Don’t be afraid to use something else o If you’re lucky, your app lives long enough to see many different infrastructure needs
  • 32. Avoid direct implementations ● Wrap the notion of Publishing in an interface o Most technologies look surprisingly similar to publish o You can wrap this in a simple interface, and switch implementations as needed ● Consuming is usually unique per technology o Just write a new one o Trying to interface this part is probably more trouble than it’s worth o Play to the unique strengths of the technology
  • 33. Interfacing your Messaging choices ● Sending messages is often as simple as a name and a chunk of data o Define a simple interface for pushing arbitrary data towards a named endpoint o A name and a string of JSON is usually enough to get going o At Tapjoy, we use our Chore library to handle abstracting message publishing from messaging technologies ● Destinations are independent from messages o You could need to switch sending messages to a new technology o You could have 2 or more different systems depending on the information in a given message
  • 34. How do I change messages safely? ● Wrap messages in a simple envelope o Keep metadata about the message distinct from metadata about the event it describes ● Define schemas for message bodies o Schemas give you a catalogue of message definitions, and the ability to version them o At Tapjoy, we use our TOLL to build endpoint-agnostic clients based on schemas, and register them to use Chore publishers. ● Consumers need older schemas o Lets them reason about how to handle older messages o Keep a backlog of N older versions, drop support for > N
  • 36. Keep in mind ● Distributed Systems - all about tradeoffs o Never trade “P” ● Understand your needs o Latency, Throughput, Availability, Durability ● Understand how it fits into your architecture ● Interfaces are your friend o They can give you a lot of flexibility
  • 37. Keep in mind ● Use schemas and versioning to support changes to messages themselves ● Just pick something o Build a prototype, or two (or three) o Your second try will probably go better o SNS/SQS is a decent choice, if latency isn’t a concern ● Tapjoy is a great place to work on these kinds of problems at huge scale