An internet television service migrated from a system supporting 5k users to one supporting 5 million users using Apache Cassandra in a microservices architecture. Key lessons learned included putting state on clients or in Cassandra, not other systems; testing different data models and workloads; following DataStax documentation; avoiding Thrift; ensuring proper DevOps practices; and running multi-node Cassandra clusters. A live migration from MySQL to Cassandra involved double writing to make writes idempotent. Cassandra allows greater scale than other databases by requiring data denormalization and duplication.
2. @chbatey
Who am I?
• Built a a lot of systems with Apache
Cassandra at Sky
• Work on a testing library for Cassandra
• Help out Cassandra users
• Twitter: @chbatey
3. @chbatey
Agenda
• Migrating a system designed for 5k users to 5million
users
- Many different uses of Cassandra
- One example data model
• Deployment
• Lessons learned
• A live migration (mysql to Cassandra)
4. @chbatey
Internet Television
• Functionality
- Manage users - millions of them
- Manage devices - even more
- Entitlements - Who can watch what?
- Product catalogs
- Event logging for billing and analytics
5. @chbatey
Internet Television
• Non-functional requirements
- Don’t kill other systems
- Very spiky - Game of Thrones, Champions Leage
- Increasing user base - doubling per year
- Multi DC an absolute must
18. @chbatey
Lesson #1: State kills scalability
• There are only two places to put state in a scalable
systems:
- The client
- Cassandra
19. @chbatey
Lesson #2: Test & measure
• Only you know your work loads
- Try different schemas, record the performance
• Cassandra stress is your friend