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
질문됨 일 년 전345회 조회
1개 답변
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
답변함 일 년 전
profile pictureAWS
전문가
Chris_G
검토됨 일 년 전
  • thanks ted - some good links that I'll follow up on

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠