What is DynamoDB? Features, What it can and cannot do

Explanation of DynamoDB as a rough. Clarify the image. Compare with other DBs.


Features of DynamoDB

  • DynamoDB is a DB with data storage restrictions to enable high-speed data processing
  • DynamoDB is a document-type database that stores and processes data in JSON format
  • JSON can be used to store semi-structured data such as Tags
  • Fast data retrieval and manipulation from within JSON documents
  • DynamoDB is suitable for fast processing of simple data formats belonging to key-value types.
  • DynamoDB's Time-to-Live (TTL) mechanism makes it easy to manage application web sessions
  • Can store structured data indexed by primary key
  • Low latency read and write access to items ranging from 1 Byte up to 400 KB
  • DynamoDB is not backup enabled by default


DynamoDB Availability

  • Distributed in multi-AZ in default configuration


Processing speed of DynamoDB

  • Can handle more than 10 trillion requests per day
  • NoSQL database capable of processing more than 20 million requests per second


What DynamoDB is good at

  • The best DB for storing metadata
  • Used for IoT data, session data management, etc.


    What you can't do with DynamoDB

    • Execute SQL query processing
    • No date or time type (can only be recorded as a number or string)
      • Numeric: Time stamp
      • String: ISO 8601


    How to use DynamoDB - Examples

    source code


    Reference Site


    About DynamoDB Streams

    When the DynamoDB stream is enabled, ...

    By enabling the DynamoDB stream, the

    Triggers events such as data registration and update to DynamoDB tables, which can be processed by executing Lambda functions, etc.It is.


    Once the DynamoDB stream is enabled, the

    It is also possible to retrieve data from DynamoDB, but it is not a process that retrieves data on a regular basis, but rather is event activated
    The data can also be retrieved from DynamoDB, but this is not a periodic process.


    Using DynamoDB streams
    Change status to DynamoDB tables can be kept in history

    This can also be monitored to implement change management.

    All streams of changes made to the data in that table in the past 24 hours are accessible, and stream data that is 24 hours old is deleted.

    After activating the DynamoDB stream
    The process of retrieving metadata from the change event can be automated using Lambda functions, etc.
    The following is an example of a Lambda function that can be used to automate this process.


    The DynamoDB stream itself is not a function for monitoring, but only for capturing change information and using that information separately.


    Uses for DynamoDB streams include cross-region replication and asynchronous processing for user aggregation and analysis for games, social sites, etc.


    It is possible to configure CloudWatch to capture and monitor DynamoDB streams, but this is not a function of the streams.

    use case

    Establish a mechanism to store metadata in S3 when data is registered in DynamoDB

    After registering data to DynamoDB, it is desirable for the configuration to automatically launch a Lambda function to register metadata

    To do so, a mechanism called DynamoDB stream can be used to trigger data registration to DynamoDB tables to launch Lambda functions.

    Lambda functions can handle up to 512 MB of data.


    Services that can work with DynamoDB


    DynamoDB is a durable, scalable, and highly available data store that can be used for real-time data aggregation processing.

    Using AppSync, you can easily build collaborative apps that keep DynamoDB data up-to-date in real time.

    This allows applications to access data in Amazon DynamoDB, EC2 instances and AWS Lambda functions to perform data processing, and other functions to be implemented.

    Therefore, it is possible to implement real-time processing functions by linking DynamoDB and AppSync


    The combination of DynamoDB and EMR enables big data stored in DynamoDB to be analyzed and processed by EMR. EMR is a service that can run Apach Hadoop and other services for big data analysis processing, and for real-time behavioral analysis and ranking processing AppSync is the best choice for real-time behavioral analysis and ranking processing.


    It is possible with DynamoDB and Lambda to use Lambda to perform ranking processes using DynamoDB data, but it is preferable to use real-time processing with AppSync


    API Gateway

    In addition to DynamoDB and API Gateway, a Lambda function can be combined to call DynamoDB data from the API, but this is not suitable for the requirements of this case.


    About History Storage

    DynamoDB streams can be used to maintain a history of additions, modifications, and deletions to data items stored in the database as they occur.

    DynamoDB streams can capture changes to items stored in DynamoDB tables. For example, when a user adds data to a DynamoDB table, this event can be used as a starting point to create a function that sends an email to the data administrator to notify them of the DynamoDB changes.

    DynamoDB streams capture a chronological sequence of item-level changes in a DynamoDB table and log this information for up to 24 hours


    To speed up the response

    DynamoDB Accelerator adds a dedicated in-memory cache cluster for DynamoDB to accelerate the response from the cache from milliseconds to microseconds.


    What is query processing?

    The DynamoDB global secondary index is a feature to increase flexibility in query processing.


    To avoid spikes inexpensively

    DynamoDB is usually scalable, and while it is possible to improve performance by using DAX, DAX is expensive because it uses an in-memory DB. Therefore, a cost-effective solution is to distribute processing by SQS queues, which is the most cost-optimal solution.


    SQS is a fully managed message queue service for reliable communication between distributed software components and microservices of any size. Building applications from individual components, each performing a distinct function, improves scalability and reliability and is a best practice design for modern applications. processing requests to DynamoDB as SQS queues to DynamoDB. DynamoDB can be configured to wait for request queues that it cannot process


    Spikes can be improved by deploying DynamoDB DAX. However, since DAX adds in-memory cache DB functionality, the cost-optimal response is to prioritize processing distribution by SQS


    Cooperation with SQS

    Using SQS is an appropriate response because it can reduce the load by isolating and coordinating cloud application components.

    SQS can be used to coordinate centralized processing to DynamoDB through queuing.

    Since this requirement is to concentrate processing on a specific data area, it is more effective to enable caching by DAX.


    Cooperation with SNS

    Messaging by SNS, like SQS, can still achieve loosely coupled


    Other Functions

    DynamoDB to provisioned throughput performance, thereby changing the allocation to predictable data processing.


    About Scaling

    DynamoDB automatically scales data capacity as a managed service without activating auto-scaling for data capacity.


    About Redundancy

    DynamoDB has the ability to be deployed globally in multiple regions, but it cannot be configured in a multi-AZ configuration.


    How much does it cost?