You are on page 1of 3

Database:

Cassandra is a NoSQL database that is designed to handle large amounts of data and high levels of
traffic. It is also highly scalable, meaning that it can be easily expanded to meet Swiggy’s growing
traffic and users. Additionally, Cassandra is very reliable and has been proven to be able to handle
even the most demanding workloads.
Swiggy could benefit from Cassandra for managing user profiles, order data, and other
operational data.
Being a NoSQL Database it uses flexible data models that can adapt to changes in data
structures and are capable of scaling horizontally to handle growing amounts of data.

Features:
High Write Throughput:
● Cassandra is designed for high write throughput and can handle a massive
number of write operations per second.
● This is advantageous for Swiggy's transaction data, which involves a significant
volume of order updates and changes.

Multi-Datacenter Replication:
● Cassandra supports multi-datacenter replication, making it suitable for
geographically distributed applications like Swiggy.
● DynamoDB also offers global tables, but Cassandra provides more granular
control over replication and data consistency.

Open Source and Vendor Independence:


● Cassandra is an open-source database, which means Swiggy can run it on
various cloud providers or on-premises, offering vendor independence.

Cost Control:
● Cassandra's open-source nature allows more control over infrastructure costs,
especially when managing and optimizing the database cluster.

Company Selected: Swiggy

Requirements:
Swiggy has become a very popular food delivery app thus attracting a large traffic and requires a
database that is capable to adapt to changes and support huge transactional workload.
Existing Solution:
Swiggy currently uses DynamoDB to store transactional data, restaurant inventory and
customer database in DDB tables and also provides DDB streams for CDC logs. However,
DynamoDB uses a strict schema structure, which can be less accommodating for applications
with changing data needs.

Comparison with existing database:

Apache Cassandra Amazon DynamoDB

Feature

Database Type NoSQL (Wide-Column Store) NoSQL (Key-Value Store)

Strict schema with key-value


Data Model Flexible schema with wide columns
pairs

Secondary indexes, ad-hoc querying, complex Key-based lookups, limited


Querying
queries querying capabilities

Open-source; can be run on multiple cloud Tightly integrated with AWS;


Vendor Lock-in
providers potential vendor lock-in

Predictable costs, less control


Cost Control More control over infrastructure costs
over infrastructure
Recommendation:
Swiggy should consider migrating to Apache Cassandra in place of Amazon DynamoDB to
address some of the limitations we've encountered. While DynamoDB is a reliable managed
service, it has certain drawbacks that may impact Swiggy's specific use cases. Firstly,
DynamoDB's strict schema can be limiting when dealing with evolving data models, making it
challenging to adapt to changing business requirements efficiently. In contrast, Cassandra's
flexible schema design allows for seamless adjustments to data structures as Swiggy's needs
evolve.
Secondly, DynamoDB's querying capabilities are relatively constrained, primarily relying on
key-based lookups. For Swiggy, which deals with complex queries involving user preferences,
restaurant data, and real-time analytics, Cassandra's support for secondary indexes and ad-hoc
querying provides a significant advantage, enabling more flexible and efficient data retrieval.
Furthermore, DynamoDB's pricing structure, while predictable, may not offer the same level of
cost control and optimization as Cassandra's open-source nature. Cassandra allows Swiggy to
have more control over infrastructure costs and reduces the risk of vendor lock-in, aligning with
the company's cost optimization goals.

Conclusion:
In summary, Apache Cassandra presents itself as a compelling alternative to DynamoDB,
offering greater flexibility in data modeling, more robust querying capabilities, cost control
advantages, and vendor independence. This transition to Cassandra could enhance efficiency
and scalability in managing Swiggy's transactional and CDC log data.

You might also like