7 Common DynamoDB Patterns for Modeling and Building an App with Alex De Brie

  Рет қаралды 50,482

FooBar Serverless

FooBar Serverless

Күн бұрын

DynamoDB is one of the most common databases for building serverless applications. But we don't know how to model our data for fitting in a DynamoDB table. One of the best practices for modeling data is the single table design that is a new concept that we need to learn.
In this video Alex De Brie - AWS Data Hero, will show us 7 patterns and good practices that will help us with the modeling and building an application in real life.
00:00 - Introduction
04:09 - Why DynamoDB?
07:37 - Some foundational concepts for getting started
15:16 - Starting with the demo
19:05 - How to model your data?
26:11 - How to keep up with data changing in the single table design?
30:48 - Walking through the code
37:42 - Abstract class for base entities
46:02 - getClient function to improve the performance
52:32 - Using ULIDs as unique, sortable identifiers
57:00 - Tracking reference counts with transactions
01:01:05 - Query operations in DynamoDB
01:04:00 - Many to many relationships
Get the code: github.com/alexdebrie/dynamod...
Find Alex in the internet
- Twitter: / alexbdebrie
- The DynamoDB book: www.dynamodbbook.com/
📼 Related videos
▪️ Interview with Rick Houlihan about DynamoDB and single table design: • AMAZON MIGRATION FROM ... (part 1) and • THE BIGGEST SAVING OF ... (part 2)
▪️ Playlist on basic data modeling for DynamoDB step by step: • DynamoDB advanced data...
#foobar #serverless
☁️ Topics covered include:
- DynamoDB
-nosql databases
- data modeling
- best practices for database design
- global index
- partition key and sort key
⭐ SUBSCRIBE TO THIS CHANNEL: bit.ly/foobar-youtube
⭐SHARE THIS VIDEO: • 7 Common DynamoDB Patt...
☆☆ FOLLOW ME ONLINE ☆☆
🐦 Twitter: / mavi888uy
📺 AWS Spanish KZfaq Channel: bit.ly/aws-esp-yt
📷 Instagram: foobar_codes
📚 All my Serverless Courses: marcia.dev/courses/
✍️ My blog - blog.marcia.dev
☆☆ ABOUT FOOBAR ☆☆
In this channel, you can find mostly coding tutorials related to cloud and serverless.
In addition, I like also talking about architecture, software design, motivation, and leadership.
There is a new video every Tuesday, so stay tuned :)
🎥 Recording equipment: blog.marcia.dev/my-recording-...
📚 My favorite books: blog.marcia.dev/my-books-reco...

Пікірлер: 75
@simranbayas810
@simranbayas810 3 жыл бұрын
OMG, didn't see this coming. "Marcia and Alex" Dream Team, period.
@foobar_codes
@foobar_codes 3 жыл бұрын
thankss :D
@UnknownIdentityDE
@UnknownIdentityDE Жыл бұрын
The best DynamoDB tutorial I have seen to date. I love the clean and simple code.
@apidas
@apidas 2 жыл бұрын
Thank you so much Marcia and Alex for making this video possible
@BrendanGrainger
@BrendanGrainger 2 жыл бұрын
Thank you so much for this Marcia and Alex. This was so helpful.
@ediancomachio2783
@ediancomachio2783 3 жыл бұрын
THIS IS AWESOME! I'm so glad I've subscribed to this channel
@dbs1uk
@dbs1uk 3 жыл бұрын
This is an excellent non-trivial example. It's also the cleanest approach to working with DynamoDB that I've seen to date 👏👏👏
@foobar_codes
@foobar_codes 3 жыл бұрын
Thanks! Alex is amazing
@jpablonov
@jpablonov 2 жыл бұрын
Muchas gracias Marcia por esta excelente entrevista con Alex!!!!! Saludos desde argentina!!
@rickfarina9835
@rickfarina9835 3 жыл бұрын
Excellent... I like the use of TypeScript and the abstraction to simplify access. Really well done and informative. Still have questions though on writing DDB Single Table app when working with legacy system where entities already exist. Would like to hear more about that. Again, Excellent presentation!! Thank you Marcia and Alex!
@Johnathanaa7
@Johnathanaa7 3 жыл бұрын
Great video, loved the way you all walked through the steps of designing
@foobar_codes
@foobar_codes 3 жыл бұрын
Thank you! Cheers!
@jdd1955
@jdd1955 3 жыл бұрын
This was incredible, i've been using DynamoDB for awhile now and this helped reinforce something that I have been doing as well as answer a few questions on some best practices and provide ideas on how to design future projects. Thank you so much Marcia and Alex.
@foobar_codes
@foobar_codes 3 жыл бұрын
Great to hear!
@nicolasaguilar9209
@nicolasaguilar9209 Жыл бұрын
same here
2 жыл бұрын
Excellent contribution, I heard about his DynamoDB book and this video fits perfectly as an introduction.
@engineforce
@engineforce 2 жыл бұрын
Thanks so much for this video and having table of content in your descriptions is really useful.
@foobar_codes
@foobar_codes 2 жыл бұрын
Happy that it helps
@garywaddell6309
@garywaddell6309 3 жыл бұрын
Alex is world class, he has so much integrity, I’d support anything he produces 🙌🏻
@foobar_codes
@foobar_codes 3 жыл бұрын
he is great :)
@garywaddell6309
@garywaddell6309 3 жыл бұрын
@@foobar_codes And of course you are too Marcia :)
@abhinavkapoor321
@abhinavkapoor321 2 жыл бұрын
@@foobar_codes Sure Alex is great, but Marcia it is awesome how you ask questions from your guests to get more details that otherwise could be taken for granted by subject matter experts. Thanks a lot for the awesome content.
@RicoMinovo
@RicoMinovo 2 жыл бұрын
Thanks! Nicely explained at a high and low level .
@bisadelara5933
@bisadelara5933 3 жыл бұрын
Thanks so much ! Appreciate the effort of bringing all this content !
@foobar_codes
@foobar_codes 3 жыл бұрын
Glad you enjoy it!
@56faisal
@56faisal 3 жыл бұрын
Wow! this is really great stuff! Thank you both for this :D
@foobar_codes
@foobar_codes 3 жыл бұрын
Our pleasure!
@uzair004
@uzair004 Жыл бұрын
not only great dynamodb video, but for coding best practices as well. I have been working in a project from a while & we are using these ulid, re-usable componenets/methods, excel sheets for access patterns. found the source probably :D
@WisoAp
@WisoAp 3 жыл бұрын
Thank you for this video :) Spanish community deserves this awesome stuff as well!!
@foobar_codes
@foobar_codes 3 жыл бұрын
Hahhaa now i need to find a Spanish version of alex 🤷🏽‍♀️
@tringuyenucminh167
@tringuyenucminh167 2 жыл бұрын
It's very helpful for me. Thank you so much Marcia and Alex ^^
@foobar_codes
@foobar_codes 2 жыл бұрын
Happy to help!
@MrJulito88
@MrJulito88 2 жыл бұрын
Great presentation of DynamoDB possibilities
@Deiefe
@Deiefe 2 жыл бұрын
This is great, thanks heaps both for these explanations!
@foobar_codes
@foobar_codes 2 жыл бұрын
Glad it was helpful!
@ivorpad
@ivorpad 3 жыл бұрын
This was really good. Learned tons about DDB. I didn't know about ULIDs either 👍
@foobar_codes
@foobar_codes 3 жыл бұрын
yes ULID lib is great!
@AndiFotschl-dy2vb
@AndiFotschl-dy2vb Жыл бұрын
Thx Marcia! Having seen this video, makes the DynamoDB setup so much more human in the project I'm working on. 🎉
@foobar_codes
@foobar_codes Жыл бұрын
Great to hear
@jeffreypalma4498
@jeffreypalma4498 3 жыл бұрын
Thank you. Good class.
@cristianyesid99
@cristianyesid99 2 жыл бұрын
Thank you very much for the video!
@cristianpallares3847
@cristianpallares3847 3 жыл бұрын
Love ulid! I was already using it with DynamoDB and the ordering property is awesome.
@foobar_codes
@foobar_codes 3 жыл бұрын
Yesss this library is really useful
@rohitkochar9022
@rohitkochar9022 2 жыл бұрын
Amazing talk as always Alex. Love your videos and I have learnt a lot. One quick qs. I created a GSI on one of the date column but since I have to do a between , I had to use scan operation. Is this a bad way to get data? I can use index with query but that won't let me do any between.
@benjaminiduwe2958
@benjaminiduwe2958 Жыл бұрын
Great content, I learnt a lot from this video.
@foobar_codes
@foobar_codes Жыл бұрын
Awsome! Thanks for the message
@vardaanaashish6753
@vardaanaashish6753 Жыл бұрын
Fantastic content!
@foobar_codes
@foobar_codes Жыл бұрын
Thanks
@tkjnnmf5315
@tkjnnmf5315 2 жыл бұрын
Really useful channel Thx!
@foobar_codes
@foobar_codes 2 жыл бұрын
Happy to help!
@yassermh5851
@yassermh5851 2 жыл бұрын
How would you get all the photos of the people a user follows? like in the home page of instagram, it shows all the photos of the users you have followed. Do you query all the followed of that users and then query each of them one by one to see if there is a new photo?
@GilluanFormiga
@GilluanFormiga 2 жыл бұрын
Nice video.
@AntonRand90
@AntonRand90 Жыл бұрын
Great video 🎉 Should ULIDs only be for Sort Keys rather than a PK? I thought a PK should ideally generate values that will be evenly spread over partitions. I like the concept of ULID but does it increase the risk of hot partitions much?
@alambertt
@alambertt 3 жыл бұрын
No puede ser... Hoy mismo estaba viendo este mismo tema 🤯🤯🤯🤯 Wow Gracias Marcia. Me gustaría un vídeo ahora en español. De todas formas este lo voy a ver. Gracias 😊😊😀
@foobar_codes
@foobar_codes 3 жыл бұрын
este video no creo que pueda estar en español tal cual, ya que alex solo esta en ingles. pero seguramente hare una serie de dynamo en español en el futuro. que bueno que te gusto este video
@alambertt
@alambertt 3 жыл бұрын
@@foobar_codes excelente 👍🏻🤗 Esperaremos la serie de DynamoDB con ansias. Es una excelente BD. Ya vi los Reinvent 🤯 Realmente es genial
@ryandsouza2962
@ryandsouza2962 3 жыл бұрын
Awesome video! DDB is ♥️
@foobar_codes
@foobar_codes 3 жыл бұрын
It really is!
@aminebioudi8414
@aminebioudi8414 Жыл бұрын
what a great explanation ... i do have one question: why on the sheet file we have main table for list likes for photo and not for list comments for photo ?
@b1021
@b1021 11 ай бұрын
Given the model shown, how would you query the table to return all users?
@squidwurrd
@squidwurrd 3 жыл бұрын
Got the book!
@Trademm
@Trademm 2 жыл бұрын
What i needed
@michaelkrison
@michaelkrison 3 жыл бұрын
Awesome..
@foobar_codes
@foobar_codes 3 жыл бұрын
Thanks 🤗
@SergioAdonis
@SergioAdonis 2 жыл бұрын
Este video es oro
@omar-salim
@omar-salim Жыл бұрын
thanks for the great tutorial, I have a question though, how to list down unfollowed users? in order to follow a user the application needs to provide a set of unfollowed users, right ? I don't think we should design an access pattern for this. The only solution in my mind is perform a fake join at the lambda code level which is discouraged when using DynamoDB. Any better suggestion?
@mohamedjavithurrahuman2218
@mohamedjavithurrahuman2218 3 жыл бұрын
Useful
@foobar_codes
@foobar_codes 3 жыл бұрын
Glad you think so!
@jean-louisgouwy
@jean-louisgouwy 2 жыл бұрын
It was really helpful to understand the basic of the one-single-db pattern. But one question, for example,, you put the User entity in the same table than follows, photos, etc ... But usually, in a microservice-based company/project , we will have a "user service", "media service", "post service" which will manage all their own business rules, right ? So concretely, in that case this pattern is still useful ? Or you duplicate data to avoid to make some proxy endpoint ?
@Brajgamer
@Brajgamer Жыл бұрын
I think it depends on the team compositions. First thing is that microservices are primarily for teams autonomy. So if we keep the teams autonomy then i think table per microservice is good. If we have a central authority for db like a dba then i think we can have a single table design.
@CosmosCR
@CosmosCR 2 жыл бұрын
The simplest thing i cant seem to figure out with dynamo.. How would go get a list of users who follow both "foobar" and "alex"? Or users who liked 2 different phots?
@HaibertBuilds
@HaibertBuilds Жыл бұрын
I feel like I gotta watch this 4 times to get my brain to actual consume all of this and digest it. Im legit hating myself for trying to learn noSQL lol
@kvsantosh
@kvsantosh 2 жыл бұрын
Good video. One question on scalability, lets say a photo gets multiple millions likes, in the current schema all the likes will have same PK. Do we not run the risk of hitting the limits of 10GB size limit per partition?
@Brajgamer
@Brajgamer Жыл бұрын
Yes we do, in that case one patter which i have used is that you pick a set of numbers let's say 1 to 100, and then whenever you store a like you just suffix or prefix a random number from that set in the sort key. That way your million likes would be distributed in 100 different partitions. Then you can keep a total count separately just like he did in this video with the likescount using transaction.
@sashikadulaj5209
@sashikadulaj5209 6 ай бұрын
Really helpful
EVOLUTION OF ICE CREAM 😱 #shorts
00:11
Savage Vlogs
Рет қаралды 12 МЛН
Ouch.. 🤕
00:30
Celine & Michiel
Рет қаралды 28 МЛН
Advanced Step Functions Patterns with Ben Smith
39:48
FooBar Serverless
Рет қаралды 950
What is a DynamoDB GSI (Global Secondary Index) ?
10:19
Be A Better Dev
Рет қаралды 116 М.
What is a DynamoDB Stream? (And why you should be using it!)
14:59
Be A Better Dev
Рет қаралды 63 М.
Single-Table Design with DynamoDB - Alex DeBrie, AWS Data Hero
1:09:32
AWS Portsmouth User Group
Рет қаралды 64 М.
Chunked Responses: Scaling File Exports for Production
8:27
Code & Stuff
Рет қаралды 737
The man who wrote the book on DynamoDB | 040
58:08
Backend Banter
Рет қаралды 1,7 М.
разбил телефон из-за видео
0:15
STANISLAVSKIY Hi
Рет қаралды 751 М.
Vision Pro наконец-то доработали! Но не Apple!
0:40
ÉЖИ АКСЁНОВ
Рет қаралды 691 М.
$1 vs $100,000 Slow Motion Camera!
0:44
Hafu Go
Рет қаралды 29 МЛН
Looks very comfortable. #leddisplay #ledscreen #ledwall #eagerled
0:19
LED Screen Factory-EagerLED
Рет қаралды 13 МЛН