The Basics of Database Sharding and Partitioning in System Design

Sdílet
Vložit
  • čas přidán 11. 06. 2024
  • Make sure you're interview-ready with Exponent's system design interview prep course: bit.ly/3YTjsjH
    Learn the basics of database sharding and partitioning in system design with this video! Database sharding and partitioning are both about breaking up a large data set into smaller subsets. Sharding implies that the data is spread across multiple databases, while partitioning usually implies dividing a table into multiple pieces based on some separation criteria. We'll explain the differences between these two concepts and when to use each one.
    Chapters -
    00:00 - Intro
    01:18 - Sharding techniques
    02:43 - Manual vs Automatic sharding
    04:27 - Advantages of sharding
    05:13 - Disadvantages of sharding
    Watch more system design videos here:
    - Meta engineering manager answers a rate limiter interview question: • System Design Mock Int...
    - Google SWE answers an algorithms interview question: • Google Software Engine...
    - Google TPM answers Tiktok system design interview question: • System Design Mock Int...
    - Flipkart EM “Design Amazon Prime Video” system design interview question: • System Design Intervie...
    👉 Subscribe to our channel: bit.ly/exponentyt
    🕊️ Follow us on Twitter: bit.ly/exptweet
    💙 Like us on Facebook for special discounts: bit.ly/exponentfb
    📷 Check us out on Instagram: bit.ly/exponentig
    📹 Watch us on TikTok: bit.ly/exponenttikttok
    ABOUT US:
    Did you enjoy this interview question and answer? Want to land your dream career? Exponent is an online community, course, and coaching platform to help you ace your upcoming interview. Exponent has helped people land their dream careers at companies like Google, Microsoft, Amazon, and high-growth startups. Exponent is currently licensed by Stanford, Yale, UW, and others.
    Our courses include interview lessons, questions, and complete answers with video walkthroughs. Access hours of real interview videos, where we analyze what went right or wrong, and our 1000+ community of expert coaches and industry professionals, to help you get your dream job and more!

Komentáře • 37

  • @tryexponent
    @tryexponent  Před 5 měsíci

    Make sure you're interview-ready with Exponent's system design interview prep course: bit.ly/3YTjsjH

  • @jay_wright_thats_right
    @jay_wright_thats_right Před 5 měsíci +12

    Animations to visualize what she is saying would make this video perfect!

  • @chellamgmoorthy
    @chellamgmoorthy Před rokem +13

    I didn't knew what a database sharding was. This video gave me good amount of topics for me to research and learn. Thanks for the video!

  • @ayushgogna9732
    @ayushgogna9732 Před 4 měsíci

    you guys are amazing i recently found your channel i am learning a lot and i am loving it

  • @primalplasma
    @primalplasma Před 7 měsíci +1

    This was exactly the information that I needed. Thank you!

  • @octavian0704
    @octavian0704 Před 10 měsíci +3

    very well described, thanks for sharing.

  • @cristinasanchez9029
    @cristinasanchez9029 Před 7 měsíci

    Greatly explained, I subbed

  • @MuhammadAsif-nx7om
    @MuhammadAsif-nx7om Před rokem +10

    Great and to the point explanation, No bluff
    Thanks

  • @user-fg2iw4yi7q
    @user-fg2iw4yi7q Před 3 měsíci

    Great video!

  • @user-kn2bs5mu7b
    @user-kn2bs5mu7b Před 3 měsíci +1

    Some people are very beautiful with a helping hand , thanku❤

  • @josephkabemba3211
    @josephkabemba3211 Před rokem +2

    Crystal clear

  • @vladyslavsosnov8412
    @vladyslavsosnov8412 Před 11 měsíci

    Awesome, thanks

  • @devkiosk
    @devkiosk Před rokem +3

    Awesome explanation.

  • @Deepz007
    @Deepz007 Před 8 měsíci +2

    Great video on sharing, but partitioning wasn't mentioned or discussed.

  • @oefzdegoeggl
    @oefzdegoeggl Před 7 měsíci +2

    a few things to add. i prefer partitioning based on a guaranteed key in the sense it will not distribute badly ... so the "first letter of name" is a bad idea. better use the record id and group 100k of them or what into a partition. then before storing partitions on different servers, there are a few more things to do first. one is to split modifying queries from read-only queries (which has to be done on the application level) so a simple read-replica-server (which is trivially to be setup in postgres) can be used. next what is possible is a db split on the logical level. i mean for example keep the user's core data on db1 and chat messages on db2. leaving out foreign keys and using weak references instead, with a periodic cleanup job that resolves broken links is a good idea, eliminating issues on backup restore when cut in a bad moment as well.

    • @goofballbiscuits3647
      @goofballbiscuits3647 Před 2 měsíci

      Coming from a decade+ of data work with health records, I have to bump this comment. Name, location and birthdate combined still aren't unique. Messing up data with potential tromps like this is straight up lethal in some fields.
      Remember, friends: bad data is worse than no data.

  • @robbybankston4238
    @robbybankston4238 Před 4 měsíci

    I would think that another potential disadvantage would be if you are using commercial rather than OpenSource operating systems or databases where the licensing costs increase as the number of servers increase also.

  • @pieter5466
    @pieter5466 Před 6 měsíci +1

    Good video but confusing use of the term 'partition', which is different than 'shard'.

  • @mandydawson6199
    @mandydawson6199 Před rokem +7

    Who is she and how do we get more videos with her?

  • @caitlinmclaren2695
    @caitlinmclaren2695 Před 9 měsíci

    Monolithic Databases??

  • @marcello4258
    @marcello4258 Před 11 měsíci +1

    It sounds you messed up partitioning with sharding.
    And commodity hardware does not have ECC - don’t run a db on it.

    • @mick7827
      @mick7827 Před 8 měsíci

      Each partition is stored within the same database server SO it's easier because sharding require multiple database servers ?

  • @edmoregosha8937
    @edmoregosha8937 Před 2 měsíci +1

    The video script explains the basics of database sharding and partitioning in system design. It discusses how sharding can help manage large amounts of data by breaking it up into smaller partitions spread across multiple servers. The script also highlights the advantages and disadvantages of sharding in terms of scalability, performance, and operational complexity.
    Key moments:
    00:32 Traditional databases encounter limitations with increasing data size, necessitating sharding to enhance scalability and performance.
    -Geobase sharding partitions data based on user locations, reducing latency by routing users to the closest node.
    -Range-based sharding divides data by key value ranges, simplifying partition computation but potentially leading to uneven splits.
    -Hash-based sharding uses hashing algorithms to evenly distribute data across partitions, reducing hotspots but potentially separating related rows.
    -Automatic sharding dynamically manages data partitioning for higher performance and scalability, but manual sharding at the application layer increases development complexity.
    03:55 Sharding enables scaling, faster queries, and system availability, but poses challenges like complex management, hot spots, and high operational costs.
    -Advantages of sharding include scalability, faster queries, and improved system availability during outages.
    -Disadvantages of sharding involve complex data relationships, potential hot spots, and operational costs for maintaining high availability.
    Generated by sider.ai

  • @rmuneeb1
    @rmuneeb1 Před měsícem

    Untill her hands moved I thought she was an AI robot 😂

  • @sriranjitharaghuraman1646
    @sriranjitharaghuraman1646 Před 4 měsíci

    Some visualization would have gone a long way

  • @goofballbiscuits3647
    @goofballbiscuits3647 Před 2 měsíci +1

    Sorry, everyone...
    I parted *_and_* sharded 😢

  • @lakshminarayanacharan837
    @lakshminarayanacharan837 Před měsícem

    You are looking so cute 🥰

  • @sk-vs9nt
    @sk-vs9nt Před 10 dny

    am in love with this lady what her id

  • @AvinashRaj
    @AvinashRaj Před rokem +42

    Well thanks for reading the script.

    • @vivekkaushik9508
      @vivekkaushik9508 Před 3 měsíci

      😂😂😂

    • @codermccoderson
      @codermccoderson Před 2 měsíci +3

      A lot of these YT educators write down the material before speaking to the camera. What’s your point?

  • @user-qq3gh5pg9f
    @user-qq3gh5pg9f Před 3 měsíci

    you got the definition of Sharding wrong. understood you never did sharding in your life.

  • @satvikkhare1844
    @satvikkhare1844 Před rokem +8

    reading for a teleprompter is not teaching!! sure it gave me topics that I can refer myself

    • @codermccoderson
      @codermccoderson Před 2 měsíci

      A lot of youtube educators have their material scripted before speaking to the camera? What’s your point?