---
title: "Parsa Aftabi (@parsaaftabi) | Hashnode"
description: "I do computers, all the way down. Go and C++. I build small tools and write about how systems fail. Read the latest articles by Parsa Aftabi on Hashnode."
url: "https://hashnode.com/@parsaaftabi"
---

@parsaaftabi

# Parsa Aftabi

@parsaaftabi · Joined October 2026

I do computers, all the way down. Go and C++. I build small tools and write about how systems fail.

[Website](https://dev.to/parsaaftabi)

## Comments

[I would add a short Redis cache of recent messages per conversation for resync. When many clients reconnect at once, serving those recent messages from Redis instead of MySQL avoids a spike on the database, and MySQL still covers older gaps.](https://hashnode.com/posts/system-design-drill-day-15-real-time-chat-and-live-order-tracking/6af182ac97c64d348b044f28/comment/6af1eb783fc61c9cdfaece5e)

Comment · Article · Nov 9 · [System Design Drill Day 15: Real-Time Chat and Live Order Tracking](https://hashnode.com/posts/system-design-drill-day-15-real-time-chat-and-live-order-tracking/6af182ac97c64d348b044f28)

[good point on extended statistics — that's the exact spot where the planner's independence assumption falls apart. should've given it its own section.](https://hashnode.com/posts/postgresql-explain-analyze-what-i-actually-look-at-in-query-plans/6ad2bf0da305ffe66918c506/comment/6ad31e778c8e8c2df5b9ec26#reply-6ad326937c50be855a189a35)

Reply · Article · Oct 17 · [PostgreSQL EXPLAIN ANALYZE: What I Actually Look At in Query Plans](https://hashnode.com/posts/postgresql-explain-analyze-what-i-actually-look-at-in-query-plans/6ad2bf0da305ffe66918c506)

[anytime. when you get to the redis bucket, the refill side is where it gets interesting. happy to look at your sketch.](https://hashnode.com/posts/one-window-n-requests-building-a-rate-limiter-from-scratch-in-go/6ac69aa870f3f5d264eaee1c/comment/6ac96474954062902cbd3110#reply-6ad17b050bf62d3523e37f26)

Reply · Article · Oct 16 · [One Window, N Requests: Building a Rate Limiter from Scratch in Go](https://hashnode.com/posts/one-window-n-requests-building-a-rate-limiter-from-scratch-in-go/6ac69aa870f3f5d264eaee1c)

[Glad it landed. And good confirmation on the otel requirement cycle. Exactly the kind that slips past you in a monorepo, since Go won't stop you from building one.](https://hashnode.com/posts/finding-cycles-and-hidden-dependencies-in-go-mod-graph/6ac78c67ebf43b6f18027dbb/comment/6ac96489954062902cbd31ed#reply-6aca298e19d143c3fef8e78f)

Reply · Article · Oct 10 · [Finding cycles and hidden dependencies in go mod graph](https://hashnode.com/posts/finding-cycles-and-hidden-dependencies-in-go-mod-graph/6ac78c67ebf43b6f18027dbb)

[Appreciate the careful read, Hamed. You're right on lesson 5. An unexported struct type as the context key is the right call over a plain string, and the staticcheck warning is a good reminder. I'll tighten that section. And the ReadHeaderTimeout suggestion is a genuinely good addition. Most handlers think about request timeouts but forget slowloris-style clients can tie up the listener before a request ever forms. I'll add a lesson on server timeouts.](https://hashnode.com/posts/7-lessons-i-learned-building-production-apis-in-go/6ac96753d8fd56894cb40ba6/comment/6aca137163ebfab1e9507885#reply-6aca298119d143c3fef8e715)

Reply · Article · Oct 10 · 1 · [7 Lessons I Learned Building Production APIs in Go](https://hashnode.com/posts/7-lessons-i-learned-building-production-apis-in-go/6ac96753d8fd56894cb40ba6)

[Good explainer. The operational side I'd add: set autovacuum\_vacuum\_scale\_factor (and threshold) per-table for your hottest tables instead of relying on the global defaults. Defaults are tuned for average workloads, not hundreds of millions of rows. Two other classics. Fillfactor below 100 on heavily-updated tables is what makes HOT updates possible in the first place (no free space, no HOT). And a single long-running transaction can block vacuum for the whole table. pg\_stat\_activity is the first place I look when n\_dead\_tup keeps climbing.](https://hashnode.com/posts/postgresql-mvcc-autovacuum-starvation-hot-update-breakdown/6ac9098d28e52327ada92fbb/comment/6ac964984f787159f5dfe265)

Comment · Article · Oct 9 · [PostgreSQL MVCC Autovacuum Starvation: HOT Update Breakdown & Table Bloat under Heavy Write Loads](https://hashnode.com/posts/postgresql-mvcc-autovacuum-starvation-hot-update-breakdown/6ac9098d28e52327ada92fbb)

[Strong post. RLS is the right answer for exactly the reason you give. A few production gotchas from my side. RLS doesn't apply to table owners or superusers, so the app role must not own the tables, and watch out for BYPASSRLS. The tenant context (e.g. SET app.current\_tenant) has to be reset per checkout when you're behind PgBouncer. A leaked tenant setting is a data leak. And policy expressions run on every row, so keep them sargable and index-friendly on large tables or RLS becomes a performance tax. Miss any of those and the enforcement story quietly breaks.](https://hashnode.com/posts/postgres-row-level-security-for-multi-tenant-saas-a-setup-that-holds-up/6ac9181e52c978b433ae915b/comment/6ac96491954062902cbd322c)

Comment · Article · Oct 9 · [Postgres row-level security for multi-tenant SaaS: a setup that holds up](https://hashnode.com/posts/postgres-row-level-security-for-multi-tenant-saas-a-setup-that-holds-up/6ac9181e52c978b433ae915b)

[Useful walkthrough. One sharpening: pair go mod graph with go mod why <module>. The graph shows you the edges, why tells you which of your imports actually pulls a module in, which is what you need when deciding what to cut. Also worth noting for readers: since Go 1.17 module graph pruning, the graph is shallower than it used to be. And a "cycle" in require directives is a version-selection quirk. True import cycles are still rejected by the compiler.](https://hashnode.com/posts/finding-cycles-and-hidden-dependencies-in-go-mod-graph/6ac78c67ebf43b6f18027dbb/comment/6ac96489954062902cbd31ed)

Comment · Article · Oct 9 · [Finding cycles and hidden dependencies in go mod graph](https://hashnode.com/posts/finding-cycles-and-hidden-dependencies-in-go-mod-graph/6ac78c67ebf43b6f18027dbb)

[Great framing. "what correct means" is exactly the hard part. The mechanisms I'd want to see named. Idempotency keys on every transfer, so retries never double-move money. An immutable double-entry ledger: never update balances in place, balances are a derived projection over the entry log. Debit/credit pairs inside a single DB transaction with proper isolation. And settlement retries keyed off the transfer record's state machine, not blind re-submission. Get those right and most "ghost money" bugs disappear.](https://hashnode.com/posts/building-a-financially-correct-wallet-and-settlement-system-in-go/6ac38c9a1660a1707daf5671/comment/6ac964834f787159f5dfe22d)

Comment · Article · Oct 9 · [Building a Financially Correct Wallet and Settlement System in Go](https://hashnode.com/posts/building-a-financially-correct-wallet-and-settlement-system-in-go/6ac38c9a1660a1707daf5671)

[The sharpest question in this thread is how much of the 65% is the language vs the rewrite itself. A useful way to decompose it: language effects (binary size, idle memory footprint, GC pause profile, goroutine-per-connection vs worker processes) vs architectural effects (connection pooling, added caching, fewer instances from better utilization). The honest test is measuring the same architecture in both languages, which rewrites never do. In my experience the instance-count reduction, running fewer, smaller containers, usually dominates the savings.](https://hashnode.com/posts/python-vs-go-for-backend-services-65-lower-cloud-costs-one-rewrite/6ac313a955b5330fbb697b88/comment/6ac9647d4f787159f5dfe21f)

Comment · Article · Oct 9 · [Python vs. Go for Backend Services: 65% Lower Cloud Costs, One Rewrite](https://hashnode.com/posts/python-vs-go-for-backend-services-65-lower-cloud-costs-one-rewrite/6ac313a955b5330fbb697b88)
