# A scalable, available, searchable and near realtime system. but at what cost?

- Speaker: [Tamar Rucham](/wiki/speakers/tamar-rucham.md)
- Event: [Reversim Summit 2019](/wiki/years/2019.md)
- Video: https://www.youtube.com/watch?v=_KQCLIwa5qM
- Transcript: [/transcripts/2019/53-_KQCLIwa5qM.md](/transcripts/2019/53-_KQCLIwa5qM.md)
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: [Architecture](/wiki/topics/architecture.md), [Databases](/wiki/topics/databases.md), [Distributed Systems](/wiki/topics/distributed-systems.md), [Security](/wiki/topics/security.md)

> Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

## Summary

The speaker shares the journey of designing and building a scalable, available, and searchable email marketing system to replace an aging SQL table architecture. The talk breaks down the high costs and engineering challenges of using modern distributed technologies like Cassandra and Elasticsearch. Ultimately, the speaker highlights that the true price of such a system is not paid in raw performance, but in increased development complexity and a steeper learning curve for new team members. The audience learns about the architectural trade-offs involved in distributed databases and schema design.

## Key points

- [0:10](https://www.youtube.com/watch?v=_KQCLIwa5qM&t=10s) The speaker introduces a project to build a scalable, available, searchable, and near-real-time system for email marketing.
- [1:23](https://www.youtube.com/watch?v=_KQCLIwa5qM&t=83s) The legacy system relied on a single, heavily indexed SQL table that struggled to scale alongside a growing customer base.
- [3:50](https://www.youtube.com/watch?v=_KQCLIwa5qM&t=230s) The new tech stack combines Cassandra as the primary source of truth and Elasticsearch for complex querying capabilities.
- [8:09](https://www.youtube.com/watch?v=_KQCLIwa5qM&t=489s) Building with Cassandra requires understanding partitions and bucketing to prevent oversized partitions from degrading cluster performance.
- [12:26](https://www.youtube.com/watch?v=_KQCLIwa5qM&t=746s) Choosing availability over strict consistency in distributed systems means accepting that data is eventually consistent.
- [14:42](https://www.youtube.com/watch?v=_KQCLIwa5qM&t=882s) Handling relationships between different document types in Elasticsearch requires careful consideration of application-side joins, denormalization, or nested objects.
- [21:11](https://www.youtube.com/watch?v=_KQCLIwa5qM&t=1271s) Handling Personally Identifiable Information (PII) forces engineering teams to comply strictly with regulations like GDPR.
- [22:16](https://www.youtube.com/watch?v=_KQCLIwa5qM&t=1336s) The true hidden cost of this distributed architecture is measured in development time, schema rigidity, and onboarding complexity.

## Takeaways

- Understand the underlying storage mechanics and partitioning strategies of NoSQL databases before adopting them.
- Expect a trade-off between flexible querying capabilities and data synchronization overhead when combining multiple data stores.
- Factor in the long-term impact on development velocity and developer onboarding when choosing complex distributed architectures.

## Questions this talk answers

- How do you choose between Cassandra and Elasticsearch for different types of queries in a distributed system?
- What are the best strategies for handling data relationships and joins in a non-relational database like Elasticsearch?
- How can you effectively manage partition sizes in Cassandra when dealing with massive amounts of tenant data?

## Technologies

Cassandra, Elasticsearch, SQL

## Tags

architecture, database design, distributed systems, gdpr, scalability
