Meta / Facebook - How a graph model can scale your relational DBs
2022-10-19 · programming, distributed
Did you know that still, to this day, the majority of Meta's data needs are serviced by MySQL? There is a caching layer atop it (called TAO) that services all queries, sending requests to MySQL only on a cache miss but what enabled TAO and MySQL to scale…
Do LWW Registers Need Vector Clocks or Causal Graphs? 💭
2022-10-18 · programming, distributed
Short answer: No. When it comes to a LWW register, Lamport clocks offer all the guarantees we need. Guarantees provided by other clock types are discarded during the merge phase of LWW. A last write wins register is a register where the "last" write…
Lamport Clock 🕥
2022-10-18 · programming, distributed
The Lamport clock was originally described in 1978 in the paper "Time, Clocks, and the Ordering of Events in a Distributed System". It is a logical clock that was created as a way to order events in a distributed system. Why not use wall/physical clocks?…
Why SQLite? Why Now? 🐇
2022-08-23 · programming, edge
I've been sucked down a sqlite rabbithole and I'm all-in on it. So why SQLite? And why now?
For me, its about re-architecting how we write code so it can fit the coming world of edge, distributed and local-first computing.
In one way, sqlite is a great…
You'll always have a body
2022-06-16 · pontification
Prompted after reading https://www.physics.princeton.edu/ph115/LQ.pdf and https://www.quantamagazine.org/how-to-make-the-universe-think-for-us-20220531/ Sorry to break the news but even when you figure out how to upload your consciousness to a computer,…
📚 Not Machine Readable?
2022-06-06 · software-engineering
Was watching https://www.youtube.com/watch?v=AHblHPLoKKE&t=139s and this dawned on me. When we say "something isn't machine readable" we're not speaking accurately. What we really mean is that the content is not readable for the way that programmers…
🧶 HTML, CSS & JS. All mixed up together. This time it's different.
2022-06-02 · software-engineering
From time to time I run across people decrying the current state of web development with words like: We've gone completely backwards! We've gone from separating our structure, style and logic to putting them all into the same file! inline styles! inline…
📝 Query Planning
2022-05-26 · software-engineering, aphrodite
Previously we discussed the query builder. To recap, when a user interacts with the query builder a linked list of queries is built up behind the scenes. Eaech query in the list holds a reference to the prior query and an expression to apply. When…
💨 Query Plan Optimization
2022-05-26 · software-engineering, aphrodite
This is the third part in a deep dive into Aphrodite's query layer. Part 1 we talked about the query builderPart 2 covered query plans
Now we'll cover how we optimize query plans.
One of the first questions might be why an ORM needs to do query…
⛓ Query Builder
2022-05-26 · software-engineering, aphrodite
Aphrodite generates rich and type safe query builders (example) from your schemas. The query builders not only query for nodes of a given type but also traverse edges, apply filters, do pagination and more. As an example, we can traverse from a user to…
🪨 Chunk Iterable
2022-05-26 · software-engineering, aphrodite
Today I'll be discussing the Chunk Iterable Framework. This is a core component of Aphrodite and is used to speed up the processing of data returned by queries. The main idea behind a chunk iterable is to be able to iterate over some source of data in…
2022-05-13-mocha-script.html
2022-05-13 ·
Somehow I ended up graduating my undergraduate program without ever taking a compilers course. Seems like a sin.
In any case, I had the burning desire to understand compilers and interpreters more so circa 2013 (where "js…
📀 Large Local Storage
2022-05-13 · software-engineering, project
Way way back in 2013 there wasn't a common way to save large blobs in all browser. Back then, all of these were true: DOMStorage only gives you 5mbChrome doesn't let you store blobs in IndexedDBSafari doesn't support IndexedDB,IE and Firefox both…
🧶 Skipping the Bundling
2022-05-12 · software-engineering
We're in the era of ES6 modules, esm.sh and Typescript. Do you really need to spin up that webpack/snowpack/rollup/vite/parcel/insert other bundler here for your small scale project?
I think not. These days, module management is built right into the…
😌 Simple MDX
2022-05-12 · software-engineering
tldr; skip to full sample code So you want to deploy a site that uses MDX? Outside of using Nextjs, this process is much more difficult than it aught to be.
Technically we don't even need to mess with mdx-bundler (see Building Without Bundling). Going…
🧟♂️ Memes & Themes - 1619 Project
2022-04-25 · politics
Coincidentally I came across all of these three things below around the same time A product of the cultural climateBeing guided by something higher to fulfill a purposeRandom chance / coincidenceSelf-filtering by one's own current frame of mind…
🧚♂️ Past, Present, Future - Doing for Others
2022-04-25 · philosophy, religion
Our current state of affairs is almost entirely determined by those who came before us. What institutions they created, what they've invented, what infrastructure & dwellings they've built, how they've spent the resources of the society, how they've…
📦 Your One Package Might Be Two
2022-04-07 · software-engineering
When creating a software package (or module or bundle, pick your term) for others to reuse, there's often a second package in the package that developers overlook. The second package is the interface package. I.e., the interface that overlays the…
🌅 Expressing Early Fetches - React
2022-01-17 · software-engineering, react
draft post-- Fetching early is difficult to express and get right in all places in React.
This is because a lack of domain models. That everything is anemic. That we've moved business logic into display.
Render-as-you-fetch rather than fetch-before-render…
🧶 Improving Code Sharing with Yarn Workspaces
2022-01-09 · software-engineering, sharing-code
Sharing code between JavaScript & TypeScript projects has always been more trouble than it should be. Say you create a common library and you want to use it in N > 1 of your other projects.
You could publish it to NPM and install it like any other…
🌈 Understanding Color by Writing a Color Picker
2021-12-28 · software-engineering, demo
"Programmers re-invent the wheel so they can understand how the wheel works" - unknown Why write a color picker from scratch? To understand color theory better and to realize that color pickers are actually pretty simplistic.
To understand how to…
👨💻 URLs As Display Data
2021-12-27 · software-engineering, framework
I've been toying with the idea that we get something wrong when it comes to URL management and routing in single page applications (SPAs). The current state of the art in SPAs is to let the URL (the route) drive application logic. We do this by binding UI…
👀 Vision
2021-12-27 · vision
After ~8 years working at Meta and ~15 years professionally programming post college, I'm departing the workforce to puruse my own ideas full time. Vision 1
Create software to help people think more deeply.
Creating assisted memory thru contextualized…
👀 Observability Driven Development
2021-12-27 · software-engineering odd
One of the things I learned quickly while working on large scale systems at Facebook (Meta) was that if your tests passed but you didn't observe your system in production, you had no idea whether or not your system was actually behaving as intended…
☢️ Reacting Better - Deeply Nested Update Problem
2021-12-23 · software-engineering, react, framework
Something irks me about React. It's how inefficiently it handles deeply nested updates. React apps, like any app, will have a display hierarchy of deeply nested components. The root component being the entrypoint of the app, the leaves being the…
🧮 No, Mathematical Government is not a Logical Government
2021-12-20 · pontification
Listening to Freakonomics s11e16 there was some commentary about "if the world was run by mathematicians it'd be so logical." What an absurd statement.
I'll just focus on two ways this is wrong. The first is that mathematics is irrational through omission…
👐 American Spirit
2021-12-20 · pontification
Note -- I just finished reading "Beyond Good and Evil" and was curious what something of that nature would read like if Nietzsche wrote it today. Below is that reproduction of that (me channeling my conception of Nietzsche) and not an expression of my…
⛵️ Reference Equality - What is it Really?
2021-12-17 · software-engineering, framework
In programming we're met with things that are completely new. Even though they're new, they're familiar enough to grasp with existing concepts. This converting the new to something familiar helps us to understand things at one level but if the familiar…
🧬 Missing Mutation Primitives
2021-12-16 · software-engineering, framework
I’ve been developing apps for the past ~8 years that use immutable data models. For the ~7 years prior to that, using a combination of mutable, immutable and lock-free data structures. Immutable models solve endless numbers of problems but what I realized…
Reacting Better. Intro: Anemic Models
2021-12-15 · software-engineering, react
React eschews models that have any attached functionality. The “model” for a react app is usually anemic — just a bare set of properties with no methods attached. type Slide = {
selected: boolean;
embeds: Embed[];
text: string;
};
type Embed…
Understanding Generics
2021-08-22 · software-engineering
function identity(x: T): T; What is the essence of a generic?
Generics are for the caller rather than for what is being called. They allow the caller to retain type information. To retain information about types given to what is called.
Example…
What if Religion is last?
2021-04-05 · pontification
The popular view of religion is as being the first development of a civilization. The thing that predates a people before they discover reason & science. What if we thought of it instead as the culmination of a civilation? A civilization's peak product…
Nicolas Cage is Creating a new Movie Genre
2021-03-01 · entertainment
Not many people realize this but Nicolas Cage is slowly but surely carving out and defining a whole new genre of trippy and artistic horror movies. Is he doing this intentionally or acidentally? One word to describe it? Purple.
Pi Cloud
2021-02-14 · production-engineering
With services like Herkou, AWS, Azure and Google Cloud, creating and managing your own cloud architecture may be a dying art. Some might accuse me of showing my age, like professors of old who swore that their students must learn C and how to alloc & free…
The Shortest, Framework Free, TODO App
2021-02-12 · software-engineering, demo
A TodoMVC App in ~200 lines of plain JavaScript and 0 dependencies. Source:
const tempEl = document.createElement('div');
const sanitize = (value) => {
if (value) {
if (typeof value === 'object' && value.__html__) {
return value.__html__;…
Reactive Markdown
2021-02-08 · software-engineering, demo
Many of my blog posts contain interactive demos or content that is generated via JavaScript. The prose of my posts, however, is written in Markdown. Shuttling data back and forth from the Markdown side to the JS side can be annoying, especially when…
Volatility isn't Risk
2021-02-07 · finance, math
The biggest lie in investing is that volatiliy = risk. This is bogus. It misses the point of risk. Risk is about the chance of losing your principal in an investment. Volatility does not capture that whatsoever. What does it matter if the price of an…
Regression to the Mean & the Gambler's Fallacy - Simulated
2021-01-26 · math, demo
Jump to the simulation There are two seemingly contradictory findings in statistics which apply to independent events:
Regression to the MeanThe Gambler's Fallacy
Regression to the mean is defined as:
The phenomenon that arises if a sample point of…
Understanding False Positive Rate
2021-01-21 · math, demo
Jump to the simulation Throughout the Coronavirus pandemic, the most distressing thing has been the cherry picking of statistics.
Things have gotten better. Cases, deaths, and hospitalizations are often reported per 100k, rather than being without…
Filter, Map, etc. vs For Each & While
2020-09-13 · software-engineering
I've run into the occasional programmer that finds the functional way of transforming collections (map, filter, reduce, zip, pull, etc.) harder to understand than the imperative style of for, while and for-each loops. I.e.,
const results = numbers.map…
All Things are Permitted
2020-06-29 · pontification
Its been said that "if there is no God then all things are permitted." Well, that's why we have laws. Precisely because all things are permitted (by nature). Murder, adultery, theft, war, etc. All of these things happen and are able to happen and, being…
Non Conceptual Definitions
2020-05-25 · pontification
Philopsophers often question what is "art" or "love" or other words for humanity has never had a solid definition. The quest to finding a general principle which can define these words is always admirable and bears much fruit (e.g., reading Heidegger's…
These are not types
2020-05-19 · software-engineering
Is an int a type? A float? A double? These are storage types, not application level types.
For many software projects, int, float, double, string, etc. exist at the wrong level of abstraction to be conidered proper data types. They represent how…
Dangerous. Ideas.
2020-05-17 · pontification
"A little bit of knowledge is a dangerous thing" How do yo interpret that?
Does that mean knowledge is power and even with a little bit one can become a dangerous advesary?Or does it mean if you only know a little, rather than a lot, you are putting…
I am. You are?
2020-05-17 · pontification
When we describe how we're feeling we say "I am angry", "I am upset", "I am X" But you aren't angry nor upset. You are feeling angry or upset. Describing emotions the way we currently do is incorrect in that it equates and identifies our state of being…
Typed Literals ARE Constants!
2018-10-23 · software-engineering
(option 1) display.setLayout(Layouts.FIXED); (option 2) display.setLayout('FIXED');
I keep getting push-back that the first line is better practice than the second line. When reviewers see something that looks like the second line they say “define that…
Practical Laziness in Programming
2014-01-03 · software-engineering
When I first heard about lazy evaluation I thought it was cool but not of much practical use. That is until I thought about it a bit harder. Laziness improves API design.
I’ll illustrate with a program I wrote to convert Javadoc comments to JSON. I…
The Almighty Function
2014-01-01 · software-engineering
Objects are a poor man’s closures. Closures are a poor man’s objects. Some people say everything is an object. I used to too but these days I think everything is actually a function.
A map? Isn’t that just a function that maps from one value to another…
Oh Lisp
2013-08-15 · software-engineering
If you ever tell someone you like Lisp and that Lisp is a more suitable language for the work you are doing most of the time you’ll get weird looks and comments like: “Isn’t that… old?”
“All I know is that it has parenthesis everywhere.”
“Is that like…
Inheritance, Aggregation, and Pipelines
2013-07-30 · software-engineering
How does one write software that can be extended? I think many developer’s first instinct is to set up some form of inheritance hierarchy. Inheritance is a step in the right direction but it is very restrictive. The problem with inheritance is that…
Services and Coupling
2013-06-28 · software-engineering
Lines of code like: PositionCalculator calc = new MercatorPositionCalculator();
(where PositionCalculator is an interface and MercatorPositionCalculator the implementation) have always bugged me and probably any other astute programmer out there.
We’re…