DynamoDB table design

0

I'm new to DynamoDB, but have worked for over 20 years with SQL Server. I need to design a table of call recordings, but I'm struggling with the whole thing because it seems very different to the tables I'm used to.

I need to store the following information:

RecordingID (GUID / string) CallersNumber (string) DialledNumber (string) Direction (string) (inbound/outbound call) CreatedTime (datetime) StartTime(datetime) EndTime(datetime) AgentIDs (list) - agents involved in the call QueueIDs (list) - call centre queues FilePath (string) - URL to call recording

I'd like to share the table creation script, but I can't see anywhere to generate one (an issue for later when deploying to a customer site). I've created the RecordingID as a partition ID, then added the other fields as attributes.

I have two issues:

  1. I need to run searches on all the fields, but can only do a scan not a query because they're not the partition key - which is a bit rubbish, in SQL you simply add an index to avoid an expensive scan.

  2. On the front end app, paging is failing to work because the primary key, RecordingID (e.g. ebda49c6-17fa-4468-8417-aad7322251bb), is not correctly ordered correctly and so when I retrieve a record set the LastEvaluatedKey/ExclusiveLastKey method of paging is not working.

Am I using the right table design?

Nick
asked a year ago330 views
1 Answer
1

The short answer is that table design in a NoSQL database like DynamoDB is different than in a SQL database. DynamoDB is built to handle internet scale, which gives it some distinct advantages.

What is internet scale?

DynamoDB supports some of the largest scale applications in the world by providing consistent, single-digit millisecond response times at any scale. With DynamoDB, you can build applications with virtually unlimited throughput and storage.

To enable this extreme size and performance for your data, there is a trade-off: you have to partition your data. Your table is laid out in storage by the primary key that you query by. To query by additional factors, you can create Global Secondary Indexes and Local Secondary Indexes. You can learn more about these indexes and how to use them here: https://medium.com/@jun711.g/aws-dynamodb-global-and-local-secondary-indexes-comparison-80f4c587b1d7

To data model in DynamoDB, you can use a tool called NoSQL Workbench. This tool is available for download here: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/workbench.html

If you want to learn more about DynamoDB, there are some good workshops available here: https://amazon-dynamodb-labs.workshop.aws/

profile pictureAWS
answered a year ago
profile pictureAWS
EXPERT
Chris_G
reviewed a year ago
  • thanks ted - some good links that I'll follow up on

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions