OP3: CAP controller
Write the pseudocode of a "controller" that expresses, through code, the CAP principle (including some of the nuances described in the "twelve years later" paper). The "controller" is a client-side library that links with your application and basically provides a method
You are to write the pseudocode for doOperation. You may assume that your pseudocode has access to an oracle
that returns True if, within the current call context and at this point in time, consistency should be prioritized over availability, and False otherwise.
Think of
- Consistency as being the property that any read operation that begins after a write operation completed must return the written value, or the result of a later write operation;
- Availability as meaning that every request received by a non-failed node in the system results in a correct response; and
- Partition as meaning that one or more servers that store data are unreachable.
There should be no text other than your pseudocode, but you can use comments to justify certain lines of code. Write the pseudocode any way you like, as long as you're certain that the POCS staff will understand it. Be succinct (you shouldn't need more than 30 lines of pseudocode).
The objective of this OP is to give you practice in choosing the level of abstraction at which to describe a design. We are asking you to say in your own words what the CAP trade-offs are about, but you need to do it more precisely than described in the CAP paper. As a result, it will be easy to get lost in details or to be too high-level and hand-wavy, so you must choose wisely "the right" level of abstraction, to avoid unnecessary details in the pseudocode while still capturing the essence of your design. There exist multiple right answers, so don't try to find "the one that the staff is looking for". You have plenty of latitude to choose your level of abstraction, you can delegate functionality to procedures whose existence you assume, etc.
Your submission must be in PDF and consist of one single-spaced A4 page. The OP should be single-column and use a monospaced font with 10-point type or greater, to make reading pseudocode easier. Submit your OP through Moodle by the indicated due date and time. The submission’s title must be "OP3: CAP controller". Do not write your name on the OP.
You are not allowed to discuss the topic of the OP with anyone else until after the submission deadline. The OP must be 100% your own work.