0

I got the following table, I made a quick mock with a reduced set of attributes

dummy table

I now have to solve these two access-patterns without a GSI, since I need the current real data from the table. GSI take some time to reflect the current values of the table.

My first access pattern is get all appointments within a certain date-range

My second access pattern is get all appointments by origin and originId

I can't use a GSI since I need to detect collisions for the the appointments by speakerId.

I'm using electro-db as an ORM which is why in the sk there is $... it's the collection name. Meaning I'm not able to store it like that 2024-02-02T08:00:00.000Z in the SK.

I could do a query and get all appointments for a speaker and filter the appointments afterwards. I think this isn't a great solution, since this would mean I'd load appointments from all the years even though they aren't required to detect if a collisions occurs.

For my access pattern where I want to load all the appointments by origin and originId, the querying all appointments for a specific set of items doesn't look right to me tott (I could solve that with a batchGetItem or a loop with getItem).

My issue is the access pattern for the collisions where I need to load all the appointments within a certain range.

Any hints how I could tackle this issue?

1 Answer 1

0

I can get all the Items for a appointments by originId using a batchGet in combination with a backoff algorithm. The between with only using the composite key start as the start range and the end range by incrementing my composite start key by 1 day since dynamodb uses the lexicographical order. I'm still uncertain if thats the best way. Maybe someone got a better answer

Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.