Introduction to Amazon DynamoDB
2 min readMay 28, 2021
What is a DynamoDB???
- DynamoDB is a key-value, NoSQL database developed by Amazon. It’s unlike some other products offered by Amazon and other vendors in that it’s not just an open source system, like Spark, hosted on the vendor’s platform.
- Amazon wrote this for their own internal needs and now they make it available to their customers.
How does DynamoDB work???
- DynamoDB looks just like JSON, with the one difference being that each JSON record must include the record key.
- That has the advantage that it lets you do updates on a record. In a JSON database, like MongoDB, you cannot update records. Instead you must delete them then add back the changed version to effect the same change.
- DynamoDB also lets you work with transactions, something that MongoDB supports as well. Not all NoSQL databases let you do that.
- This is important as certain database operations logically must go together. For example, a sales transaction must both decrement inventory and increase cash-on-hand.
- If one of those two operations failed then the sales and inventory systems would be out of balance.
DynamoDB Definitions
- Table: a collection of items
- Item: a collection of attributes. (Other databases call these records or documents.)
- Stream: like a cache that holds changes in memory until they are flushed to storage.
- Partition key: the primary key. It must be unique.
- Partition key and sort key: a composite primary key, meaning a partition key with more than one attribute, like employee name and employee ID (necessary because two employees could have the same name).
- Secondary indexes: you can index other attributes that you frequently query to speed up reads.
API and SDK
- As with most cloud systems, DynamoDB exposes its services via web services. But that does not mean you have to format your data to JSON and then post it using HTTP. Instead they provide software development kits (SDKs).
- The SDK takes the requests you send it and then translates that to HTTP calls behind the scenes. In this way, the SDK provides a more natural and far less wordy way to work with the database. The SDK lets you work with DynamoDB as you would work with regular objects.
Its all about DynamoDB Introduction..
Happy Hacking..💥