What shall you choose when a Partition does occur and why?

Technology CommunityCategory: CAP TheoremWhat shall you choose when a Partition does occur and why?
VietMX Staff asked 3 years ago

According to the CAP theorem, this means we are left with two options: Consistency and Availability.

  • CP – Consistency/Partition Tolerance – Wait for a response from the partitioned node which could result in a timeout error. The system can also choose to return an error, depending on the scenario you desire. Choose Consistency over Availability when your business requirements dictate atomic reads and writes.
  • AP – Availability/Partition Tolerance – Return the most recent version of the data you have, which could be stale. This system state will also accept writes that can be processed later when the partition is resolved. Choose Availability over Consistency when your business requirements allow for some flexibility around when the data in the system synchronizes. Availability is also a compelling option when the system needs to continue to function in spite of external errors (shopping carts, etc.)