
Moved to @cynici@fosstodon.org
South Africa
Joined April 2019
- Tweets1.8K
- Following682
- Followers32
- Likes1.3K
Pinned Tweet
"Chesterton's fence is the principle that reforms should not be made until the reasoning behind the existing state of affairs is understood."
petewarden.com/2020/01/01/ch… via @wordpressdotcom
2
cheewai retweeted
I'm in love with this quote.
“Nothing is a coincidence. Every soul you meet is written in your destiny to teach you, to heal you, or to love you.”
cheewai retweeted
What Changes When You Upgrade from PostgreSQL 18 to 19
↳ Faster foreign-key checks on bulk inserts
↳ Native REPACK (CONCURRENTLY)
↳ ON CONFLICT DO SELECT returns the existing row
↳ WAIT FOR LSN lets a replica catch up before a read
rishigoomar.com/postgresql-1…
cheewai retweeted
There is a beautiful piece of mathematics hiding behind every classical machine learning algorithm.
Take linear regression. In ordinary least squares, learning means finding the parameters that minimize the sum of squared prediction errors. A statistical estimation problem becomes a mathematical optimization problem.
K-Nearest Neighbors approaches classification through geometry. Find the closest observations to a new point and predict its class using their labels.
Support Vector Machines bring in another geometric idea. Find a separating hyperplane with a large margin, balancing margin size against violations in the soft-margin formulation.
Decision Trees repeatedly partition the feature space using decision rules. Random Forests extend this idea by training multiple randomized trees and aggregating their predictions.
Gradient Boosting takes a sequential approach. Each new learner approximates the negative gradient of the loss. Under squared-error loss, this corresponds to fitting the residuals of the current model.
K-Means approaches clustering through distance. Assign each point to its nearest centroid, recompute the centroids as cluster means, and repeat.
Gaussian Mixture Models approach clustering through probability. Instead of relying on hard assignments, they can estimate the probability that an observation belongs to each Gaussian component.
Geometry, linear algebra, probability, statistics, optimization.
We spend years learning these subjects separately, only to discover how beautifully they come together in machine learning.
cheewai retweeted
Postgres mistakes we still make
pgcraftsman.github.io/talks/…
cheewai retweeted
At least 50% of Anthropic revenue is Claude getting zsh word-splitting syntax wrong
Two copies of the same supplier invoice come in 40 seconds apart (e.g. one by email, one via portal)
→ they get processed by two workers of the AP agent
→ both check if they already paid
→ the answer for both is "no"
→ we paid the supplier twice, now we have to chase the supplier for a refund
With recently released PG19 you can do:
INSERT INTO invoices (...) VALUES (...) ON CONFLICT (supplier_id, invoice_no) DO SELECT RETURNING worker_id = $ME AS first, amount = $amount AS same_amount
→ the second worker gets the first one's row back
→ compare the amount with RETURNING
→ if it's the same, do nothing
→ if it's different, send it to a human, since someone changed the invoice in the meantime
Shoutout to Max Demoulin of the @DBOS_Inc team, who often sprinkles my LinkedIn feed with really cool pieces on PG (and DBs in general).
Inspiratiob today: "Two requests arrive with the same idempotency key. The first inserts the order. What does the second one get back? Until Postgres 19, released today: nothing."
I've been thinking of more use cases like this and will add them in the comments below. Please share yours!
Original post: linkedin.com/feed/update/urn…
A Buddhist monk asked his students - If you're carrying a cup of coffee and someone bumps into you, why did you spill the coffee?
Each and every one of his students said because someone bumped into me.
No, he said, the reason why you spilled the coffee is because that's what you were carrying in your cup. If you were carrying water, you would have spilled water.
Then he said something profound.
Whenever life shakes you, whatever you're carrying is going to spill out. So if you're carrying fear, jealousy, anger, greed, that's what's going to spill out.
But if you're carrying love, compassion, kindness, that's what's going to spill out.
So, each and every day, you should pause and think to yourself, What am I carrying in my cup today?
cheewai retweeted
Getting lost in the shuffle because you're not on the coolest, most highly-visible engineering projects?
Here's advice from @AntonZaides on what to do about it.
manager.dev/newsletter/invis…
cheewai retweeted
i came across a quote that said,
“Just because I don't require much doesn't mean I deserve the bare minimum.”
And that hit different.
cheewai retweeted
🐘 PostgreSQL 19!
Here are the biggest changes developers should know about.
→ Faster INSERTs
→ Better query performance
→ Less overhead
→ New features and improvements
Let's explore what's new in PostgreSQL 19 🚀
cheewai retweeted
Probabilistic data structures: Bloom filter
A Bloom filter is a set that trades certainty for space. It can tell you that an item is definitely not in the set, or that it probably is (which might be a false positive). The filter doesn't actually store the items, so it's much more compact than a regular set.
For example, a regular set with 1,000,000 distinct 8-byte strings takes about 64 MB. A Bloom filter for the same strings, with a 1% false positive rate, uses only 1.24 MB (about 10 bits per item) — that's 50 times smaller. The size of the filter doesn't depend on the item size, so the difference gets even bigger with longer strings.
A Bloom filter often resides in memory and helps minimize expensive I/O operations such as disk reads or network calls. You check if an item is in the filter, and if the answer is "no", you skip the costly lookup. If the answer is "yes", you still have to perform the lookup because it might be a false positive.
github.com/nalgeon/unsure/tr…
cheewai retweeted
Nobody reviews a big diff. They just decide how much they trust the author, then punt it.
cheewai retweeted
Mom reveals strategy to encourage her son to help with household chores:
"Here's our deal: he helps me and he can skip school on Saturdays and Sundays"
cheewai retweeted
One of the fastest ways to size up an engineer is to listen to the first question they ask about a new service.
Junior engineers ask “which database?”
Senior engineers ask “how does the data move?”
Architects ask “what happens when it breaks?”
Anyway… A few months back, an engineer on a team I was advising dropped this in the design review channel:
“Should we use Postgres or Mongo for the new service?”
He’s one of the sharpest coders I know, and that made it worse.
I’m a patient guy. I’ve answered this question more times than I can count. But this was the third service in a row where the team picked a database before anyone wrote down a single read or write.
It was also the third time they’d end up bolting on a cache, a read replica, and a migration plan six months later.
This isn’t 2006. The year is 2026. Managed Postgres exists. DynamoDB exists. Spanner exists. Cassandra, ClickHouse, Redis, all one API call away.
Choosing an engine is the easy part. Anyone who starts there skips the hard part.
OK, I’ll stop ranting and get to the question he really wanted to ask:
“How do I pick a database I won’t regret in a year?”
At a high level, every database choice comes down to two things.
First, the workload. How does your service read and write data? What’s the read-to-write ratio at peak? Key lookups, range scans, or joins? How much staleness can you tolerate? One region or many?
Second, the team. What can your on-call engineer actually run at 3 a.m.? When nobody has operated the “better” database, it becomes the riskier one.
Everything after that is picking the engine that fits.
Here’s how each workload answer changes the outcome:
Write-heavy → log-structured storage beats B-tree indexes
Range scans → an ordered key store beats a hash-partitioned one
Strong consistency → single-leader with synchronous replication, or consensus
Multi-region writes → conflict resolution becomes your design problem
High staleness tolerance → a cache absorbs the load, and the primary choice matters less
Next time someone asks “Postgres or Mongo?”…
Don’t answer.
Ask them how the data moves.
The simple rule I follow always is: Workload first. Engine second.
cheewai retweeted
Signs you should read a blog:
1) it's written by Shlomi
2) it's about failovers
3) it's about Postgres
I present to you, all three:
planetscale.com/blog/designi…
cheewai retweeted
pg_dump + pg_restore finished. Exit code 0. Row counts match.
Your database is not ready yet.
One query, 250M rows, Postgres 18.6, cold cache:
→ right after pg_restore: 32.6 s
→ after ANALYZE: 6.1 s
→ after VACUUM ANALYZE: 23 ms 💥
Same data. ~1,400× faster.
A logical dump does not carry the visibility map, and by default not the planner statistics.
25 of 28 migration guides we checked don't say to run VACUUM after the load.
Before traffic:
vacuumdb --analyze --jobs 4
then ANALYZE each partitioned parent
All tests are reproducible, and the scripts are in the post (bonus: podcast episode) 👇
cheewai retweeted
En #Chine 🇨🇳 ancienne, la sécurité des contrats reposait sur la déchirure du papier : les fibres et le sceau apposé à cheval créaient une clé unique. S'emboîter se dit 合同 (contrat), l'ancêtre physique de la double authentification. RT @AmbXieFeng



























