#architecture
Software and system design, patterns, APIs
Writing
TIL notes
The way agents ‘read’ code is different - good agents are all about gathering data about how the code works. They’ll prod around with it, execute parts of it.
So ‘readability’ to agents really means ‘verifiability’. How easy it is to mess about with that code to see it working.
Let’s take this scenario:
You have a huge module in your codebase that uses all sorts of complex performance tricks
It has 100% test coverage
A talented human would need an hour or two to get comfortable working in that module.
An agent needs zero time. They verify it with the tests, poke about a bit, and they’re good to go.
— Matt Pocock, on code readability in the age of agents jetify-com/typeid
jetify-com/typeid is a spec for Stripe-style IDs:
user_01h2xcejqtf2nbrexx3vqjhp41is a snake_case type prefix,_, then a UUIDv7 in 26 chars of Crockford base32 (hex UUIDs take 36). Time-ordered, so B-tree inserts stay local, unlike UUIDv4. Double-click selects the whole ID, and a serializer expectinguser_rejects a pastedpost_ID. Strip the prefix and you get a valid UUIDv7 back, so the database never has to know. Cheap way to adopt: keep the column a native 16-byteuuid(DEFAULT uuidv7()on Postgres 18,uuid.uuid7()on Python 3.14) and encode/decode only at the API edge, e.g. a DRF serializer field on top of typeid-python. If PKs are alreadyuuid, no schema change, and IDs explain themselves in logs and support tickets.Go interfaces are implicit: a type satisfies an interface by having the right…
Go interfaces are implicit: a type satisfies an interface by having the right methods, no
implementskeyword.- Closest Python equivalent is
typing.Protocol(structural subtyping, checked by mypy), but Go enforces it at compile time, not via a separate type checker. - Sharp edge: a nil concrete pointer wrapped in an interface value is not
nil.var dog *Dog = nil; var s Speaker = doggivess != nilbecause the interface holds(*Dog, nil), a typed pair. Bites hardest when returningerrorinterfaces. - Go proverb: “the bigger the interface, the weaker the abstraction.” Keep them to 1-3 methods, define where consumed not where implemented.
- Closest Python equivalent is
Django Modern REST
Django Modern REST seems to be an emerging REST API library with focus on performance, scalability and pluggable serializers. Supporting msgpack, CBV and less of sync_to_async. Might evaluate it against the my current preferred
django-ninja. geminiUIPC and SIPC on blockchain
On blockchain, UIPC (Universal IPC) and SIPC (Secure IPC) are frameworks that allows different network to talk to each other using a standard protocol. While UIPC acts as the universal courier, SIPC acts as the security guard. Together, they create “Internet of Blockchains”. Gemini
- Cosmos IBC & Polkadot - XCM are two industry leading protocols for UIPC
- For the SIPC, Zero-Knowledge Proofs and Rollup architecture also “Trustless bridges” or “Cross-rollup communication” are often more frequently used terms in blockchain literatures.
Designing Data-Intensive Applications
Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems by Martin Kleppmann manages to be both rigorous technical manual and something approaching a philosophical treatise on the nature of truth, consistency, and trust in distributed systems. [Claude][https://claude.ai/chat/0f58f2f6-bd56-41a1-a785-8267afa5a3d1]
- Foundation. He starts by asking the questions “What do we actually want in our data systems”, answers them as - reliability, scalability and maintainability.
- Reliability. The question isn’t whether failure will happen, it will, but the whether the systems can survive them.
- Scalability. It’s not a binary question of whether a system is “scalable” or “not scalable”. Ask - “What happens when specific load parameter increase?”
- Maintainability - most underappreciated of the three, he argues the majority of cost isn’t in initial development but in ongoing maintainence.
- The data model wars - the skill isn’t in choosing the “best” database but in understanding which tradeoffs matter for your specific problem.
- Storage engines. Two major approaches to read & write data from disk, neither is universally better.
- Log-structured storage (like LSM-trees) optimizes for writes, every write is appended and the merged/compacted later.
- Page-oriented storage (like B-trees) optimizes for reads, data is stored in fixed-sized block, which then get updated in-place, more like filing cabinet with each document has a designated slot.
- Instead of asking “how do I build this?” ask “what does it mean for this to work correctly?”
- Foundation. He starts by asking the questions “What do we actually want in our data systems”, answers them as - reliability, scalability and maintainability.
Thoughtworks - Technology Radar vol 33
Notes from Thoughtworks - Technology Radar vol 33
- text-to-sql solutions aren’t working as expected
- pnpm, langGraph, and pydantic recommended for adoption
Inversion of Control
Inversion of Control principle – “Don’t call us, we’ll call you”.
- This design principle is used widely in Web Frameworks, GUI programs, etc in the form of event listeners, dependency injections, callbacks to avoid boilerplate code, resuability and testability.
- Some popular examples are DOM, Flask, NestJS, Angular, etc.
Choose Boring Tech
“Choose Boring Tech” by Dan McKinley
- “The failure mode of boring tech are well-understood”
Django rapid architecture
Notes from “Django rapid architecture”
- Recommends organizing the codebase with interfaces at the top layer followed by readers and “actions”, Finally, ‘data’ as the bottom layer to organize Django codebase to allow for a simple code structure that allows for scaling