Тёмный

2. CAP Theorem | High Level Design for Beginners | CAP Partition Tolerance explained 

Concept && Coding - by Shrayansh
Подписаться 101 тыс.
Просмотров 36 тыс.
50% 1

I have explained what is CAP theorem and what all possible combination we can use and when to use which property.
➡️ Join this channel to get access to member only perks:
/ @conceptandcoding

Опубликовано:

 

22 июн 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 103   
@gaming_with_ajey
@gaming_with_ajey Год назад
Partition Tolerance is : System is up and running Even If there is some network partition among nodes. that means, system is able to tolerate partition. Hence partition Tolerant.
@abhishekvithal8060
@abhishekvithal8060 Год назад
@Concept && Coding Is this correct ??
@ConceptandCoding
@ConceptandCoding Год назад
Correct
@heroChaddi
@heroChaddi 7 месяцев назад
Bro CA m agar tumne poore system ko hi down kar diya toh phir yeh system ko CA kyu bol rhe, yaar availability bhi toh band kardi system down krke??!!
@abhishek-94
@abhishek-94 3 месяца назад
Hi, in the 3rd example when the system itself is down(so it is not partition tolerant), we only have consistency but we don't have availability either(so it is not CA)
@SaritBurman
@SaritBurman Месяц назад
Same thought here
@kirtisingh2955
@kirtisingh2955 19 дней назад
Legit I just switching between your playlist from java to spring to SD. Great effort!!
@geekydanish5990
@geekydanish5990 Год назад
Thanks awsome explaination keep posting more !!!
@vamsikrishna_16
@vamsikrishna_16 5 месяцев назад
Great Explaination
@dhruvpurwar6642
@dhruvpurwar6642 Год назад
Great one!!
@RG-ed3lv
@RG-ed3lv Год назад
thanks !! waiting for more and more uploads in this playlist!
@ishitaamod5109
@ishitaamod5109 9 месяцев назад
very nicely explained!
@nitink8148
@nitink8148 Год назад
You have explained it in a far better manner than many utubers!
@ConceptandCoding
@ConceptandCoding Год назад
thank you
@subhamacharya4472
@subhamacharya4472 Год назад
Thanks for this explanation 🙂
@buntykumar7270
@buntykumar7270 Месяц назад
Good explaination
@programmershub3887
@programmershub3887 Год назад
best explaination
@prateekjain8374
@prateekjain8374 Год назад
sir u have explained it so well.. that even if somebody ask me about CAP... I can now clear his/her concept on CAP
@ConceptandCoding
@ConceptandCoding Год назад
thank you
@anshu-littlebitofeverythin21
You explained the concept very well. Keep doing it. Thanks for sharing knowledge
@ConceptandCoding
@ConceptandCoding Год назад
thank you
@nileshkumarvishwakarma
@nileshkumarvishwakarma Год назад
time kab jata hai pta hi nhi chlta, you got teaching skills man hatsoff!!
@ConceptandCoding
@ConceptandCoding Год назад
Thank you very much for the feedback
@chauhansingh7797
@chauhansingh7797 Год назад
really great
@ConceptandCoding
@ConceptandCoding Год назад
thank you
@TarunJain-is1im
@TarunJain-is1im Год назад
Best explanation found ever. Thanks!
@ConceptandCoding
@ConceptandCoding Год назад
Glad it was helpful!
@ramijsardar6678
@ramijsardar6678 10 месяцев назад
Great Explanation,
@ConceptandCoding
@ConceptandCoding 10 месяцев назад
Thank you
@kushagrabajpai7944
@kushagrabajpai7944 6 дней назад
So if System is down will it be considered under CA and vice versa?? btw thanks a lot for this great lecture!!
@swapnilsaxena81
@swapnilsaxena81 Год назад
Sir, you have explained this so well !!
@ConceptandCoding
@ConceptandCoding Год назад
Thank
@jeetendragarg7718
@jeetendragarg7718 2 месяца назад
Very well explained
@ConceptandCoding
@ConceptandCoding 2 месяца назад
thanks
@kishorkshirsagar1163
@kishorkshirsagar1163 Месяц назад
at 15:04 ( You said if there is a partition ) you should have said if there is breakdown
@pritammohapatra876
@pritammohapatra876 8 месяцев назад
Why are you not using CQRS pattern with messages brokers?
@SapnaKumari-bm7mn
@SapnaKumari-bm7mn Год назад
please share the rough worksheet it is very helpfull.
@LearnGrow-wd1en
@LearnGrow-wd1en 11 месяцев назад
Well Explained , this concept is a bit hard to understand . With your examples it was super easy to digest. Thanks
@ConceptandCoding
@ConceptandCoding 11 месяцев назад
Thanks
@kalravsharma178
@kalravsharma178 Год назад
Best explanation!!
@ConceptandCoding
@ConceptandCoding Год назад
Thank you
@skillupshivam
@skillupshivam Год назад
preparing for interview, this is very very helpfull for me, thank you so much for creating this playlist and video.
@ConceptandCoding
@ConceptandCoding Год назад
Thanks
@tarunkundhiya5196
@tarunkundhiya5196 11 месяцев назад
Great explanation!! The key point that other videos don't tell: Partition Tolerant: Whether the system is able to take requests in case of some network failure in the system. The second thing Availability can be confused with the above definition "If the system is not taking requests how we are achieving availability?' This thing is confusing (individual DB nodes are available but the system itself is not) the A in CAP theorem is talking about whose availability of DB nodes or the system itself. This is confusing. What do you think about this ? how to clear up this concept?
@vigupta-uq1pn
@vigupta-uq1pn 9 месяцев назад
same doubt :\
@ayushshshsh
@ayushshshsh Месяц назад
same doubt
@AbheyBhatia
@AbheyBhatia 2 месяца назад
Please explain with examples stating which DBs are supported in each case and why? Thanks
@ConceptandCoding
@ConceptandCoding Месяц назад
sure
@sarthakbhatia7639
@sarthakbhatia7639 10 месяцев назад
Understood
@rambeersharma2091
@rambeersharma2091 Год назад
Very nice but please explain the partition in details
@arimardanyadav4500
@arimardanyadav4500 11 дней назад
### **Introduction:** - Discusses the concept of CAP Theorem (Consistency, Availability, Partition Tolerance) and its relevance in distributed systems. - Emphasizes the importance of considering CAP constraints early in system design to avoid costly changes later. ### **CAP Theorem:** - **CAP:** Stands for Consistency, Availability, Partition Tolerance. - **Desired Properties of Distributed Systems:** These three properties are desirable in a distributed system. - **CAP Trade-off:** You cannot have all three properties simultaneously. You must choose two out of the three. - **Example:** - Consider a distributed database with nodes in India and the US. - A user's data is replicated across both locations. - A distributed system should ideally be consistent (same data everywhere), available (responding to requests), and tolerant to partitions (network disruptions). ### **Understanding Each Property:** - **Consistency:** Ensures that all nodes have the same, up-to-date data at any given time. - **Availability:** Guarantees that every request is successfully processed by at least one node. - **Partition Tolerance:** Allows the system to continue functioning even if communication between nodes is disrupted. ### **Why CAP Properties Cannot Co-Exist:** - **Case 1: CA (Consistency and Availability) - Not possible with Partition Tolerance** - **Scenario:** A partition occurs, separating nodes A and B. - **Conflict:** Node A writes updated data, but node B cannot access it due to the partition. - **Result:** Inconsistency between nodes. - **Case 2: CP (Consistency and Partition Tolerance) - Not possible with Availability** - **Scenario:** A partition occurs, separating nodes A and B. - **Strategy:** To maintain consistency, only one node (A) is allowed to process writes. - **Result:** Node B becomes unavailable for writes during the partition. - **Case 3: AP (Availability and Partition Tolerance) - Not possible with Consistency** - **Scenario:** A partition occurs, separating nodes A and B. - **Strategy:** To maintain availability, both nodes can process writes. - **Result:** Potential for inconsistent data between nodes. ### **CAP Trade-off in Real-world Systems:** - **Importance of Partition Tolerance:** In today's distributed systems, network disruptions are common. - **Choosing between CP and AP:** - **CP:** Choose this option for systems where consistency is critical, even if it means some temporary downtime. - **AP:** Choose this option for systems where availability is paramount, even if it means some data inconsistency. ### **Key Takeaways:** - **Understanding CAP is crucial for effective distributed system design.** - **Early consideration of CAP constraints can prevent costly changes later.** - **The choice between CP and AP depends on the specific needs of your system.** - **Partition tolerance is a key factor in modern distributed systems.**
@harishaseri
@harishaseri Год назад
Hi , I have quick doubt. When we want to achieve CA so we cant have partition tolerance . so you said that we have to take down the whole system(may be i have misunderstood this) . so in that case we have loss Availability right . so now system is not CA itself . please correct me if i am wrong
@ConceptandCoding
@ConceptandCoding Год назад
Let me try to explain: When we choose "CA" , what we assume that Partition can not even happen in the system. And if partition can not happen, then only thing left is CA. But if Partition happened, means our assumption is false, then we can not choose CA, then we have to choose CP or AP. So CA, can exist in a non distributed world (with a single DB) where never partion can happen.
@sushil1922
@sushil1922 11 месяцев назад
@@ConceptandCoding understood
@gurupreetsingh8347
@gurupreetsingh8347 7 месяцев назад
Hey at the length of 16:35, u explain how we can achieve CA without P by down the whole system whenever P occurs just to maintain the C but in this case System is also not available that means we couldn't not achieve A too and at the end we only got achieved C , right ? in the use case of CA system should available to o right ? can you explain it ? , I don't understand how we achieved A here even though our system is down
@rahulbhatt8583
@rahulbhatt8583 7 месяцев назад
For a application to be distributed, it has to support Partition Tolerance, either compromising consistency or availability. A distributed system having CA property is hypothetical and it cannot exist in real world examples. What he means is we can achieve CA without P, by having only one server(then no distributed application). CP - Banking system need consistency so they block all the write operation if any of the node fails, thus system is unavailable, (to provide C and P) AP - Application compromises on Consistency and user can see two different values of a same variable. (to provide A and P) CA - No Partition tolerance at all, means there is only one server, which always have a fresh copy and no need of replication to any nodes, hence not a distributed system. (to provide C and A)
@harishaseri
@harishaseri 10 месяцев назад
I have quick question regarding above lecture . right now it is not that we are just having distributed databases only , now days we have distributed application as well(like RU-vid or insta) . I mean we have multiple servers or app servers . how does the CAP Theorem can be applied here . because here consistency concept is not applicable . may be partition tolerance we can apply . so basically here we can only think of AP only right ? I am not sure if my question is clear to you or not . In simple terms , how can we apply CAP Theorem on Distributed Application(not database application) ?
@ConceptandCoding
@ConceptandCoding 10 месяцев назад
See even we have distributed app server but database is not distributed (let's say it's centralised) then CAP can be applied and if we see, out system is only C not fulfilling AP. And if we have distributed database, irrespective whether we have distributed app server or not, then again CAP theorem can be applied and whatever we discussed in the video that is applicable.
@bobbysadhwani991
@bobbysadhwani991 7 месяцев назад
Great Explanation bhaiya but, in absence of Partial Tolerance, the combination is Consistency & Availability which means a system is not up and running but it is consistence & avalaible. How it is possible?
@ConceptandCoding
@ConceptandCoding 7 месяцев назад
Yes it's (CA) is not possible in distributed systems it's hypothetical.
@TanuKansal-nn4el
@TanuKansal-nn4el 2 месяца назад
Hi sir, I have a doubt, In case of CP, As you told,,, user doesn't know which db node it is requesting,,, even if A gets down user can still request for data,,, and it will get response from B also. So can't we say in this case there is availability of system?
@ConceptandCoding
@ConceptandCoding 2 месяца назад
in a CP system, if node A goes down after processing a request and another request comes in, the system relies on the remaining available nodes (like B) to handle the request. The system ensures that B has the necessary data by either replicating the data from A to B before A goes down (as its following Consistency). So we can say with CP, availability get reduced a bit
@OMPRAKASH-fh3so
@OMPRAKASH-fh3so 2 месяца назад
Is availiablity means all the node sholud be respond or the system is availabe in case of failure?
@ConceptandCoding
@ConceptandCoding 2 месяца назад
availability means a distributed system can continue operating and responding to requests, even if some nodes are failing. It doesn't require all nodes to be responsive simultaneously but focuses on the overall system's ability to remain functional during failures.
@apurvaagrawal2384
@apurvaagrawal2384 8 месяцев назад
I have a doubt...i know there would be flaw in it...please try and answer... I think all 3 are possible, If A updates B, C together always, there is no connection between B and C. So it is partition tolerant as if B and C connection breaks no effect, consistent becoz A is updating B and C so data will be same there, And available because both nodes will be available
@ConceptandCoding
@ConceptandCoding 8 месяцев назад
Nope, can you tell how Application will write in B and C together? Is it possible? If yes, then how?
@Rock28099
@Rock28099 2 месяца назад
I have one doubt. CA- here if network parition has happened then the system will shut down. Hence we indirectly compromise the AVAILABLITY too. Correct? Similary, In CP, if network parition happens then the system remains up therefore indirectly we are achieving the AVAILABLITY. Isn’t it??
@amritsatapathy7820
@amritsatapathy7820 2 месяца назад
In CP, we cannot achieve AVAILABLITY because we will have to down the nodes without latest data (otherwise system will reflect different data since the nodes could not be updated due to parttion in system.). If we dont , we cannot achieve Consistency.(same data in all nodes) As for CA, a distributed system having CA property is hypothetical. It cannot exist in real world. We can achieve CA without P, by having only one node (meaning one node, no replicas, so we dont have a distributed system). Hope this helps !
@Rock28099
@Rock28099 2 месяца назад
@@amritsatapathy7820thanks, bro. But the system following CP doesn’t go down na. Isn’t it? Shreyansh also said the same. If the system is the following Partitioning then when Network partitioned happens the system breaks into two partitions where devices in partition 1 can communicate and send data to each other and the same with devices in network partition 2 but if some devices from partition. 1 tries to communicate with the device of partition 2 then there will be a delay because the network partitione happened. If the system follows consistency and Partitioning and then still goes down then what is the meaning of following up?
@amritsatapathy7820
@amritsatapathy7820 2 месяца назад
​@@Rock28099 Yes bro, the overall system will not go down, but the nodes/devices in partition 2 will be down or specifically, they are shut down so that no requests are served by those nodes and system is kept CONSISTENT. (because if not, they will give diiferent data violating Consistency). So, during this time, if any requests are going to devices of partiton2, we may/may not get a response. Here , the Availablity then gets violated.
@Rock28099
@Rock28099 2 месяца назад
@@amritsatapathy7820 thanks bro… all clear now
@kumarnishchay9065
@kumarnishchay9065 Год назад
Can i get the notes and the materials that you are making in this RU-vid videos ?
@ConceptandCoding
@ConceptandCoding Год назад
Hi, sorry i did not saved it but will do from future
@shantanumapari6679
@shantanumapari6679 8 месяцев назад
I did not understand how system achieves CP?
@ConceptandCoding
@ConceptandCoding 8 месяцев назад
This concept mostly resolved through DB design
@tejeswarpala2841
@tejeswarpala2841 Год назад
Great explanation. but not so great audio. : -)
@ConceptandCoding
@ConceptandCoding Год назад
All latest videos are made from new mic, so i have improved this part tejeswar
@rekhavs9547
@rekhavs9547 6 месяцев назад
Sir, can these videos in future be in English?
@ConceptandCoding
@ConceptandCoding 6 месяцев назад
I will add captions to these hindi videos
@rekhavs9547
@rekhavs9547 6 месяцев назад
Thanks sir@@ConceptandCoding
@AnkushJaswals
@AnkushJaswals Год назад
20-05-2023 Thanks.
@ConceptandCoding
@ConceptandCoding Год назад
thanks
@AnkushJaswals
@AnkushJaswals Год назад
@@ConceptandCoding Hi Today I booked 1:1 session with you on topmate. It is scheduled for 8-8:30 today. 22-5-2023
@AnkushJaswals
@AnkushJaswals Год назад
You didn't joined. I hope everything is ok at end.
@ConceptandCoding
@ConceptandCoding Год назад
@@AnkushJaswals oops i missed it. Let me reschedule it
@AnkushJaswals
@AnkushJaswals Год назад
@@ConceptandCoding Thanks.
@amazing_quotes7432
@amazing_quotes7432 Год назад
I cannot access ur java tutorials?
@ConceptandCoding
@ConceptandCoding Год назад
It's for channel members buddy
@amazing_quotes7432
@amazing_quotes7432 Год назад
@@ConceptandCoding how can i be a member?
@ConceptandCoding
@ConceptandCoding Год назад
@@amazing_quotes7432 pls check out the first video, i have shared the process buddy ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-GeG895R5EtU.html
@ravikumar-lg3yn
@ravikumar-lg3yn Год назад
Please try to give explanation in English
@ConceptandCoding
@ConceptandCoding Год назад
sure Ravi
@dpynsnyl
@dpynsnyl 9 месяцев назад
the explanation is a bit clouded.
@ConceptandCoding
@ConceptandCoding 9 месяцев назад
Sorry for that, pls do comment what is not clear, i will try to answer that
@shreyashs
@shreyashs Год назад
Bro its wrong....AC is not possible. For that PACELC is introduced
@ConceptandCoding
@ConceptandCoding Год назад
It is possible. PACELC is just an extension of CAP by introduction of Latency. But it never says it is introduced because AP is not possible. That's my view but we can discuss more on this.
@krishnachaitanya9986
@krishnachaitanya9986 Год назад
PACELC is introduced for a use case of Partition itself is not available in a distributed system(DS), then it can choose between Latency and Consistency. 1. Partition is available in DS, it can trade off between Consistency and Availability 2. System is running with out partition, it can trade off between Latency and Consistency So it reverses CAP theorem with PAC and adds else condition for Latency and Consistency, so the name PACELC (Partitioned Availability Consistency Else Latency Consistency)
@ConceptandCoding
@ConceptandCoding Год назад
@@krishnachaitanya9986 thanks Krishna. Very nicely explained the PACELC
@krishnachaitanya9986
@krishnachaitanya9986 Год назад
Thank you and kudos to your effort 🙏
@rhythmjayee9707
@rhythmjayee9707 Год назад
Reach++
Далее
CAP Theorem Simplified
5:33
Просмотров 123 тыс.
У каждого есть такой друг😂
00:31
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
CAP Theorem - From the First Principles
42:42
Просмотров 21 тыс.
My thoughts on the CAP theorem
17:33
Просмотров 24 тыс.
У каждого есть такой друг😂
00:31