gaurav@principal — engineer.py
# design happens long before the first line of code
class GauravVerma(PrincipalEngineer):
def design(self, problem):
why = self.constraints(problem) # scale, SLA, cost
hld = self.boundaries(why) # data flow, ownership
lld = self.contracts(hld) # schemas, idempotency
# what turns a diagram into a design
for f in self.what_breaks(lld):
assert f.is_contained # blast radius
assert f.is_observable # traced, not guessed
assert f.is_recoverable # retry, replay, revert
assert f.loses_nothing # no silent data loss
return self.simplest_thing_that_survives(hld, lld)
def what_breaks(self, system):
yield from (
"the network", "the network, but only one way",
"a dependency that got slow, not down",
"a crash mid-write", "the same event twice",
"a webhook that landed while we were down",
"a write that landed, an event that didn't",
"two leaders, both certain", "a clock that lies",
"a replica three minutes behind", "one hot key",
"retries, in unison", "a queue that only grows",
"a cache, cold, at 9am", "exactly-once, allegedly",
"the tenant with 100x the data",
)
python -c "GauravVerma().design(your_hardest_problem)"