Can one record tell you both now and then?
Two reads disagree. First ask which moment each value describes, then who can change it. Keeping history and coordinating writes solve different problems.
Questions in this reading · 7
- What did the record say at the time?
- Can a later update invalidate an earlier fact?
- What does a snapshot promise its reader?
- Why does shared mutable state tangle a program?
- Does hiding mutation remove coordination costs?
- Who coordinates access to the same record?
- Why don’t two locked objects make a safe transaction?
What did the record say at the time?
Access patterns determine how to organize a store. Retaining historical facts determines which past questions it will ever be able to answer.
Compare original passages and timestamps · 2
understand every access pattern I need to knowno they don't because facts incorporate time how isCan a later update invalidate an earlier fact?
State makes an answer depend on when you ask. Recording time with a fact lets two different answers describe different moments without contradicting each other.
Compare original passages and timestamps · 2
Having state in your program is never simple, right?no they don't because facts incorporate time how isWhat does a snapshot promise its reader?
Stable snapshots let observers read a particular version. Treating information as values explains why that version can be passed on without changing its meaning.
Compare original passages and timestamps · 2
key characteristic of a value is that it's immutablevalues are immutable right and values are semantically transparentWhy does shared mutable state tangle a program?
One talk separates identity from its successive values. The other shows how state couples parts of a system through time. Read them together to identify what a caller must know about earlier operations.
Compare original passages and timestamps · 2
key characteristic of a value is that it's immutableHaving state in your program is never simple, right?Does hiding mutation remove coordination costs?
An object can conceal its state and still require callers to coordinate operations. Examine what happens when independently safe operations must work together.
Compare original passages and timestamps · 2
They hide mutation – they mutate some state inside, right?feels like an immutable
object, except that it has state inside it.Who coordinates access to the same record?
Designing a table around queries addresses how data is laid out. Routing operations to one process addresses how simultaneous work on a record is coordinated.
Compare original passages and timestamps · 2
access on a single record is going through a single processunderstand every access pattern I need to knowWhy don’t two locked objects make a safe transaction?
Compare what each lock protects with what the combined operation requires. This is a cost of coordinating shared mutable state, not a claim that every lock is wrong.
Compare original passages and timestamps · 3
values aggregate to values all the benefits apply to Aggregatesand unfortunately locks don't compose either, right. That's the problem with locks.as soon as you have objects being shared encapsulation just flies out the windowTry it on your own example
If two requests update one account, what can a reader see, and can you recover the previous value later?