Skip to content

Instantly share code, notes, and snippets.

@jhellerstein
jhellerstein / hellerstein_invent_simplify.md
Last active April 7, 2025 06:41
Invent and Simplify note, Joe Hellerstein

Invent and Simplify: CALM

One of the more innovative and important results in my work is an idea now known as the CALM Theorem. CALM came from a desire to sidestep expensive "coordination" services whenever possible, including database transactions and consensus services (e.g., Paxos, RAFT). This desire came up naturally with web-scale data (e.g., "NoSQL" systems like Dynamo) and geo-distributed cloud computing (e.g., AWS). Unfortunately, when we abandon the familiar foundations of coordination, we risk unpredictable behavior if nodes make decisions based on stale or inconsistent data.

In this note I explain the CALM Theorem and reflect on why I think it's both important and a good example of the principle to Invent and Simplify.

Let's begin with terminology. CALM is an acronym: Consistency As Logical Monotonicity. That is a mouthful for sure, so we'll break it down.

Consistency

@jhellerstein
jhellerstein / gist:6f550075bf177963518649e92c540bb0
Created April 7, 2025 06:40
Invent and Simplify: Joe Hellerstein
## Invent and Simplify: CALM
One of the more innovative and important results in my work is an idea now known as the CALM Theorem. CALM came from a desire to sidestep expensive "coordination" services whenever possible, including database transactions and consensus services (e.g., Paxos, RAFT). This desire came up naturally with web-scale data (e.g., "NoSQL" systems like Dynamo) and geo-distributed cloud computing (e.g., AWS). Unfortunately, when we abandon the familiar foundations of coordination, we risk unpredictable behavior if nodes make decisions based on stale or inconsistent data.
In this note I explain the CALM Theorem and reflect on why I think it's both important and a good example of the principle to Invent and Simplify.
Let's begin with terminology. CALM is an acronym: *Consistency As Logical Monotonicity*. That is a mouthful for sure, so we'll break it down.
#### Consistency
@jhellerstein
jhellerstein / test_flor_schema_pivot.sql
Last active August 14, 2023 05:22
An example flor schema and sqlite view
DROP TABLE IF EXISTS loops;
DROP TABLE IF EXISTS log_entries;
CREATE TABLE loops (
loop_id integer PRIMARY KEY,
loop_name text,
loop_val integer,
parent_id integer,
UNIQUE (loop_name, loop_val, parent_id),
FOREIGN KEY (parent_id) REFERENCES loops
hydroflow]> export CARGO_LOG=cargo::core::compiler::fingerprint=info
hydroflow]> cargo build
[2022-12-05T17:52:58Z INFO cargo::core::compiler::fingerprint] stale: missing "/Users/jmh/.git/HEAD"
[2022-12-05T17:52:58Z INFO cargo::core::compiler::fingerprint] fingerprint error for hydroflow v0.1.0 (/Users/jmh/Dropbox/code/hydroflow/hydroflow)/Build/TargetInner { ..: lib_target("hydroflow", ["lib"], "/Users/jmh/Dropbox/code/hydroflow/hydroflow/src/lib.rs", Edition2021) }
[2022-12-05T17:52:58Z INFO cargo::core::compiler::fingerprint] err: current filesystem status shows we're outdated
[2022-12-05T17:52:58Z INFO cargo::core::compiler::fingerprint] fingerprint error for hydroflow_datalog v0.1.0 (/Users/jmh/Dropbox/code/hydroflow/hydroflow_datalog)/Build/TargetInner { for_host: true, proc_macro: true, ..: lib_target("hydroflow_datalog", ["proc-macro"], "/Users/jmh/Dropbox/code/hydroflow/hydroflow_datalog/src/lib.rs", Edition2021) }
[2022-12-05T17:52:58Z INFO cargo::core::compiler::fingerprint] err: curre
@jhellerstein
jhellerstein / kickoff-blog.md
Last active January 22, 2017 21:29 — forked from anonymous/kickoff-blog.md
RISE lab kickoff blog post

RISELab Kicks Off

Berkeley's computer science division has an ongoing tradition of 5-year collaborative research labs. In the fall of 2016 we closed out the most recent of the series: the AMPlab. We think it was a pretty big deal, and many agreed.

One great thing about Berkeley is the endless supply of energy and ideas that

@jhellerstein
jhellerstein / stream_test.cc
Last active December 14, 2016 01:50
Examples using Streams
#include <vector>
#include <functional>
#include "Stream.h"
using namespace stream;
using namespace stream::op;
using namespace std;
std::vector<tuple<int, string>> make_vector() {
tuple<int, string> t1 = {1, "cgwu"};