CAP Theorem | Trade offs to choose a Database | System Design Primer | Tech Primers

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024

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

  • @TechPrimers
    @TechPrimers  4 ปีที่แล้ว +7

    ⏱️ Chapter Timestamps
    ====================
    0:00 - Intro
    1:06 - Agenda
    1:38 - What is CAP Theorem?
    2:27 - Partition Tolerance
    3:47 - Consistency
    4:14 - CAP Availability
    5:55 - Consistency & Availability
    9:04 - Consistency & Partition Tolerance
    12:15 - Availability & Partition Tolerance
    14:35 - Beyond CAP Theorem

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

      One confusion, When I want to achieve CA , then why there is a partition , i read and write from the master, thus i achieve CA, but we are also achieving the Partition tolerance with it, isn't it ? coz even after partition, our system is able to still serve.

  • @RipunjayTripathi-CNT
    @RipunjayTripathi-CNT 3 ปีที่แล้ว +44

    There is slight ambiguity in explaining Partition and Partition Tolerance - Partition Tolerance is the 'ability' of the system to be able to serve writes OR queries even when there is network partition (i.e. when messages get dropped or arbitrarily delayed). If the system is partition-tolerant, it may not remain consistent for that period, however the tolerance property causes it to sync the newer writes when network becomes healthy again.

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

      Yes!! A CP database is always consistent even in partition scenarios (connection loss between nodes), but you lose availability during this partition. A AP database is always available even in partition scenarios, but you lose consistency during the partition. Finally, a CA database is available and consistent only if no partition occurs. If some network problem occurs between nodes, the database might lose either its consistency or availability. So it isn't partition tolerant.

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

      Then what about a CP system? will the data store remain unavailable altogether in case of a network partition (network break or loss of connection within the data store)?

    • @AmandeepSingh-mo4eo
      @AmandeepSingh-mo4eo ปีที่แล้ว

      Yes correct

  • @saikarthik8953
    @saikarthik8953 4 ปีที่แล้ว +17

    Telling us the agenda before entire video..hatsoff for that..you are true tech enthusiast rather than a youtuber

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

      Thank you Sai. Yes. Time is money. I would like to give back ppl their time if they are not interested. Appreciate your time 👍🏻

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

    so glad I watched this video in my lifetime

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

    excellent explanation

  • @KhoaNguyen-mv2mu
    @KhoaNguyen-mv2mu 4 ปีที่แล้ว +4

    Thank you so much @Tech Primers, your channel is resourceful. I've learnt a lot about Spring and Java. I really appreciate your works!

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

    Amazingly explained

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

    thanks for such a comprehensive video on cap theorem.

  • @puneet739
    @puneet739 4 ปีที่แล้ว +5

    Good work buddy. u help us in day today activities and understanding the technical aspects

    • @TechPrimers
      @TechPrimers  4 ปีที่แล้ว

      Glad its helpful puneet.

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

      @@TechPrimers
      One confusion, When I want to achieve CA , then why there is a partition , i read and write from the master, thus i achieve CA, but we are also achieving the Partition tolerance with it, isn't it ? coz even after partition, our system is able to still serve.

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

    a very decent explanation of CAP theorem

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

    Excellent

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

    Excellent video..keep posting such videos. Thank you

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

    The explanation for the Relational DBs supporting CA is bit confusing. The reason why Relational DBs are Consistent is because the Primary node is the one which clients read and writes to. So every time any client reads the response will be consistent. Availability in Relational DBs is from replicating data from the primary to backup nodes, so in case the primary node goes down, the secondary node is available to respond to requests. However, it isn't partition tolerant because if the network breaks between the primary and secondary it wouldn't be able to replicate data.

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

    Very nicely explained ... Please post some videos like Facebook news feed design

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

    Again new and good stuff helpfull. Thanks bro

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

    Very good!!! Please continue with this series!!

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

    Thanks for sharing your knowledge

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

    ur great bro keep it up

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

    Thanks

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

    awesome ...

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

    easy explanation , thanks!

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

    amazing video!

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

    Solid information Ajay. Thanks for this!

    • @TechPrimers
      @TechPrimers  4 ปีที่แล้ว

      Thanks shaswant. Glad it’s helpful

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

    Wow! Thank you for giving such detailed explanation. I guess I don't need any other video for explanation of CAP Theorem 😀

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

      @Janvi
      One confusion, When I want to achieve CA , then why there is a partition , i read and write from the master, thus i achieve CA, but we are also achieving the Partition tolerance with it, isn't it ? coz even after partition, our system is able to still serve.

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

    Very nice video to understand the CAP theory.

  • @user-mc1oe4ms6b
    @user-mc1oe4ms6b 7 หลายเดือนก่อน

    The CA part is very misleading. If we choose consistency and availability over partition tolerance, then there must NOT have any network partitions happening.

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

    Best explanation of CAP theorem i have come across

  • @车少
    @车少 2 ปีที่แล้ว

    You didn't talk about when P happend, the followers will elect a new leader and there are two leaders in the different subset of network provide read and write.

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

    thanks for such an amazing breakdown

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

      Glad you liked it!

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

      @@TechPrimers
      One confusion, When I want to achieve CA , then why there is a partition , i read and write from the master, thus i achieve CA, but we are also achieving the Partition tolerance with it, isn't it ? coz even after partition, our system is able to still serve.

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

    Next level explanation!

  • @kunalsharma-zc2ho
    @kunalsharma-zc2ho 4 ปีที่แล้ว +2

    Sir, please continue system design challenges.

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

    Thanks for such a nice videos.. pls do more videos on system design and microservice design pattern... only understanding is sufficient no coding required

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

    Great work man, Thanks :)

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

    Thanksss

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

    Please make practical video on 2 Database synchronisation like if we have POS System 1 db for particular system it'll sync with main server.

  • @ChandraShekhar-by3cd
    @ChandraShekhar-by3cd 3 ปีที่แล้ว

    Nice Explanation pls upload more video on system desing.

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

    while explaining SQL database why you don't use same cluster example used for the other DB's.

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

    Good one

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

    Excellent video :-) You made it damn easy!!! Can you make something on a typical centralized application logging framework?

    • @TechPrimers
      @TechPrimers  4 ปีที่แล้ว

      There is a splunk video robin. You can take a look at that

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

    what do you mean by mysql through the same function? Can you please clarify this ? at 0:18

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

    Very Helpful, thx!

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

    Just Awesome

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

    You are doing a good job :)

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

    Nice one I love the slides, hope you must have used Google slides..!!

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

    One confusion, When I want to achieve CA , then why there is a partition , i read and write from the master, thus i achieve CA, but we are also achieving the Partition tolerance with it, isn't it ? coz even after partition, our system is able to still serve.

  • @codegeek8256
    @codegeek8256 4 ปีที่แล้ว

    Can you please share how you make your youtube videos please, the process, editing, and the graphix and transitions etc. please

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

    Nice video

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

    Thank you, this video is usefull)

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

    Is it safe to assume that all DBs in production are currently distributed? Because CAP applies only to distributed DB situation right?

  • @arunkrish8399
    @arunkrish8399 4 ปีที่แล้ว

    Guru can you make a tutorial on Kafka connector, streaming data from one database to another.

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

    Mass bro

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

    Thank you :-)

  • @vamsikrishna-iv4oj
    @vamsikrishna-iv4oj 4 ปีที่แล้ว +1

    May I know.. Why to sacrifice one of the feature among three? Why can't possible to cover with 3 features in any dB? Can you explain..

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

      You see the video it’s already explained. If there is partition tolerance, you either get consistency or availability. Since data is isolated and there is now way to sync new data. This is similar to how you get disconnected from internet and not able to view any new updates

    • @techiethoughts5729
      @techiethoughts5729 4 ปีที่แล้ว

      @@TechPrimers I understood that we are loosing either Availability or Consistency when there’s a partition tolerance, but what are we sacrificing in case of relational databases (Which are always available and consistent) as per CAP theorem. Can you please elaborate?

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

    You made it too easy to understand.

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

    Good to see we are getting away with the Master Slave terminology and using Primary Secondary instead.

    • @TechPrimers
      @TechPrimers  4 ปีที่แล้ว

      Yes in deed... #DiversityAndInclusion

  • @jeyaprakash5519
    @jeyaprakash5519 4 ปีที่แล้ว

    If possible share your thoughts on modelling time Series(ex: Call Details of user) data using Cassandra / any Nosql DB.

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

      I did a video on Prometheus i believe. Try checking that, if that doesn't help let me know, i will do one

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

    Google cloud firestore following CP however they can provide more availablity because they are using their own private network. Is it right?

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

      General availability is different from CAP Availability Namjith. If there is a partition (failure between nodes in the firestore cluster), you have to choose between consistency or availability, you cannot get both. However beyond CAP theorem you can include Latency as one more parameter, you can choose Latency over Consistency

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

    CAP theorem as per it's original defn, only speaks about distributed db. Here Availability is not "some data" but should be "all data". Some parts were wrongly explained. Please read up google wiki page.

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

      Hi Gyana Sagu,
      Not sure if you have read CAP Availability. I had mentioned availability mentioned here is different from CAP Availability. If you look at the CAP theorem wiki it says
      "Availability: Every request receives a (non-error) response, without the guarantee that it contains the most recent write"
      To my understanding, if the most recent write is not synced, that's not all data. Can you justify your comment?