Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] timeline query #41

Open
WiHHi-Z3-PuX opened this issue Jan 17, 2023 · 1 comment
Open

[Question] timeline query #41

WiHHi-Z3-PuX opened this issue Jan 17, 2023 · 1 comment

Comments

@WiHHi-Z3-PuX
Copy link

Hi
great intro to DynamoDB!

a question:
how would you write a query/route for getting the latest photos from the users you follow, i.e. timeline?

I can think of a way with a batch get items, but that would probably become inefficient very quickly especially if the route supports pagination/gets page X number as an input and returns only the latest Y items as a page while skipping X * page size items.

@alexdebrie
Copy link
Owner

Hey @WiHHi-Z3-PuX, glad you liked it!

Great question. A timeline is a pretty complicated many-to-many setup (each timeline will have many posts, and a post can appear in many timelines), and it's probably not something you would want to calculate on the fly. You'd probably have some other system that is helping to pre-materialize it in some way to avoid on-demand calculation. Accordingly, I didn't include it here.

Hope that helps! Let me know if you have any other questions. Feel free to close if this answers it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants