dynobase-icon
Dynobase

DynamoDB vs Amazon Keyspaces - The Ultimate Comparison

Lakindu Hewawasam

Written by Lakindu Hewawasam

Published on September 14th, 2022

    Still using AWS console to work with DynamoDB? 🙈

    Time to 10x your DynamoDB productivity with Dynobase [learn more]

    Amazon DynamoDB and Amazon Keyspaces are two popular NoSQL database services offered by AWS. Both services provide extraordinarily scalable and high-performing databases to process serverless application requests with minimal latency. Therefore, deciding between the two is often difficult.

    This article aims to provide an in-depth review of Amazon DynamoDB and Amazon Keyspaces to understand each service and how they compare against each other.

    DynamoDB and Amazon Keyspaces: An Overview

    DynamoDB

    Amazon DynamoDB is a serverless, fully-managed NoSQL and key-value database. It allows developers to build high-performing, scalable, demanding, and mission-critical applications with single-digit millisecond request/response latency. Additionally, DynamoDB implements a scalable partition approach that provides an O(1) time complexity. So, regardless of the dataset size, DynamoDB will always respond with single-digit millisecond latency while automatically replicating data across three availability zones within a region.

    Amazon Keyspaces

    Amazon Keyspaces is a serverless, fully-managed NoSQL database built for managing Cassandra workloads. Amazon Keyspaces also offers consistent, single-digit millisecond latency at scale and can process over 1000 requests per second. Additionally, it provides three-time data replication across multiple availability zones ensuring high availability.

    DynamoDB and Amazon Keyspaces: Shared Attributes

    Both databases share some similarities. For instance, both databases are NoSQL, key-value, and fully managed databases powered by serverless architecture. Therefore, both databases can scale horizontally and withstand extreme loads with no performance loss.

    On the other hand, these two databases also have some significant differences. For example, DynamoDB has a limit of 400KB per item, while Amazon Keyspaces has a limit of 1MB per row.

    Performance & Latency

    DynamoDB

    DynamoDB can handle requests at single-digit millisecond latency despite the request count. For example, it can handle 10 trillion requests per day while offering single-digit millisecond latency to all requests with no performance loss.

    Additionally, it uses a request router that redirects the request to a partition in which the data is stored (in the SSD array), ensuring that DynamoDB only scans a limited set of data (even if your dataset is one terabyte). Finally, it achieves a time complexity of O(1), ensuring that DynamoDB consistently performs well as the dataset scales.

    Additionally, integrating DAX (DynamoDB Accelerator) can help improve the response time to microseconds, making it even faster for read-heavy workloads.

    Amazon Keyspaces

    Amazon Keyspaces is a high-performing database that can offer single-digit millisecond latency to client requests, thus allowing developers to build low-latency and highly-scalable mission-critical Cassandra workloads. It is designed to be compatible with Apache Cassandra, making it easier for organizations to migrate their existing Cassandra workloads to AWS without significant changes to their application code.

    Availability & Durability

    DynamoDB

    DynamoDB spreads incoming requests across multiple servers to distribute the load and avoid performance bottlenecks and throttling. Additionally, DynamoDB replicates data across multiple availability zones (AZ), ensuring high availability if an AZ goes down.

    Amazon Keyspaces

    Amazon Keyspaces also replicates your data thrice across multiple availability zones to improve durability. It ensures that your data will be accessible even if one availability zone goes down. Additionally, Amazon Keyspaces offers an availability of 99.99% in their SLA.

    Security

    DynamoDB

    DynamoDB supports encryption at rest using AWS Key Management Service (KMS). With DynamoDB, developers can utilize three kinds of KMS keys to encrypt data.

    • AWS Owned Key: This is the free encryption type offered by AWS, where DynamoDB owns and manages the encryption key.
    • AWS Managed Key: This is where you can store the key in your AWS account and let AWS KMS manage it.
    • Customer Managed Key: This is where you are given the ability to create and manage the KMS key.

    Finally, DynamoDB uses AWS IAM to help developers define granular access to DynamoDB resources across multiple services (such as Lambda).

    Amazon Keyspaces

    Amazon Keyspaces uses encryption at rest and in transit by default. Out of the box, Amazon Keyspaces uses an AWS Owned Key for encryption. At the same time, developers are given the capability to configure the encryption to use either an AWS Managed or Customer Managed Key.

    Scalability

    DynamoDB

    Scaling DynamoDB depends on the way the data structure is modeled. For example, if you were building an application that uses a team and partitioned data based on teams, DynamoDB would start to throttle as the users per team grow. As a result, the number of requests that enter the partition increase and creates a hot partition that can cause performance issues as the system scales.

    However, if modeled correctly, DynamoDB can serve over a million customers with single-digit millisecond latency, making the service extremely scalable. DynamoDB also supports auto-scaling, which adjusts the provisioned throughput capacity automatically based on the actual traffic patterns.

    Amazon Keyspaces

    Amazon Keyspaces offers two approaches to implementing scalability.

    • On-Demand Capacity: Amazon Keyspaces will automatically manage the number of reads and writes per second and scale up automatically when needed to handle sudden request loads. Suitable for unpredictable workloads.
    • Provisioned Capacity: Developers can define the number of reads and writes per second they expect for a single table. However, it is recommended to use this approach only when the workload is predictable.

    Backups

    DynamoDB

    DynamoDB offers two kinds of data backup.

    • Point-in-time recovery: DynamoDB continuously creates backups for a given table and lets developers perform rollback operations within the last 35 days.
    • On-demand: On-demand backups allow developers to create full table backups with no performance overhead.

    Amazon Keyspaces

    Amazon Keyspaces also uses point-in-time recovery to allow developers to restore data of a given table in case of accidental deletes within the last 35 days. Additionally, Amazon Keyspaces supports automated backups, which can be scheduled to ensure data protection and compliance.

    Pricing

    DynamoDB

    DynamoDB charges you on a pay-as-you-use basis. But, if you use a provisioned billing model, you will have to pay for the provisioned throughput even if you do not utilize it.

    The DynamoDB pricing plans are further explained below.

    • On-Demand Pricing - AWS calculates the bill based on the throughput consumed for the month. You may also get additionally billed for the backup storage and other DynamoDB services you may consume.
    • Provisioned Pricing - AWS charges a developer for the provisioned throughput.

    Amazon Keyspaces

    Amazon Keyspaces also offers 2 pricing models:

    • On-Demand Pricing - You are only billed for the number of reads and writes per second/month.
    • Provisioned Pricing - You are billed for the number of reads and writes per second you have provisioned.

    Besides, Amazon Keyspaces charges for every million requests (reads or writes per month). For example, Amazon Keyspaces charges 1.8212 USD per million write request units in the Asia Pacific region. These prices can differ based on the region you select.

    DynamoDB and Amazon Keyspaces Use Cases

    DynamoDB

    DynamoDB is a good option for building applications that process millions of concurrent requests per second and require low-latency responses.

    You can use DynamoDB in the following situations:

    • Building scalable, fast applications.
    • Building a near-real-time application such as a sensory application.
    • E-commerce platforms that require high availability and low latency.
    • Gaming applications that need to handle large volumes of player data in real-time.
    • IoT applications that collect and process data from numerous devices.

    Amazon Keyspaces

    Since Amazon Keyspaces is a scalable and serverless NoSQL Database like DynamoDB, both of these share similar use cases. For example, you can use Amazon Keyspaces to build applications that require low latency.

    However, I recommend using Amazon Keyspaces only when planning to move an Apache Cassandra workload to the cloud. It is particularly useful for organizations that have existing Cassandra deployments and want to leverage AWS's managed services to reduce operational overhead.

    Conclusion

    This article provided an in-depth guide on DynamoDB and Amazon Keyspaces to help you understand how each service works and compare them to each other. It is essential to understand that there is no "best" database you can use, as it depends on your use case.

    I hope that you found this article helpful! Thank you for reading!

    Tired of switching accounts and regions? Use Dynobase.

    First 7 days are. No credit card needed.

    Product Features

    Download
    /
    Changelog
    /
    Pricing
    /
    Member Portal
    /
    Privacy
    /
    EULA
    /
    Twitter
    /
    Affiliates & Influencers
    © 2024 Dynobase