The PACELC Theorem
A shop with two stores can phone the other store before every sale, which is slow and safe. Or it can sell first and phone later, which is fast and sometimes wrong. PACELC names this choice for databases.
6 min read6 মিনিটে পড়া যায় · 8 sections8টি সেকশন · 1 source1টি সোর্স · updated Nov 2026আপডেট: Nov 2026
Latency or consistency, with nothing brokenকিছু না ভাঙলেও ল্যাটেন্সি বনাম কনসিসটেন্সি
Slide R and W across the replicas and see the write wait and stale reads trade places.রিপ্লিকাগুলোর ওপর R আর W স্লাইড করুন আর দেখুন রাইটের অপেক্ষা আর পুরোনো রিড একে অন্যের জায়গা নেয়।
You’ll learnআপনি শিখবেন
- Why copies force a choiceকপি কেন একটা বাছাই বাধ্য করে
- Wait for all, or reply earlyসবার জন্য অপেক্ষা, নাকি আগে উত্তর
- R + W more than N keeps reads freshR + W, N-এর চেয়ে বেশি হলে রিড সর্বশেষ থাকে
- Why a wide area makes writes slowওয়াইড এরিয়াতে রাইট কেন ধীর
In plain words
PACELC (said "pass-elk") rewrites the CAP theorem as one question with two parts Source 1সোর্স 1:
- If there is a network partition (P), does the system give up availability (A) or consistency (C)?
- Else (E), when the system runs normally, does it give up latency (L) or consistency (C)?
The paper that proposed it says CAP sets limits only when certain failures happen, and not during normal operation Source 1সোর্স 1. The paper adds a second trade-off that is present all the time: consistency against latency Source 1সোর্স 1.
সহজ English
PACELC (said "pass-elk") rewrites the CAP theorem as one question with two parts Source 1সোর্স 1:
- If there is a network partition (P), does the system give up availability (A) or consistency (C)?
- Else (E), when the system runs normally, does it give up latency (L) or consistency (C)?
The paper that proposed it says CAP sets limits only when certain failures happen. It does not set limits during normal operation Source 1সোর্স 1. The paper adds a second trade-off that is present all the time: consistency against latency Source 1সোর্স 1.
বাংলা ব্যাখ্যা
PACELC ("pass-elk" উচ্চারণ) CAP থিওরেমকে দুই অংশের একটি প্রশ্ন হিসেবে নতুন করে লেখে Source 1সোর্স 1:
- যদি একটি নেটওয়ার্ক পার্টিশন (partition, P) থাকে, সিস্টেম কি অ্যাভেইলেবিলিটি (A) ছাড়ে, না কনসিসটেন্সি (C)?
- নইলে (E), সিস্টেম যখন স্বাভাবিকভাবে চলে, সে কি ল্যাটেন্সি (L) ছাড়ে, না কনসিসটেন্সি (C)?
যে পেপার এটি প্রস্তাব করেছে, সে বলে CAP শুধু কিছু ফেইলিউর ঘটলে সীমা টানে। স্বাভাবিক চলার সময় সে সীমা টানে না Source 1সোর্স 1। পেপার একটি দ্বিতীয় ট্রেড-অফ যোগ করে, যা সবসময় থাকে: কনসিসটেন্সি বনাম ল্যাটেন্সি Source 1সোর্স 1।
When you need it
You need PACELC when you read about a distributed database, or test an app on top of one. A partition is somewhat rare, and often rarer than other serious failures Source 1সোর্স 1. Most of the time the database runs normally, and PACELC also describes that time.
সহজ English
You need PACELC when you read about a distributed database, or test an app on top of one. A partition is somewhat rare. Often it is rarer than other serious failures Source 1সোর্স 1. Most of the time the database runs normally. PACELC also describes that time.
বাংলা ব্যাখ্যা
ডিস্ট্রিবিউটেড ডেটাবেস সম্পর্কে পড়ার সময়, বা তার উপরের একটি অ্যাপ টেস্ট করার সময় আপনার PACELC লাগে। পার্টিশন কিছুটা বিরল। প্রায়ই এটি অন্য গুরুতর ফেইলিউরের চেয়েও বিরল Source 1সোর্স 1। বেশিরভাগ সময় ডেটাবেস স্বাভাবিকভাবে চলে। PACELC সেই সময়কেও বর্ণনা করে।
How it works
Why does a trade-off exist when nothing is broken? The paper gives this chain Source 1সোর্স 1:
- A system that must stay available needs more than one copy of its data. If a component with the only copy fails, that data is lost to the service Source 1সোর্স 1.
- As soon as there are copies, the system must decide when a write counts as done.
There are two main ways Source 1সোর্স 1:
| Replication | What happens | Cost |
|---|---|---|
| Synchronous | The master waits until the replicas have the update | Replicas stay consistent, but each write waits for the slowest entity, and more so over a wide area network Source 1সোর্স 1 |
| Asynchronous | The system treats the update as done before it has been copied | If reads can go to any node, reads are faster, but they can return old data while updates spread Source 1সোর্স 1 |
A common middle way is a quorum. With N replicas, W nodes take part in a write, and R nodes take part in a read. If R + W is more than N, consistency can be kept. If R + W is N or less, inconsistent reads are possible Source 1সোর্স 1.
Over a wide area network, a system cannot avoid the trade-off Source 1সোর্স 1. The paper treats availability and latency as nearly the same thing: a system that does not answer has extreme latency Source 1সোর্স 1.
সহজ English
Why does a trade-off exist when nothing is broken? The paper gives this chain Source 1সোর্স 1:
- A system that must stay available needs more than one copy of its data. If a component with the only copy fails, that data is lost to the service Source 1সোর্স 1.
- As soon as there are copies, the system must decide when a write counts as done.
There are two main ways Source 1সোর্স 1:
- Synchronous replication. The master waits until the replicas have the update. Replicas stay consistent. But each write waits for the slowest entity, and more so over a wide area network Source 1সোর্স 1.
- Asynchronous replication. The system treats the update as done before it has been copied. If reads can go to any node, reads are faster. But they can return old data while updates spread Source 1সোর্স 1.
A common middle way is a quorum. With N replicas, W nodes take part in a write, and R nodes take part in a read. If R + W is more than N, consistency can be kept. If R + W is N or less, inconsistent reads are possible Source 1সোর্স 1.
Over a wide area network, a system cannot avoid the trade-off Source 1সোর্স 1. The paper treats availability and latency as nearly the same thing. A system that does not answer has extreme latency Source 1সোর্স 1.
বাংলা ব্যাখ্যা
কিছু ভাঙা না থাকলেও কেন ট্রেড-অফ থাকে? পেপার এই ধারাটি দেয় Source 1সোর্স 1:
- যে সিস্টেমকে অ্যাভেইলেবল থাকতেই হবে, তার ডেটার একাধিক কপি লাগে। যে কম্পোনেন্টে একমাত্র কপি আছে সেটি ব্যর্থ হলে, সেই ডেটা সার্ভিসের কাছে হারিয়ে যায় Source 1সোর্স 1।
- কপি থাকলেই সিস্টেমকে ঠিক করতে হয় কখন একটি রাইট সম্পন্ন ধরা হবে।
দুটি প্রধান উপায় আছে Source 1সোর্স 1:
- সিঙ্ক্রোনাস রিপ্লিকেশন (synchronous replication)। মাস্টার অপেক্ষা করে, যতক্ষণ না রিপ্লিকাগুলো আপডেট পায়। রিপ্লিকাগুলো কনসিসটেন্ট থাকে। কিন্তু প্রতিটি রাইট সবচেয়ে ধীর এন্টিটির জন্য অপেক্ষা করে, আর ওয়াইড এরিয়া নেটওয়ার্কে আরও বেশি Source 1সোর্স 1।
- অ্যাসিঙ্ক্রোনাস রিপ্লিকেশন (asynchronous replication)। কপি হওয়ার আগেই সিস্টেম আপডেটকে সম্পন্ন ধরে। রিড যেকোনো নোডে গেলে রিড দ্রুত হয়। কিন্তু আপডেট ছড়িয়ে পড়ার সময় তারা পুরোনো ডেটা ফেরত দিতে পারে Source 1সোর্স 1।
একটি সাধারণ মাঝামাঝি উপায় হলো কোরাম (quorum)। N টি রিপ্লিকা থাকলে, W টি নোড রাইটে অংশ নেয় এবং R টি নোড রিডে অংশ নেয়। R + W যদি N-এর চেয়ে বেশি হয়, কনসিসটেন্সি রাখা যায়। R + W যদি N বা তার কম হয়, ইনকনসিসটেন্ট রিড সম্ভব Source 1সোর্স 1।
ওয়াইড এরিয়া নেটওয়ার্কে একটি সিস্টেম ট্রেড-অফ এড়াতে পারে না Source 1সোর্স 1। পেপার অ্যাভেইলেবিলিটি আর ল্যাটেন্সিকে প্রায় একই জিনিস ধরে। যে সিস্টেম উত্তর দেয় না, তার ল্যাটেন্সি চরম Source 1সোর্স 1।
A real-life example
This example is the tutorial's own, and it is a simplification.
A shop keeps its stock count in two data centers, one in Asia and one in Europe. A customer in Europe buys the last red shirt.
- Wait for the copy. The system waits for Asia to confirm the sale. Both centers agree, but the customer waits longer. This is the "EC" side.
- Answer first. The system confirms at once and copies later. It is fast, but for a moment a customer in Asia can still see the shirt. This is the "EL" side.
- The link breaks. The system can refuse some updates until the link returns, which keeps the data consistent (the "PC" side). Or it can keep accepting sales in both centers and sort out conflicts later (the "PA" side).
সহজ English
This example is the tutorial's own, and it is a simplification.
A shop keeps its stock count in two data centers, one in Asia and one in Europe. A customer in Europe buys the last red shirt.
- Wait for the copy. The system waits for Asia to confirm the sale. Both centers agree, but the customer waits longer. This is the "EC" side.
- Answer first. The system confirms at once and copies later. It is fast. But for a moment a customer in Asia can still see the shirt. This is the "EL" side.
- The link breaks. The system can refuse some updates until the link returns. This keeps the data consistent (the "PC" side). Or it can keep accepting sales in both centers and sort out conflicts later (the "PA" side).
বাংলা ব্যাখ্যা
এই উদাহরণ টিউটোরিয়ালের নিজের, এবং এটি একটি সরলীকরণ।
একটি দোকান তার স্টকের সংখ্যা দুটি ডেটা সেন্টারে রাখে, একটি এশিয়ায় আর একটি ইউরোপে। ইউরোপের একজন কাস্টমার শেষ লাল শার্টটি কেনে।
- কপির জন্য অপেক্ষা। সিস্টেম অপেক্ষা করে, যতক্ষণ না এশিয়া বিক্রি নিশ্চিত করে। দুটি সেন্টার একমত হয়, কিন্তু কাস্টমারকে বেশিক্ষণ অপেক্ষা করতে হয়। এটি "EC" দিক।
- আগে উত্তর। সিস্টেম সঙ্গে সঙ্গে নিশ্চিত করে এবং পরে কপি করে। এটি দ্রুত। কিন্তু কিছুক্ষণ এশিয়ার একজন কাস্টমার তখনও শার্টটি দেখতে পারে। এটি "EL" দিক।
- লিংক ভেঙে যায়। লিংক ফিরে না আসা পর্যন্ত সিস্টেম কিছু আপডেট প্রত্যাখ্যান করতে পারে। এতে ডেটা কনসিসটেন্ট থাকে ("PC" দিক)। অথবা সে দুটি সেন্টারেই বিক্রি নিতে থাকতে পারে এবং কনফ্লিক্ট পরে মেটাতে পারে ("PA" দিক)।
Trade-offs
This table is the tutorial's own summary of how the paper classifies some systems. The paper describes their original design, and some became adjustable later Source 1সোর্স 1. Treat the table as the paper's 2012 view, not as a statement about any product today.
| Label | Meaning | Systems the paper puts here |
|---|---|---|
| PA/EL | In a partition, gives up consistency for availability. In normal running, gives up consistency for lower latency | Dynamo, Cassandra, and Riak, as first built Source 1সোর্স 1 |
| PC/EC | Does not give up consistency, and pays in availability and latency | VoltDB/H-Store, Megastore, BigTable, and HBase Source 1সোর্স 1 |
| PA/EC | Consistent in normal running. In a partition, a new master is elected and the system stays available, so old and new masters can differ until a repair | MongoDB Source 1সোর্স 1 |
| PC/EL | Gives up consistency for latency in normal running. In a partition, gives up availability for consistency | PNUTS Source 1সোর্স 1 |
Two details are easy to miss. PC does not mean fully consistent. It means the system does not lower consistency below its normal level in a partition, and lowers availability instead Source 1সোর্স 1. And a PA/EL system can be tuned: with a higher R + W, a user gets more consistency for more latency, but not the full consistency of the CAP proof Source 1সোর্স 1.
Read latency. The paper cites a study of Cassandra. It found that the latency of reads that check several replicas can be four times higher or more Source 1সোর্স 1. The comparison is with the latency of reads from any replica Source 1সোর্স 1.
Limits of the theory. The paper also says that neither CAP nor PACELC explains every trade-off Source 1সোর্স 1.
সহজ English
This list is the tutorial's own summary of how the paper classifies some systems. The paper describes their original design. Some became adjustable later Source 1সোর্স 1. Treat the list as the paper's 2012 view. It is not a statement about any product today.
- PA/EL: in a partition, gives up consistency for availability. In normal running, gives up consistency for lower latency. The paper puts Dynamo, Cassandra, and Riak here, as first built Source 1সোর্স 1.
- PC/EC: does not give up consistency, and pays in availability and latency. The paper puts VoltDB/H-Store, Megastore, BigTable, and HBase here Source 1সোর্স 1.
- PA/EC: consistent in normal running. In a partition, a new master is elected and the system stays available. So old and new masters can differ until a repair. The paper puts MongoDB here Source 1সোর্স 1.
- PC/EL: gives up consistency for latency in normal running. In a partition, gives up availability for consistency. The paper puts PNUTS here Source 1সোর্স 1.
Two details are easy to miss. PC does not mean fully consistent. It means the system does not lower consistency below its normal level in a partition. It lowers availability instead Source 1সোর্স 1. And a PA/EL system can be tuned. With a higher R + W, a user gets more consistency for more latency. But the user does not get the full consistency of the CAP proof Source 1সোর্স 1.
A study of Cassandra that the paper cites found something. The latency of reads that check several replicas can be four times higher or more than the latency of reads from any replica Source 1সোর্স 1. The paper also says that neither CAP nor PACELC explains every trade-off Source 1সোর্স 1.
বাংলা ব্যাখ্যা
এই তালিকা পেপার কীভাবে কিছু সিস্টেমকে শ্রেণিবদ্ধ করে, তার টিউটোরিয়ালের নিজের সারসংক্ষেপ। পেপার তাদের মূল ডিজাইন বর্ণনা করে। পরে কিছু সিস্টেম অ্যাডজাস্ট করা যায় এমন হয়েছে Source 1সোর্স 1। তালিকাটিকে পেপারের 2012 সালের মত হিসেবে দেখুন। এটি আজকের কোনো প্রোডাক্ট সম্পর্কে বক্তব্য নয়।
- PA/EL: পার্টিশনে অ্যাভেইলেবিলিটির জন্য কনসিসটেন্সি ছাড়ে। স্বাভাবিক চলায় কম ল্যাটেন্সির জন্য কনসিসটেন্সি ছাড়ে। পেপার এখানে Dynamo, Cassandra ও Riak রাখে, যেভাবে প্রথমে বানানো হয়েছিল Source 1সোর্স 1।
- PC/EC: কনসিসটেন্সি ছাড়ে না, এবং অ্যাভেইলেবিলিটি ও ল্যাটেন্সি দিয়ে মূল্য দেয়। পেপার এখানে VoltDB/H-Store, Megastore, BigTable ও HBase রাখে Source 1সোর্স 1।
- PA/EC: স্বাভাবিক চলায় কনসিসটেন্ট। পার্টিশনে একটি নতুন মাস্টার নির্বাচিত হয় এবং সিস্টেম অ্যাভেইলেবল থাকে। তাই মেরামত না হওয়া পর্যন্ত পুরোনো ও নতুন মাস্টার ভিন্ন হতে পারে। পেপার এখানে MongoDB রাখে Source 1সোর্স 1।
- PC/EL: স্বাভাবিক চলায় ল্যাটেন্সির জন্য কনসিসটেন্সি ছাড়ে। পার্টিশনে কনসিসটেন্সির জন্য অ্যাভেইলেবিলিটি ছাড়ে। পেপার এখানে PNUTS রাখে Source 1সোর্স 1।
দুটি বিষয় সহজে চোখ এড়ায়। PC মানে সম্পূর্ণ কনসিসটেন্ট নয়। এর মানে পার্টিশনে সিস্টেম তার স্বাভাবিক স্তরের নিচে কনসিসটেন্সি নামায় না। সে বরং অ্যাভেইলেবিলিটি কমায় Source 1সোর্স 1। আর একটি PA/EL সিস্টেম টিউন করা যায়। বেশি R + W দিলে ইউজার বেশি ল্যাটেন্সির বিনিময়ে বেশি কনসিসটেন্সি পায়। কিন্তু সে CAP প্রমাণের সম্পূর্ণ কনসিসটেন্সি পায় না Source 1সোর্স 1।
পেপার যে Cassandra-র একটি স্টাডি উল্লেখ করে, তাতে একটি জিনিস পাওয়া গেছে। একাধিক রিপ্লিকা যাচাই করা রিডের ল্যাটেন্সি, যেকোনো একটি রিপ্লিকা থেকে রিডের ল্যাটেন্সির চার গুণ বা তার বেশি হতে পারে Source 1সোর্স 1। পেপার আরও বলে, CAP বা PACELC কেউই প্রতিটি ট্রেড-অফ ব্যাখ্যা করে না Source 1সোর্স 1।
Common mistakes
- Saying "weak consistency is because of CAP". The paper says the trade between consistency and latency exists without any partition, and is a separate reason Source 1সোর্স 1.
- Reading PC/EL as "fully consistent". The PC part only says what the system does in a partition. It does not say the system is fully consistent Source 1সোর্স 1.
- Using a 2012 label as a fact about today. The labels describe the original designs Source 1সোর্স 1.
সহজ English
- Saying "weak consistency is because of CAP". The paper says the trade between consistency and latency exists without any partition. It is a separate reason Source 1সোর্স 1.
- Reading PC/EL as "fully consistent". The PC part only says what the system does in a partition. It does not say the system is fully consistent Source 1সোর্স 1.
- Using a 2012 label as a fact about today. The labels describe the original designs Source 1সোর্স 1.
বাংলা ব্যাখ্যা
- "দুর্বল কনসিসটেন্সি CAP-এর কারণে" বলা। পেপার বলে, কনসিসটেন্সি ও ল্যাটেন্সির মধ্যকার ট্রেড-অফ কোনো পার্টিশন ছাড়াই থাকে। এটি একটি আলাদা কারণ Source 1সোর্স 1।
- PC/EL-কে "সম্পূর্ণ কনসিসটেন্ট" পড়া। PC অংশ শুধু বলে পার্টিশনে সিস্টেম কী করে। এটি বলে না যে সিস্টেম সম্পূর্ণ কনসিসটেন্ট Source 1সোর্স 1।
- 2012 সালের একটি লেবেলকে আজকের তথ্য হিসেবে ব্যবহার করা। লেবেলগুলো মূল ডিজাইন বর্ণনা করে Source 1সোর্স 1।
What a tester can check
Tutorial advice
These test ideas are the tutorial's own advice. They are not from the paper.
- Read right after write. Write a value, then read it at once from another replica. Note whether you see the old value, and for how long.
- Time both sides. Compare the latency of a normal read and a consistent read, if the database offers both.
- Check the settings. Test with the consistency settings that production uses.
- Break the link. In a test environment, cut the link between two nodes. Check whether the app refuses writes, accepts them, or shows a clear error.
- Check the repair. After the link returns, look for lost or doubled updates.
সহজ English
These test ideas are the tutorial's own advice. They are not from the paper.
- Read right after write. Write a value. Then read it at once from another replica. Note whether you see the old value, and for how long.
- Time both sides. Compare the latency of a normal read and a consistent read, if the database offers both.
- Check the settings. Test with the consistency settings that production uses.
- Break the link. In a test environment, cut the link between two nodes. Check whether the app refuses writes, accepts them, or shows a clear error.
- Check the repair. After the link returns, look for lost or doubled updates.
বাংলা ব্যাখ্যা
এই টেস্টের ধারণাগুলো টিউটোরিয়ালের নিজের পরামর্শ। এগুলো পেপার থেকে নয়।
- রাইটের ঠিক পরে রিড করুন। একটি মান লিখুন। তারপর সঙ্গে সঙ্গে অন্য রিপ্লিকা থেকে তা পড়ুন। পুরোনো মান দেখলেন কি না, এবং কতক্ষণ, তা লিখে রাখুন।
- দুই দিকেরই সময় মাপুন। ডেটাবেস দুটোই দিলে, একটি সাধারণ রিড ও একটি কনসিসটেন্ট রিডের ল্যাটেন্সি তুলনা করুন।
- সেটিং দেখুন। প্রোডাকশন যে কনসিসটেন্সি সেটিং ব্যবহার করে, তা দিয়ে টেস্ট করুন।
- লিংক ভাঙুন। একটি টেস্ট এনভায়রনমেন্টে দুটি নোডের মধ্যে লিংক কাটুন। দেখুন অ্যাপ রাইট প্রত্যাখ্যান করে, গ্রহণ করে, নাকি একটি পরিষ্কার এরর দেখায়।
- মেরামত দেখুন। লিংক ফিরে আসার পর হারানো বা দুবার হওয়া আপডেট খুঁজুন।
Key words
| Word | Meaning |
|---|---|
| PACELC | CAP rewritten as: if partition, availability or consistency; else, latency or consistency Source 1সোর্স 1 |
| Partition | A network failure that splits the nodes into groups that cannot reach each other (tutorial's own short definition) |
| Latency | The time a request takes to get its answer. The paper treats an unavailable system as one with extreme latency Source 1সোর্স 1 |
| Replication | Keeping copies of the data on more than one node Source 1সোর্স 1 |
| Quorum | A rule on how many nodes join a read (R) and a write (W), out of N replicas Source 1সোর্স 1 |
| PA/EL, PC/EC | Labels for what a system gives up in a partition and in normal running Source 1সোর্স 1 |