What is a DynamoDB GSI and How to Create One?
Вставка
- Опубліковано 1 жов 2024
- In this video, I show you how to create a DynamoDB Global Secondary Index (or GSI for short). I also explain to you how GSI's work and how to query them through the AWS Console.
Looking to get hands on experience building on AWS with a REAL project? Check out my course - The AWS Learning Accelerator! courses.beabet...
🎉SUPPORT BE A BETTER DEV🎉
Become a Patron: / beabetterdev
📚 MY RECOMMENDED READING LIST FOR SOFTWARE DEVELOPERS📚
Clean Code - amzn.to/37T7xdP
Clean Architecture - amzn.to/3sCEGCe
Head First Design Patterns - amzn.to/37WXAMy
Domain Driven Design - amzn.to/3aWSW2W
Code Complete - amzn.to/3ksQDrB
The Pragmatic Programmer - amzn.to/3uH4kaQ
Algorithms - amzn.to/3syvyP5
Working Effectively with Legacy Code - amzn.to/3kvMza7
Refactoring - amzn.to/3r6FQ8U
🎙 MY RECORDING EQUIPMENT 🎙
Shure SM58 Microphone - amzn.to/3r5Hrf9
Behringer UM2 Audio Interface - amzn.to/2MuEllM
XLR Cable - amzn.to/3uGyZFx
Acoustic Sound Absorbing Foam Panels - amzn.to/3ktIrY6
Desk Microphone Mount - amzn.to/3qXMVIO
Logitech C920s Webcam - amzn.to/303zGu9
Fujilm XS10 Camera - amzn.to/3uGa30E
Fujifilm XF 35mm F2 Lens - amzn.to/3rentPe
Neewer 2 Piece Studio Lights - amzn.to/3uyoa8p
💻 MY DESKTOP EQUIPMENT 💻
Dell 34 inch Ultrawide Monitor - amzn.to/2NJwph6
Autonomous ErgoChair 2 - bit.ly/2YzomEm
Autonomous SmartDesk 2 Standing Desk - bit.ly/2YzomEm
MX Master 3 Productivity Mouse - amzn.to/3aYwKVZ
Das Keyboard Prime 13 MX Brown Mechanical- amzn.to/3uH6VBF
Veikk A15 Drawing Tablet - amzn.to/3uBRWsN
🌎 Find me here:
Twitter - / beabetterdevv
Instagram - / beabetterdevv
Patreon - Donations help fund additional content - / beabetterdev
#AWS
#DynamoDB
#GSI
I've created indexes multiple times, keep getting count = 0 size = 0. Pretty sure I'm using all the keys values and data types correctly, but for some reason its not populating my index
really helpful. Can AWS hire you to make more educational video??
Hah maybe one day!
Great content, Thanks a lot, please cover backup and restore topic.
Very well explained, thanks a lot !!!
very helpful thanks!
Thank you. Great content!
20
Great content as always
Glad you enjoyed it
Thanks
This was great, thank you for the explanation. We are in a similar situation where we want to pull records by a customer id and timestamp, however, we have a third field being an agencyId since more than one agency can contact a customer. So for our index, I have the PK agencyId and the SK customerId. Is there any way to still sort this by timestamp?
It may be possible to append the timestamp to your sort key. So you can have something like Customer1_2020-01-01 in one record and Customer1_2020-02-02 in another. Then, when you query your agencyID GSI, you provide the agencyId and in your query expression, use "BeginsWith" CustomerId1, and sort by ascending/descending based on what you need.
Hope this helps and I didn't misunderstand your data models :P
@@BeABetterDev Nope, you didn't misunderstand at all. That would actually work just fine. I appreciate your response!
Great Video, thank you for all the information! I have a question about filtering - which solution would you approach if you wanted to filter with multiple conditions? Equivalent to: WHERE country=„…“ & age=„…“ & … and so on (note: country and age are not pk or sk and without using filterExpressions)
Or is there not a nice solution with dynamodb to that and aurora would be a better choice?
Thank you in advance
Hi George. One option is to pre-join your data so that you can query on a field that contains both the country and age you're looking for. One of the drawbacks with using Dynamo DB is queries that require filtering on multiple different attributes can be difficult to model. It sounds like your use case is better suited for a relational database like Aurora. Hope this helps.
@@BeABetterDev Hi, yes it helped me - thank you so much
yes, i will need to filter through many attributes at the same time so i guess Aurora is really the best choice - but with which one would you go - Aurora MySQL or Aurora PostgreSQL? what would be your criteria to decide between these two?