Database Sharding and Partitioning

  Рет қаралды 97,966

Arpit Bhayani

Arpit Bhayani

Күн бұрын

Пікірлер: 169
@shishirchaurasiya7374
@shishirchaurasiya7374 Жыл бұрын
I was literally consfused in gaining the clarity untill you came to the point where you transposed this theory into understanding through tables and the reference with SQL queries, thanks a lot to your efforts for this loving beautiful explaination Arpit sir
@AlokMehta24
@AlokMehta24 Жыл бұрын
Excellent video Arpit . Coming from no software and system engineering background , this was the best video to explain data sharding and partioning . I am a Tech PM for AWS Supply Chain and data partitioning and sharding is real deal for us. Thank for making this extremely easy to understand video
@codecspy3479
@codecspy3479 Жыл бұрын
2 Important points which i felt could be discussed more are 1) When you said the choice of partitioning depends on the load , usecase and access patterns , can you please give an example of each case ?? 2) When you were talking about the advantages and disadvantages of sharding , have you written these points considering only sharding and no partitioning or have you written considering both sharding and partitioning ??
@nikhilrajput8696
@nikhilrajput8696 8 ай бұрын
Wow...really nice. Nowadays a lot of people are selling and talking about system design and always try to build some optimistic solution straight forward without going into the internals and in fact they have not even worked on a lot of systems. I strongly feel the way of your explanation is very very nice and I am going to buy your system design plan to improve mine.
@AsliEngineering
@AsliEngineering 8 ай бұрын
Thanks. Looking forward to having you enrolled 🙌
@najimali32
@najimali32 13 күн бұрын
This is excellent, high-quality content! I always had questions about sharding and partitioning, but now I understand: sharding pertains to the database server level, while partitioning is about organizing the data itself.
@garpaygavs6470
@garpaygavs6470 3 ай бұрын
I am just stunned how you describe every concept that easily and even if the concept is so complicated. I love you and your works man please continue doing it. I promise I will join as a member to this channel as soon as I become an earning developer. :D
@virendersingh9377
@virendersingh9377 2 ай бұрын
You have a brilliant way to explain, only one who has gone through the journey would be able to teach it this way.
@visheshjindal1073
@visheshjindal1073 5 ай бұрын
I have just started learning System Design and not from a backend background. Still able to understand the concepts. Thanks for creating such content.
@aksharcharagi996
@aksharcharagi996 4 ай бұрын
When i finished watching this video , concepts looked super easy. Thanks
@ishwarhingorani9825
@ishwarhingorani9825 5 ай бұрын
Great clarity and in depth explanation. Thank you
@DevendraSingh-y5f
@DevendraSingh-y5f 3 ай бұрын
Partitioning can be done at table as well. So let's consider we have a table named X and it is having huge data so if we want to increase the performance and improve the latency we can partition the table into Y shards.
@nuclearniraj
@nuclearniraj Жыл бұрын
One video and all the clutter on Sharding and Partitioning is clear. Thank you so much Arpit.
@jaskiratwalia
@jaskiratwalia 9 ай бұрын
Wonderfully explained! Cleared all my doubts. Please keep making such videos. These are also well timed, not too short nor too long.
@anandahs6078
@anandahs6078 8 ай бұрын
Very good explanation with right examples. Hats off to you. Thanks for great content. I always thought shard and partitions are same but you clarified it very well.
@Jamsessions0
@Jamsessions0 7 ай бұрын
One of the best explanations on the internet, well done sir
@movies2watchify
@movies2watchify 2 ай бұрын
liked the way concepts are explained like a story.
@yuvrajchauhan9410
@yuvrajchauhan9410 2 ай бұрын
Amazing explanation! The diagrams were really helpful in helping me solidify my understanding of the difference between sharding and partitioning.
@shrad6611
@shrad6611 Жыл бұрын
finally I understand what sharding is, thanks a ton
@AqibJavaid-zl7vc
@AqibJavaid-zl7vc 7 ай бұрын
Excellent video ❤. Finally, I got a good grasp of the whole concept.
@vipulsharma5140
@vipulsharma5140 5 ай бұрын
This is such a great and simple explanation of partitioning and sharding of a database. Would love to watch the video on partitioning strategies when it is uploaded.
@rohitsk6793
@rohitsk6793 3 ай бұрын
Thanks for these practical examples and overall explanation
@vamsidharvemuluri3817
@vamsidharvemuluri3817 8 ай бұрын
Best explanation so far. thanks brother
@chaitanyawaikar382
@chaitanyawaikar382 2 жыл бұрын
One of the best videos explaining the nuances between partitioning and sharding. Thank you @ArpitBhayani
@varshard0
@varshard0 10 ай бұрын
thank you. I always assumed that they are the same thing. This cleared things up for me.
@mystiqkc
@mystiqkc 5 ай бұрын
I looove this kind of explanation. i.e stepping back and discussing the scenarios behind why something came up to be. Thanks a lot for these videos man!
@ranjithpals
@ranjithpals 2 жыл бұрын
Thanks a lot ! That was well explained with clear and concise explanation. Looking forward to enrolling in your complete system design course.
@iMakeYoutubeConfused
@iMakeYoutubeConfused 9 ай бұрын
Very clear explanation, thanks!
@letsexplorewithanika2642
@letsexplorewithanika2642 2 жыл бұрын
Very clear explaination
@KishoreThatavarthi
@KishoreThatavarthi 10 ай бұрын
thanks a lot arpit sir really enjoyed and got full clarity
@paragtyagi3713
@paragtyagi3713 Ай бұрын
Bhai bhot videos dekhe.. this one was lit 🔥
@AsliEngineering
@AsliEngineering Ай бұрын
Thanks!
@DEEPAKKUMAR-wk5pk
@DEEPAKKUMAR-wk5pk 2 жыл бұрын
Wow great explanation
@TechSpot56
@TechSpot56 8 ай бұрын
Nice explaination, arpit.
@vijaymunavalli335
@vijaymunavalli335 2 жыл бұрын
Its very practical explanation...cool one
@iHariPatel
@iHariPatel Жыл бұрын
As my view Partition is more complex because you have to work with partition key! With wrong query accidentally query scan all partition’s.
@hanzalasiddique6313
@hanzalasiddique6313 Жыл бұрын
Mind Blowing ❤
@sameer1571
@sameer1571 11 ай бұрын
Bro your diagram example made my day. Such a clear and concise explanation of this topic. Bro dil se love u ❤❤ for making this video.
@ClarifyDeCode
@ClarifyDeCode 2 ай бұрын
All Software Performance Enthusiats 😊,Please do also watch our Playlist on Software Performance concepts !
@KetanNabera
@KetanNabera 4 күн бұрын
Great video ! Nicely explained. :) But I have one query , towards the end of the video : The example you shared for "Sharding NO and partitioning YES" about Airline Check-in System and Ticket Booking System. How is that classified as partitioning if the databases are altogether different ? Any thoughts ?
@akshayrahangdale8511
@akshayrahangdale8511 Жыл бұрын
Very Nice Video, I just loved the explanation.
@ryan-bo2xi
@ryan-bo2xi Жыл бұрын
bohot badhia bhai .. lajawwab
@pramodpatil-ue8sm
@pramodpatil-ue8sm Жыл бұрын
Great explanation, as always. Please post a link If you have recorded any video on Partitioning strategies
@shintojoseph9166
@shintojoseph9166 Жыл бұрын
Clear explanation
@jasper5016
@jasper5016 9 ай бұрын
Thanks so much Arpit!!
@ShivangGoyal-n2n
@ShivangGoyal-n2n Жыл бұрын
literally one of the based video i have ever seen on this topic.
@shreyanshsinha37
@shreyanshsinha37 2 жыл бұрын
When we say Shard1 or Shard2, do we mean the sql server hosted on the EC2 instance combinedly as a shard?
@KriszSch
@KriszSch 8 ай бұрын
Great explanation!
@mahendratonape27
@mahendratonape27 4 ай бұрын
Thanks a lot u clearing confusion of long period
@amananurag07
@amananurag07 7 ай бұрын
@arpit Thanks for such dense information in so short and simple video. However I have a query on a corner case - How can have replicas when one has multiple shards with partitioning? - In this case is replication locally on the shard or it can also be replicated on other shards for high availability across avalability zone or DR (like kafka architecture)?
@kaal_bhairav_24
@kaal_bhairav_24 8 ай бұрын
thanks a lot arpit for an awesome explanation as always
@zeyuli53
@zeyuli53 2 жыл бұрын
well explained, thank you
@timamet
@timamet 2 жыл бұрын
amazing explanations, thank you
@AndreeSawkar
@AndreeSawkar 2 ай бұрын
Great video as always! 👍 I’ve got a question: 🤨 I have these words 🤨. (behave today finger ski upon boy assault summer exhaust beauty stereo over). What should I do with this? 🤷‍♂️
@___vandanagupta___
@___vandanagupta___ Жыл бұрын
The knowledge of amount in this video is tremendous!!! Extremely helpful 👍👍👍 thankyou sir!!
@amogu_07
@amogu_07 8 ай бұрын
thank you so much , clearly understood!!
@aditijalaj5036
@aditijalaj5036 Жыл бұрын
this is an amazing video and your explainations are very clear
@vikasbhutra9400
@vikasbhutra9400 2 жыл бұрын
Thanks a lot Arpit for explaining in so simplistic way. One request can you please make video on Sharding strategies and also on how composite indexes stores in the disk.
@AsliEngineering
@AsliEngineering 2 жыл бұрын
Soon.
@hc90919
@hc90919 Жыл бұрын
@asli engineering - Bhai, any update on the sharding strategies. Also, one more request is examples of scenarios to explain shard key selection. How is the data replicated behind the scenes n stuff please ?
@GaganJain2508
@GaganJain2508 Жыл бұрын
Does it mean Sharding and replication are the same? 22:16
@VenkateshwaranP-u8b
@VenkateshwaranP-u8b 2 ай бұрын
Thanks for the explanation
@kamalbahadur007
@kamalbahadur007 Ай бұрын
This is really great video. Subscribed, and exploring other videos uploaded by you.
@kritibindra4232
@kritibindra4232 Жыл бұрын
Wow this was really really helpful! Thank you posting this.✨
@ranjithpals
@ranjithpals 2 жыл бұрын
Thanks!
@prashantkamble898
@prashantkamble898 Жыл бұрын
Greatly explained
@DurgaShiva7574
@DurgaShiva7574 2 ай бұрын
GOD of explanation !
@aneksingh4496
@aneksingh4496 Жыл бұрын
super video Arpit
@neerajdixit7102
@neerajdixit7102 Жыл бұрын
Awesome Arpit, Thanks truly admire your way of teaching
@mohitkumartoshniwal
@mohitkumartoshniwal 2 жыл бұрын
A very clear and detailed explanation. ♥️
@shyama5612
@shyama5612 Ай бұрын
Great explainer. - thanks!
@kalinduabeysinghe8917
@kalinduabeysinghe8917 Жыл бұрын
Such a clean explanation🙌
@dhaanaanjaay
@dhaanaanjaay Жыл бұрын
One question, at 21.00 the matrix shows what it looks like when we have both sharding and partioning, how that is different from having two databases on two different EC2 instance for two applications?
@AlexandraSkrzypinski
@AlexandraSkrzypinski 12 күн бұрын
Great content, as always! I need some advice: My OKX wallet holds some USDT, and I have the seed phrase. (alarm fetch churn bridge exercise tape speak race clerk couch crater letter). How can I transfer them to Binance?
@nimitkanani1691
@nimitkanani1691 2 жыл бұрын
Very beautifully and simply explained. The content of the video flowed so smoothly. Thank You @ArpitBhayani
@coderkashif
@coderkashif 3 ай бұрын
As usual amazing
@lazry1773
@lazry1773 Жыл бұрын
Dude this was amazing
@tawseefbhat977
@tawseefbhat977 Жыл бұрын
how do we know which partition or shard our data is located when we make query? any detailed explantion
@heykalyan
@heykalyan Жыл бұрын
Kudos to you❤
@ankitmaheshwari2341
@ankitmaheshwari2341 Жыл бұрын
Do we use sharding when we have better options available like Oracle RAC where database can be scaled horizontally
@TarunKumarSaraswat
@TarunKumarSaraswat 3 ай бұрын
Thanks, really detailed
@gigachad400
@gigachad400 Жыл бұрын
One of the biggest disadvantages of sharding over a SQL server is you lose the ACIDity so you have to be careful while you doing it with SQL databases
@ankitmaheshwari2341
@ankitmaheshwari2341 Жыл бұрын
I think that's not true
@anshujaiswal5622
@anshujaiswal5622 7 ай бұрын
Simple and to the point explanation .. Thanks Arpit, Liked & Subscribed :)
@sumeetsingh1729
@sumeetsingh1729 9 ай бұрын
how's it decided which shard is hit by request? Is there any router in front ensuring routing of requests?
@imperfecto7734
@imperfecto7734 Жыл бұрын
@arpit what's the benefit of partitioning the data but not sharding it. Can you give me a usecase please?
@AsliEngineering
@AsliEngineering Жыл бұрын
Partitioning allows your database to read/access/move the required subset of data easily and efficiently. 1. Imagine if you partition data by time and create one partition for every hour and someone queries how many events happened in the last 10 hours, you would just need to access last 10 partition to fulfil this query. Others are not even required to be read. 2. In a distributed setup, instead of moving individual rows/elements we can easily and efficiently move partitions across the cluster for balancing the load.
@imperfecto7734
@imperfecto7734 Жыл бұрын
Understood! Thanks 🙏
@CSKnowledge007
@CSKnowledge007 16 күн бұрын
What do you mean by "one node" at 12:48 ? Is it one EC2 instance?
@aditigupta6870
@aditigupta6870 10 ай бұрын
Hello arpit, at 5:49, why you mentioned that the new resources are being allocated to the EC2 machine? I think that should be allocated to the DB server running on EC2 machine right?
@AsliEngineering
@AsliEngineering 10 ай бұрын
I meant the server running the database. The database is eventually running on some VM.
@aditigupta6870
@aditigupta6870 10 ай бұрын
@@AsliEngineering thanks arpit
@aditiagarwal7081
@aditiagarwal7081 6 ай бұрын
When running two databases on the same machine, are we not still sharing the same underlying resources such as CPU, memory, and disk I/O?
@likith1337
@likith1337 6 ай бұрын
How can u run two sql daemon on the same machine?
@KrishnaSagar02
@KrishnaSagar02 4 ай бұрын
I have a doubt sir. I think increase in overall storage capacity and higher availability, doesn't got hand in hand. If we shard and partition data, then the capacity will be available but then the data is not same in both shards i.e., if one shard becomes offline then the other shard cannot provide data if the requested data is in the offline shard. So no higher availability. And if we only do sharding then the same data will be in both servers, and as u said if we assume 100tb, then the other will also have 100tb only? We cant get 200tb. This is what I thought. Correct me if im wrong.
@bharadwajsai179
@bharadwajsai179 3 ай бұрын
I too got the same doubt, I came to know that in this case, our system will be available but the data might be inconsistent, so still the server accepts requests and provides an empty response.
@aditigupta6870
@aditigupta6870 10 ай бұрын
One shard also must be having replicas right? I mean if a shard is handling the first 2 partitions, then all data from those first 2 partitions will go to this shard, but what if the shard is down?
@AsliEngineering
@AsliEngineering 10 ай бұрын
shared can have replicas to scale the reads. If the shard goes down, then either you auto promote replica to take over, or take the downtime.
@ronakshah725
@ronakshah725 4 ай бұрын
Hey great video Ankit! I was wondering how sorting and specially filtering would work across shards? Or is that an anti pattern ( just like cross shard joins )
@sachinjindal4921
@sachinjindal4921 2 жыл бұрын
Awesome, can you give some practical examples.
@AsliEngineering
@AsliEngineering 2 жыл бұрын
These are practical as they can get keeping it generic and not touching upon SRE side of things :) Every database comes it its own partitioning and sharding strategy and we need to go through their documentation to apply it. I talked about using a database proxy to bifurcate the request in one of the earlier videos, in case you are looking for that. Would recommend you picking a database and seeing how you can actually create shards and manage them. ElasticSearch can be a great start.
@jithinb7047
@jithinb7047 Жыл бұрын
Awesome content Arpit ! Thanks a lot and please do continue post more on concepts such as well as analysis of real use cases.
@joshir8500
@joshir8500 5 ай бұрын
What should be the strategy of partitioning a mysql database with multiple tables into multiple shards? There are some tables which does not contains shard key.
@AsliEngineering
@AsliEngineering 5 ай бұрын
1. Either it should contain the shard key 2. Or if it small enough then replicate the entire table across all the shards (eg. Config table, or meta table) 3. Or third bear the cost of cross shard fan outs.
@sumit13agarwal
@sumit13agarwal 15 күн бұрын
In case of replica of data on sharded server, we have same data dupicated on the physical disks of the data server. How is the consistency of data maintained across data base servers ?
@PoojaDurgi
@PoojaDurgi Жыл бұрын
Amazing !!
@Sharmasurajlive
@Sharmasurajlive Жыл бұрын
Simple and efficient explanation 👍🏻
@pranjalchoudhury1670
@pranjalchoudhury1670 10 ай бұрын
Nicely expalined. :)
@rahulpanjwani1887
@rahulpanjwani1887 2 жыл бұрын
Beautiful
@rahulpanjwani1887
@rahulpanjwani1887 2 жыл бұрын
It makes you understand the value of a unified data platform team when scale increases.
@mufeezahmedmohammad9441
@mufeezahmedmohammad9441 4 ай бұрын
This is amazing !
@ohmygosh6176
@ohmygosh6176 Жыл бұрын
Cross sharding quiries very very expensive. Its best to use tools to find out how the database is being used before making these decisions. I use PG Analizer tool for PostgreSQL
@kritibindra4232
@kritibindra4232 Жыл бұрын
Also which software did you use in this video to create pictures and write content?
@AsliEngineering
@AsliEngineering Жыл бұрын
GoodNotes
@InvincibleMan99
@InvincibleMan99 Ай бұрын
Looking for practical example for partionitiong
@santanuhalder9306
@santanuhalder9306 20 күн бұрын
What iPad note application are you using?
@sarthaknarayan2159
@sarthaknarayan2159 Жыл бұрын
Awesome!!!!
How do indexes make databases read faster?
23:25
Arpit Bhayani
Рет қаралды 73 М.
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 4,4 МЛН
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 2,4 МЛН
Why do databases store data in B+ trees?
29:43
Arpit Bhayani
Рет қаралды 43 М.
Systems Design in an Hour
1:11:00
Jordan has no life
Рет қаралды 25 М.
Arpit Bhayani talks about real engineering for 1 hour straight
1:16:23
Everything you need to know about REST
26:20
Arpit Bhayani
Рет қаралды 31 М.
2. What Makes Redis Special? | Redis Internals
22:04
Arpit Bhayani
Рет қаралды 48 М.
Choosing a Database for Systems Design: All you need to know in one video
23:58
Elasticsearch Deep Dive w/ a Ex-Meta Senior Manager
44:03
Hello Interview - SWE Interview Preparation
Рет қаралды 24 М.
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 4,4 МЛН