What is Database Sharding?

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ค. 2024
  • Database sharding is a technique used to optimize database performance at scale. It relies on separating data into logical chunks so that they can be separated and queried independently. Learn more about sharding in this video.
    Looking to get hands on experience building on AWS with a REAL project? Check out my course - The AWS Learning Accelerator! courses.beabetterdev.com/cour...
    📚 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 Driver 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
    📚 References:
    Great Sharding Article - aws.amazon.com/blogs/database...
    #Databases
    #Sharding
    #SoftwareEngineer

ความคิดเห็น • 210

  • @RandomShowerThoughts
    @RandomShowerThoughts ปีที่แล้ว +15

    honestly might be the most complete and thorough explanation of sharding.

    • @BeABetterDev
      @BeABetterDev  ปีที่แล้ว +1

      Thanks so much for your kind words!

  • @hamadaparis3556
    @hamadaparis3556 2 ปีที่แล้ว +72

    You've simplified your explanation like google engineers do when they give lectures, I'm sorry if that sounds strange but I've realized that the people who simplify complex things they really know what they are doing awesome man Cheers.

  • @Aidanhyland
    @Aidanhyland 3 ปีที่แล้ว +20

    I am burning through all your videos. You are making me a better SAAS Test Engineer! Keep up this great work!

  • @abhishekghosh5550
    @abhishekghosh5550 2 ปีที่แล้ว +9

    This is seriously such a great video man. I spent the entire Sunday understanding Sharding. Not that I didn't get started with the concept, however, this video just made everything clear at the end of the day. Thank You.

  • @poloska9471
    @poloska9471 2 ปีที่แล้ว +6

    Dude you make some really awesome content. Please please keep making videos! I love the clarity of your speech, voice, and presentation. I understand and can follow along in your videos a lot better than more other channels. Earned my subscription and likes! Keep killing it homie!

    • @BeABetterDev
      @BeABetterDev  2 ปีที่แล้ว +1

      Thank you so much for your kind words and welcome to the channel!

  • @v.m.5850
    @v.m.5850 ปีที่แล้ว

    Watched countless videos and barely understood the concept. Your video on the other hand explained everything along with pros and cons super simply. Thanks a ton.

  • @bharat_arora
    @bharat_arora 2 ปีที่แล้ว +3

    Finally found some decent content over this topic. I already had an idea on this topic just wanted to revise it. Thanks a lot for making the insightful videos.

  • @dannydatt
    @dannydatt 3 ปีที่แล้ว +3

    Network guy trying to get an understanding in a different field. That's an outstanding walk-through and very much appreciated. Thank you for your work and quality presentation.

  • @yfzhangphonn
    @yfzhangphonn ปีที่แล้ว +1

    Best lesson about database scalability I found, so easy to understand.

  • @cd92606
    @cd92606 3 ปีที่แล้ว +11

    Great video, especially your description about the non-uniformity problem.

    • @BeABetterDev
      @BeABetterDev  3 ปีที่แล้ว +1

      Thanks Rotary Dialer! Yea the non-uniformity issue is one I've been personally bitten by in the past. Glad you enjoyed the video!

  • @quang.luu.179
    @quang.luu.179 10 หลายเดือนก่อน

    Good stuff man. I love the clarity you bring to a subject. Subscribed.

  • @Bhaskarlnm
    @Bhaskarlnm 2 ปีที่แล้ว +2

    Daniel, no words.. looking at your playlists content and videos …amazing. Great great effort to help people. Kudos to you 👏👏👌👌👌

  • @wlcheng
    @wlcheng ปีที่แล้ว +1

    Great video! Such a clear explanation of how database sharding works.

  • @ase713
    @ase713 3 หลายเดือนก่อน +1

    Dude, this was outstanding! Super helpful and covered everything I needed to know!

  • @ihateorangecat
    @ihateorangecat ปีที่แล้ว

    Best of the best explantion I kinda start to understand the Sharding in just video.Thank You and I subbed!

  • @mathisinav4267
    @mathisinav4267 2 ปีที่แล้ว

    Hands down! the best explanation I've seen on database sharding, excellent!

    • @BeABetterDev
      @BeABetterDev  2 ปีที่แล้ว

      You're so welcome. Glad you enjoyed.

  • @Alexan6548
    @Alexan6548 ปีที่แล้ว

    Very clear. One of the best tutorial I have ever seen

  • @eternalnight9453
    @eternalnight9453 3 ปีที่แล้ว +2

    New here. Loved your talk! Your presentation and teaching is elegant and simple.
    Really appreciate it, thank you!

  • @saiaussie
    @saiaussie 3 หลายเดือนก่อน

    Hey dude, you're a star! Very clear and upto the point! I cant thank you enough.

  • @ChauDuong1982
    @ChauDuong1982 3 ปีที่แล้ว +3

    Thanks for the videos. Great explaination.

  • @patrick1778
    @patrick1778 2 ปีที่แล้ว

    you are so good at explaining concepts

  • @lucasarbex926
    @lucasarbex926 2 ปีที่แล้ว +2

    Great content man!! It helped me a lot!! Keep up with the good work!

  • @JamesQQuick
    @JamesQQuick 2 ปีที่แล้ว +1

    This was awesome. Thanks!

  • @rjjlucy
    @rjjlucy 3 ปีที่แล้ว +4

    In most ~20min videos, I get tired soon and close them after 5min. I can’t believe your video is so good that I totally forgot time and finish watching all of it

    • @BeABetterDev
      @BeABetterDev  3 ปีที่แล้ว +1

      Thank you so much Jingyi! Its these kinds of comments that keep me motivated to make more content :)
      Stay safe
      Daniel

  • @Lordnoashi
    @Lordnoashi ปีที่แล้ว +1

    Amazing explanation, loved it. Thank you, it will help for the future interviews I have.

  • @antonrozhansky7254
    @antonrozhansky7254 3 ปีที่แล้ว +2

    Great explanation, Daniel. Thank you

    • @BeABetterDev
      @BeABetterDev  3 ปีที่แล้ว

      You're very welcome Anton!

  • @codespace747
    @codespace747 3 หลายเดือนก่อน

    Best video ever made on sharding

  • @sharonleibel
    @sharonleibel 2 ปีที่แล้ว +1

    Great explanations! Thanks, Keep it coming!

  • @bahot9057
    @bahot9057 2 วันที่ผ่านมา

    Very well explained, great video!

  • @panggrayta
    @panggrayta 3 ปีที่แล้ว +1

    woww...!! great videos, great presentation, great explanation. thank you, keep sharing..

  • @willemplug3366
    @willemplug3366 ปีที่แล้ว

    Super clear. Thank you!

  • @IQUE928
    @IQUE928 15 วันที่ผ่านมา

    incredible explanation, thank you!

  • @user-zr4jl4ms3v
    @user-zr4jl4ms3v 2 ปีที่แล้ว +1

    best explanation of sharding i've heard!

  • @nodrift9503
    @nodrift9503 ปีที่แล้ว

    Perfect explanation. Thank you

  • @AnilKumar-lb3qf
    @AnilKumar-lb3qf 2 ปีที่แล้ว

    Excellent presentation, very good explanation 👍👍

  • @eugeniosp3
    @eugeniosp3 2 ปีที่แล้ว

    Bro I'll watch anything you make. If you made a video teaching me how to watch paint dry I'd take notes. Keep up the damn good work my mans.

  • @jackforcecity
    @jackforcecity 2 ปีที่แล้ว +1

    Great job. Very well explained!!!

    • @BeABetterDev
      @BeABetterDev  2 ปีที่แล้ว

      Thanks so much Jackson! Glad you enjoyed :)

  • @mivel9763
    @mivel9763 2 ปีที่แล้ว +1

    Had a hard time grasping on what database sharding actually meant but your video really helped me understand it, thanks! :)

  • @devdewboy
    @devdewboy ปีที่แล้ว

    Thanks for the straight forward easy to grasp concept of sharding. Give this to someone else and we would have gotten a bunch of technical wordy mumbo-jumbo.

  • @taniaasim
    @taniaasim 2 ปีที่แล้ว +1

    This is great and super clear. Thank you!

  • @harishbendale6818
    @harishbendale6818 ปีที่แล้ว

    Very clear, and simple explanation.

  • @arikedada
    @arikedada ปีที่แล้ว

    great video, I understand what idempotency operations entails, thank you

  • @santoshlml
    @santoshlml 3 ปีที่แล้ว +2

    Well explained. Thank you!!

    • @BeABetterDev
      @BeABetterDev  3 ปีที่แล้ว

      You're very welcome Santosh! Glad you enjoyed.

  • @filesopen6188
    @filesopen6188 2 ปีที่แล้ว +2

    this video entails very good explanation and this also entails complex understanding.

  • @shubhamchandra9258
    @shubhamchandra9258 2 ปีที่แล้ว +1

    Awesome video. Very clearly explained.

  • @RajuGupta-st1hj
    @RajuGupta-st1hj 2 ปีที่แล้ว +1

    Thank you so much for the post.
    Good work.
    Keep it up.

    • @BeABetterDev
      @BeABetterDev  2 ปีที่แล้ว

      You're very welcome Raju!

  • @tamaraamanda2483
    @tamaraamanda2483 2 ปีที่แล้ว

    Prepping for Amazon TPM interview and this is so helpful!

    • @BeABetterDev
      @BeABetterDev  2 ปีที่แล้ว

      Thanks Tamara and good luck on your interview! Make sure you focus on those leadership principles !

  • @OscarMartinez-nt6zn
    @OscarMartinez-nt6zn 3 หลายเดือนก่อน

    Great explanation!

  • @SofiaGoyal
    @SofiaGoyal 3 ปีที่แล้ว +1

    Really good work man... such a detailed video...

    • @BeABetterDev
      @BeABetterDev  3 ปีที่แล้ว

      Thanks Sofia! Glad you enjoyed :)

  • @dorbenmoyal7639
    @dorbenmoyal7639 2 ปีที่แล้ว +1

    Great explanation..! Thanks 🙏🏼

    • @BeABetterDev
      @BeABetterDev  2 ปีที่แล้ว +1

      You're very welcome Dor!

  • @rajt1998
    @rajt1998 2 ปีที่แล้ว +1

    Very well explained. Thank you

  • @samlinsell900
    @samlinsell900 2 ปีที่แล้ว +5

    Vids are awesome, really enjoy them. Interesting that you didn't touch on the lack of thought to database design, indexing and maintenance etc as a way to improve performance. Interested to know why? Especially given the cost of scaling in serverless environments.

  • @andrewkicha1628
    @andrewkicha1628 ปีที่แล้ว

    Great job on this one, I came here to know more about sharding, but I learned lots of useful information before you even dived into the topic ;)

  • @rschmidtzalles
    @rschmidtzalles 3 ปีที่แล้ว +1

    clear and concise. subscribed

    • @BeABetterDev
      @BeABetterDev  3 ปีที่แล้ว

      Thanks Libert and welcome!

  • @estebanquintana156
    @estebanquintana156 2 ปีที่แล้ว

    Great explanation. Thank you

  • @donaldkennedy7993
    @donaldkennedy7993 ปีที่แล้ว

    superb explanation of DB scaling & sharding & W/R databases for a non DB person ;)

  • @simonemariottini1011
    @simonemariottini1011 2 ปีที่แล้ว +1

    Really useful content! Keep it up!

    • @BeABetterDev
      @BeABetterDev  2 ปีที่แล้ว +1

      Thanks so much Simone!

  • @kishoretvk
    @kishoretvk 2 ปีที่แล้ว

    Great vidoe, keep up the good work

  • @drew4980
    @drew4980 3 ปีที่แล้ว +7

    Are there any database tools that make this easier? Couldn't someone write some software to create a wrapper around a sharded DBMS that could handle the routing and re-sharding with a given hashing key?

  • @user-ws5xs1nv4p
    @user-ws5xs1nv4p ปีที่แล้ว

    Thanks a lof for this video!

  • @JayPatel12928
    @JayPatel12928 2 ปีที่แล้ว +5

    Watched some of your random videos on sys design, and now im hooked. Great content!

    • @BeABetterDev
      @BeABetterDev  2 ปีที่แล้ว +2

      Thanks so much J! Glad you enjoyed!

    • @amrikmalhans
      @amrikmalhans 2 ปีที่แล้ว

      @@BeABetterDev yes

  • @francoisbourdages2906
    @francoisbourdages2906 ปีที่แล้ว

    très bien expliqué, merci

  • @hpandeymail
    @hpandeymail 2 ปีที่แล้ว +1

    Very well formed content .. thanks 🙏

  • @kgcpk
    @kgcpk 2 ปีที่แล้ว

    Superb explanation 😍

  • @duzgunkenan
    @duzgunkenan 2 หลายเดือนก่อน

    Great content, thank you

  • @rayprusia4753
    @rayprusia4753 3 ปีที่แล้ว +1

    Your videos are awesome! Thanks

  • @jeevaengg
    @jeevaengg ปีที่แล้ว

    good explanation!!

  • @chandnisaini9176
    @chandnisaini9176 2 ปีที่แล้ว +1

    Well explained!!

  • @hualiang2182
    @hualiang2182 2 ปีที่แล้ว

    Nice tutorial. Wonder in real word scenairo, is the routing layer something sits in the application code or it's implemented on the database side?

  • @sandrojorgeoliveira175
    @sandrojorgeoliveira175 11 หลายเดือนก่อน

    Thank you, Dude!!!

  • @milequinze
    @milequinze 2 ปีที่แล้ว +1

    Awesome! Thanks a lot!

  • @itiscinnamoncafe
    @itiscinnamoncafe 9 หลายเดือนก่อน

    Love longer videos ❤

  • @user-tu1kf6xd8d
    @user-tu1kf6xd8d 3 ปีที่แล้ว +1

    great explanation thank u so much

  • @trantrongty8065
    @trantrongty8065 2 ปีที่แล้ว +1

    Thank you that really helpful great video

    • @BeABetterDev
      @BeABetterDev  2 ปีที่แล้ว

      You're very welcome Tran!

  • @3042640426
    @3042640426 ปีที่แล้ว

    Thank you so much

  • @skmahaboobbasha6059
    @skmahaboobbasha6059 2 ปีที่แล้ว

    Great vedio please make vedio on opsmanager installation on production environment

  • @dhriajbhandari
    @dhriajbhandari 2 ปีที่แล้ว

    Great video. Thank you. I just have a question about routing for the determining the shards. Is it always necessary? I was thinking that you could just do modulus on the id to get the shard number instead (eg: customer_id: 12, num_of_shards = 4 so the shard would be 12 % 4 = 0). That way you don't have a single point of failure on the router. What are the downsides to this approach vs router end-point ?

    • @BeABetterDev
      @BeABetterDev  2 ปีที่แล้ว +2

      Hi there this is a great point thanks for sharing. The problem with using modulus is that it can get difficult to change the assignment of data to shard if you need to re-shuffle your data. With a single table acting as the authority, this can be done trivially.

  • @random-characters4162
    @random-characters4162 ปีที่แล้ว

    God bless you, sir ✌️

  • @alexeykorovko6704
    @alexeykorovko6704 ปีที่แล้ว

    very good explanation, thank you
    one point is not clear - do we really have advantage of availability / fault tolerance, in case we have an intermediate layer that routes the requests? for me it is like the same, isn't it?

  • @drummerboi4eva
    @drummerboi4eva ปีที่แล้ว

    excellent video

  • @swaroopas5207
    @swaroopas5207 2 ปีที่แล้ว

    Great video! But how do we handle foreign keys in sharding?

  • @peterroger249
    @peterroger249 ปีที่แล้ว

    Much thank you for your great TH-cam help. I am new to Excel and Chatbot. How can I migrate the Excel database, export it from Microsoft Azure WebApp, and import it into AWS Chabot? Keep having errors missing QID and others on the AWS Chabot console. Please help show me the fastest way to convert the Excel and make it compatible with AWS Chatbot?

  • @gulsimsek7988
    @gulsimsek7988 3 ปีที่แล้ว

    thank you!

  • @shivakumarranjithn5584
    @shivakumarranjithn5584 3 ปีที่แล้ว +1

    Great content!

    • @BeABetterDev
      @BeABetterDev  3 ปีที่แล้ว

      Thanks so much Shivakumar!

  • @SuperWhatusername
    @SuperWhatusername 10 วันที่ผ่านมา

    Great content

  • @HeavensMeat
    @HeavensMeat 3 ปีที่แล้ว +1

    I know you have had other dynamodb videos here but would it be possible to have a more in depth video dealing with sharding in dynamodb and also utilizing this with python/boto3 vs the cli? I know it's not really the same type of sharding per se but this video reminded me that I am interested in seeing that kind of thing

    • @BeABetterDev
      @BeABetterDev  3 ปีที่แล้ว

      Hey HeavensMeat! You're suggestion is a great idea for a new video idea, thanks you! I'll work on incorporating this into my todo list. Cheers!

  • @ashishsharma9008
    @ashishsharma9008 2 ปีที่แล้ว

    Which is better architecture, microservice or using single database n use sharding later when it scales?

  • @vikasravindran1312
    @vikasravindran1312 2 ปีที่แล้ว

    Excellent !

    • @BeABetterDev
      @BeABetterDev  2 ปีที่แล้ว

      Thank you so much Vikas!

  • @markryan430
    @markryan430 ปีที่แล้ว +1

    OMG, I just Sharded myself!

  • @subhasishhalder4817
    @subhasishhalder4817 2 ปีที่แล้ว +2

    How come I didn't find your channel before?

  • @fethicetin9186
    @fethicetin9186 3 ปีที่แล้ว

    Thanks for the video

    • @BeABetterDev
      @BeABetterDev  3 ปีที่แล้ว

      You're very welcome Fethi!

  • @rishiraj2548
    @rishiraj2548 ปีที่แล้ว

    Thanks

  • @loaizar95
    @loaizar95 ปีที่แล้ว

    amazing video!! Understood almost everything and am not a it guy.. the only thing I did not get is the difference between partition mapping and routing :(

  •  10 หลายเดือนก่อน

    @BeABetterDev What if I were to opt for synchronous replication for my read replicas? Wouldn't that provide me with a high level of consistency (strong consistency) between the master node and the replica nodes? Besides, AWS RDS provides async replication for read replicas, does that mean it is eventual consistent? If so, if I am building an application that needs to opt in strong consistency, shouldn't I use AWS RDS read replicas then? What would be an alternative option to that?

  • @thunderriffs2964
    @thunderriffs2964 ปีที่แล้ว +1

    Great vid! I have a question. In massive distributed systems (more read intensive than writes) where hits to your database are really expensive and they are using some form of a caching layer which stores the most frequently accessed data - does the problem of routing go away? Because in this case any writes to the database would mean that you’re invalidating the cache, and reads are done from the caching layer, so even though you may have horizontally partitioned dbs below, they don’t really have to worry about how to route the incoming request for data? I hope my query makes sense.

    • @pratikvyas3384
      @pratikvyas3384 ปีที่แล้ว

      Same question dude

    • @bmfitzgerald3
      @bmfitzgerald3 ปีที่แล้ว

      Even if you have a caching layer serving most of your reads, your cache never stores everything in your DB. For this reason you will still need to solve for reading from the db whenever you have "cache misses," which means the need to retrieve the data from the correct shard still exists (and will require mapping/routing).

  • @geekaffairs6475
    @geekaffairs6475 2 ปีที่แล้ว +1

    very well explained

  • @r-rtz
    @r-rtz 10 หลายเดือนก่อน

    A more interesting concept though is how you generate these unique id's that are used in the sharding / partitioning and ensure uniqueness

  • @Tiparium_NMF
    @Tiparium_NMF 18 วันที่ผ่านมา

    I love this breakdown, but it does somewhat leave me wondering when Sharding would be a good vs a bad idea. The cons seem pretty hefting in comparison to the pros.
    It would have been nice to run through a few specific different use cases and when one strategy would be better than another.

  • @poketopa1234
    @poketopa1234 หลายเดือนก่อน

    What I always miss in these videos is, doesn’t introducing a routing layer just kick the can down the road? Now you have all traffic going to a singular routing node, which is not scalable and can fail. What happens when you need to scale the routing node?

  • @yna8588
    @yna8588 ปีที่แล้ว

    Can we scale up and scale down the storage of database as per daily requirement using sharding?