Life Beyond the Illusion of Present
-
Upload
jonas-boner -
Category
Technology
-
view
10.297 -
download
10
Transcript of Life Beyond the Illusion of Present
![Page 1: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/1.jpg)
Life BEYONDthe ILLUSIONof PRESENT
Jonas BonérCTO Typesafe
@jboner
![Page 2: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/2.jpg)
"Time is what prevents everything from happening at once."- John Archibald Wheeler
![Page 3: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/3.jpg)
Newton's PHYSICS
![Page 4: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/4.jpg)
THIS SIMPLIFIED MODEL ISVERY APPEALING TO US
![Page 5: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/5.jpg)
von NeumannARCHITECTURE
![Page 6: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/6.jpg)
BACK THENLIFE WAS GOOD
![Page 7: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/7.jpg)
THEN, ALONG CAMECONCURRENCYMADE LIFE MISERABLE
![Page 8: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/8.jpg)
Jim Gray'sTRANSACTIONSSAVE THE DAY
![Page 9: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/9.jpg)
![Page 10: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/10.jpg)
WELL, ALONG CAMEDISTRIBUTIONMADE LIFE MISERABLE, again...
![Page 11: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/11.jpg)
But don't be surprisedUNFORTUNATELY,THIS IS NOTHOW THE WORLD WORKS
![Page 12: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/12.jpg)
"The future is a function of the past."- A. P. Robertson
![Page 13: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/13.jpg)
"The (local) present is a merge function of multiple concurrent pasts."
— Me
![Page 14: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/14.jpg)
val newLocalPresent = observedPasts. foldLeft(oldLocalPresent) { _ merge _ }
![Page 15: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/15.jpg)
WE NEED TO EXPLICITLY MODEL THE
LOCAL PRESENT ASFACTS DERIVED FROM THEMERGING OF MULTIPLECONCURRENT PASTS
![Page 16: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/16.jpg)
INFORMATION IS ALWAYS FROM THE PAST
![Page 17: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/17.jpg)
THE TRUTHIS CLOSER TOEINSTEIN'S
PHYSICS
![Page 18: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/18.jpg)
INFORMATION HAS
LATENCY
![Page 19: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/19.jpg)
THE COST OF MAINTAININGTHIS ILLUSION IS INCREASED
CONTENTION &COHERENCY
![Page 20: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/20.jpg)
AS LATENCY GETS HIGHER, THEILLUSION CRACKS EVEN MORE
![Page 21: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/21.jpg)
DISTRIBUTED SYSTEMSEVERYWHERE
![Page 22: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/22.jpg)
THE NETWORK IS RELIABLE...NAT
![Page 23: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/23.jpg)
"If a tree falls in a forest and no one is around to hear it, does it make a sound?"
— Charles Riborg Mann
![Page 24: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/24.jpg)
Information CAN (and will) GET LOST
![Page 25: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/25.jpg)
HOW DO WE DEAL WITHINFORMATION LOSSIN REAL LIFE?
![Page 26: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/26.jpg)
WE USE A SIMPLE PROTOCOL OFConfirm, Wait & Repeat
![Page 27: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/27.jpg)
We fill in THE BLANKS
![Page 28: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/28.jpg)
...AND IF WE ARE WRONG, WE TAKECOMPENSATING ACTIONAPOLOGY-ORIENTED PROGRAMMING - PAT HELLAND (IN MEMORIES, GUESSES, AND APOLOGIES)
![Page 29: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/29.jpg)
The bottom line:WE CAN'T FORCE THE WORLD INTO A
SINGLE GLOBALLY CONSISTENT
PRESENT
![Page 30: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/30.jpg)
Should we just GIVE UP?
![Page 31: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/31.jpg)
I BELIEVE THAT THERE IS APATH FORWARD
![Page 32: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/32.jpg)
WE NEED TO TREATTIME AS A
FIRST CLASS CONSTRUCT
![Page 33: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/33.jpg)
WHAT IS TIME, really?
![Page 34: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/34.jpg)
TIME IS THESUCCESSION OFCAUSALLY RELATED EVENTS
![Page 35: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/35.jpg)
How can weMANAGETIME?
![Page 36: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/36.jpg)
Think in FACTS
![Page 37: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/37.jpg)
What is aFACT?
![Page 38: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/38.jpg)
"A Fact is something that truly exists or happens: something that has actual existence, a true piece of information."
— Merriam Webster
![Page 39: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/39.jpg)
IMMUTABILITYis a requirement
![Page 40: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/40.jpg)
So, do variablesHAVE A PURPOSE IN LIFE?
![Page 41: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/41.jpg)
"The assignment statement is the von Neumann bottleneck of programming languages and keeps us thinking in word-at-a-time terms
in much the same way the computer's bottleneck does."— John Backus (Turing Award lecture 1977)
![Page 42: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/42.jpg)
MUTABLE STATENEEDS TO BECONTAINED
![Page 43: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/43.jpg)
Ok, but how should weMANAGE FACTS?
![Page 44: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/44.jpg)
FunctionalPROGRAMMING
![Page 45: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/45.jpg)
LogicPROGRAMMING
![Page 46: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/46.jpg)
DataflowPROGRAMMING
![Page 47: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/47.jpg)
NEVERDELETEFACTS
![Page 48: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/48.jpg)
"When bookkeeping was done with clay tablets or paper and ink, accountants developed some clear rules about good accounting practices. One never alters the books; if an error is made, it is
annotated and a new compensating entry is made in the books. The books are thus a complete history of the transactions of the business. Update-in-place strikes many systems designers as a cardinal sin: it violates traditional accounting practices that have been observed for
hundreds of years."— Jim Gray (1981)
![Page 49: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/49.jpg)
CRUD
![Page 50: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/50.jpg)
"Database is a cache of a subset of the log."— Pat Helland (2007)
![Page 51: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/51.jpg)
Store facts in anEVENT LOG
![Page 52: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/52.jpg)
The log allows
TIMETRAVEL
![Page 53: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/53.jpg)
Can we REWRITE THE PAST?
![Page 54: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/54.jpg)
Allows us to shift our focus from
DATA AT REST, toDATA IN MOTION
![Page 55: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/55.jpg)
Stream Processing
![Page 56: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/56.jpg)
CONSTRUCTING A SUFFICIENTLY CONSISTENT
LOCAL PRESENTMEANS EMPLOYING
CONSISTENCY MECHANISMS
![Page 57: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/57.jpg)
ConsistencyWHAT?WHY?
WHEN?
![Page 58: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/58.jpg)
WE NEED TO DECOMPOSE THE SYSTEM USINGCONSISTENCY BOUNDARIES
![Page 59: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/59.jpg)
INSIDE DATA: OUR CURRENT PRESENTOUTSIDE DATA: BLAST FROM THE PASTBETWEEN SERVICES: HOPE FOR THE FUTURE
— PAT HELLAND (DATA ON THE INSIDE VS DATA ON THE OUTSIDE)
![Page 60: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/60.jpg)
MicroSERVICE
![Page 61: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/61.jpg)
AGGREGATE Root
![Page 62: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/62.jpg)
WITHIN THE CONSISTENCY BOUNDARY
![Page 63: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/63.jpg)
EVENTSourcing
![Page 64: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/64.jpg)
BETWEEN THEConsistencyBoundariesIT'S A ZOO
![Page 65: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/65.jpg)
Decoupling in
TIME / SPACE
![Page 66: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/66.jpg)
STRONGCONSISTENCYThe wrong default
![Page 67: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/67.jpg)
Here, we are living in theLOOMING SHADOW OF
IMPOSSIBILITYTHEOREMS
![Page 68: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/68.jpg)
FLPCONSENSUS IS IMPOSSIBLE
![Page 69: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/69.jpg)
PROTOCOLS CLIMB THE LADDER OF KNOWLEDGECɸ: Common Knowledge (infinite number of i)
Eiɸ: (Everyone knows * i) ɸE3ɸ: (Everyone knows * 3) ɸ
E2ɸ: Everyone knows Everyone knows ɸE1ɸ: Everyone knows ɸSɸ: Someone knows ɸ
![Page 70: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/70.jpg)
COMMON KNOWLEDGEIS NOT ATTAINABLE VIA PROTOCOL
- JOSEPH HALPERN
![Page 71: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/71.jpg)
CAPCONSISTENCY IS IMPOSSIBLE
![Page 72: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/72.jpg)
Dissecting
CAP
![Page 73: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/73.jpg)
"The first principle of successful scalability is to batter the consistency mechanisms down to a minimum."
– James Hamilton
![Page 74: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/74.jpg)
EVENTUALCONSISTENCY
What does it really mean?
![Page 75: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/75.jpg)
Tracking TIME is tracking CAUSALITY
![Page 76: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/76.jpg)
RELYING ONTIMESTAMPSIS A BAD IDEA
![Page 77: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/77.jpg)
Instead, rely onLOGICAL TIME
![Page 78: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/78.jpg)
LamportCLOCKS
GLOBAL CAUSAL ORDERING BETWEEN
![Page 79: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/79.jpg)
VectorCLOCKS
PARTIAL CAUSAL ORDERING BETWEEN EVENTS
![Page 80: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/80.jpg)
CausalCONSISTENCY
![Page 81: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/81.jpg)
WhatCONSISTENCY
DO YOU REALLY NEED AND
when?
![Page 82: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/82.jpg)
ACID 2.0ASSOCIATIVE
COMMUTATIVEIDEMPOTENTDISTRIBUTED
![Page 83: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/83.jpg)
CONFLICT-FREE REPLICATED DATA TYPES
![Page 84: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/84.jpg)
DISORDERLY PROGRAMMINGCALM THEOREM
![Page 85: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/85.jpg)
WE ARE JUST GETTING STARTED
![Page 86: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/86.jpg)
WE HAVE A LONG ROAD AHEAD OF US...
![Page 87: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/87.jpg)
![Page 88: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/88.jpg)
ThanksFOR LISTENING
![Page 89: Life Beyond the Illusion of Present](https://reader034.fdocuments.us/reader034/viewer/2022042615/55b6e3a9bb61eb6c268b4799/html5/thumbnails/89.jpg)
Life BEYONDthe ILLUSIONof PRESENT
Jonas BonérCTO Typesafe
@jboner