2. 2
Whoami?
• Helping customers with MongoDB & Data intensive architectures for the past 3 years.
Anything from MongoDB, Kafka, Spark, Nifi, Hadoop to Docker, Kubernetes / Openshift
and the mix of them together.
• Experienced in designing and running production Data-driven, Messaging & Event-
driven architectures for more than 10 years.
• Looking constantly for new software projects to make our work life smarter and
easier.
• Loves chatting about martial arts, dogs, and philosophical thoughts.
3. 3
Agenda
• What is time series data?
• Why MongoDB for time series?
• Time series challenges and patterns
• Querying time series data in MongoDB
• Tools of the trade
13. 13
Key to successful time series app
• Writes per second?
• Read patterns?
• Read intensive?
• Data retention?
• Security requirements?
Know the
application
14. 14
General structure of time series apps
1. Write fast
2. Aggregate
1. Load to memory
2. Optimize aggregation for query pattern
3. Save to file / store
3. Query
22. 22
Is LSM better than B+ tree?
• It depends if you only write and save or actually query…
• LSM is better for fast writes but bad for reads, that means you will usually do the reads elsewhere…
• B+ tree is better for reads but trades off on write performance.
LSM tree B+ tree
23. But I want fast writes + reads,flexibility,
and rich queries!
24. 24
Take the best for every step of the way
Fast ingest Aggregate /
bucket
Store and query
44. 44
Key takeaways
• Think about your end goal (business need)
• Know your application requirements
• Choose the right pattern (bucket time / size)
• Plan for retention and cleanup
• Write intensive? Buffer with Kafka
• Use aggregation and all the tools (compass, charts, BI connector)
• Don’t forget to monitor and tune it as you go