Edgex

25.4K posts

Edgex banner
Edgex

Edgex

@SahilExec

Backend engineer and lurker | DSA | CSE'28 | DM for collab

127.0.0.1 Katılım Ekim 2025
525 Takip Edilen4K Takipçiler
Edgex
Edgex@SahilExec·
One default broke production: Everything was safe in staging. Then prod deployed with NODE_ENV missing. What opened?
Edgex tweet media
English
1
1
8
581
Edgex
Edgex@SahilExec·
Would you approve this timeout? API returns faster now. But the provider still receives requests. What bug can this create?
Edgex tweet media
English
5
1
13
1K
Edgex
Edgex@SahilExec·
@avrldotdev Oof, that interview was a trap. I'd shard by hash, run parallel workers with a Bloom filter for quick checks, then merge – should stay under 2 seconds.
English
2
0
1
1.5K
avrl ☘
avrl ☘@avrldotdev·
Expedia rejected coz I couldn't answer this question: How would you design a distributed deduplication engine that ingests multiple lists each with 100k+ items, dedupes them in <2s & returns a single combined list?
English
27
2
139
25.7K
Edgex
Edgex@SahilExec·
@avrldotdev Totally agree people still brag about stars like it’s a badge of honor, but it tells you nothing about real impact.
English
2
0
1
135
avrl ☘
avrl ☘@avrldotdev·
top five vanity metrics that're useless now: > github stars > github activity > lines of code > leetcode/cf rank > tokens burnt per day
English
25
1
59
2.8K
Edgex
Edgex@SahilExec·
A SaaS app limits teams to 5 members. Code checks: How can the team end up with 6 members?
Edgex tweet media
English
8
1
21
1.5K
Edgex
Edgex@SahilExec·
A senior dev sees this API response: Frontend uses only email and plan. Why is this still a backend problem?
Edgex tweet media
English
9
0
23
2.4K
Edgex
Edgex@SahilExec·
Our search API let the frontend set the page size: const limit = parseInt(req.query.limit) || 20; const products = await Product.find().limit(limit); ?limit=500000 froze the database for 40 seconds. What one line was missing?
Edgex tweet media
English
8
1
16
1.3K
Edgex
Edgex@SahilExec·
Our invite links are generated like this: const inviteCode = Math.random().toString(36).slice(2); Why is Math.random() a bad choice here, and what should generate tokens instead?
Edgex tweet media
English
8
1
27
4.9K
Edgex
Edgex@SahilExec·
Users on slow connections started appearing in our database twice. The button wasn't disabled. The table had no unique constraint on email. Two clicks, two accounts, same person. Which fix actually closes this, the frontend one or the database one?
Edgex tweet media
English
8
1
12
1K
Edgex retweetledi
avrl ☘
avrl ☘@avrldotdev·
How do you maintain agreeability between separate servers spread across network? The answer is consensus algorithm with leader follower relationship. My last project "graft" was written to understand these things. The architecture was to have 3 nodes running with Raft & have a gateway service which forwards request to the leader of the cluster from the client. To deploy and manage all of this, I used kubernetes statefulset for the raft cluster (the 3 nodes) and a gateway deployment with a headless service alongside it. Each raft node has a postgres instance to act as a state machine (KV & metadata) with a dedicated persistent volume to store the append-only log to store the commands. The gateway service is leader aware, before any request is made, it fetches the current state of the raft cluster, updates itself and then send the request. The other way couldve been that gateway would send to the peer node it think is the leader, but if it isn't, the peer would forward the request to the leader internally & the response to the gateway contains the new leader metadata & it would update it. I went with the first approach to keep things separate & simpler. But I believe the second approach scales better. I also made every request idempotent, each req has a reqID & stored in an appliedreqid table in postgres. If you keep sending the same reqID with different requests, the leader will just return 200 OK with a no-op. This keeps things from overwriting or double-applying when there's an inconsistency or client retries on a failure, realised this was important when i weote my harness. So the harness is pretty simple, i port forwarded each node & gateway, ran different scenarios on it & asserted the expected behaviour. Some scenarios were to write multiple times with same reqid & confirm only the first req was applied. Write to a leader & kill it, then see if the followers replicated the write or not, etc. You can think of many others. I am documenting all of this in the github readme (its outdate rn), ao you can understand what I did, and can file an issue if you think I made a mistake too :) Hope this helps!
avrl ☘ tweet media
English
9
5
41
1.3K
Edgex
Edgex@SahilExec·
Our auth cookie was set like this for years: HttpOnly. Secure. Looked airtight in every checklistwe followed. One attribute was missing that let a malicious site trigger authenticated requests on a user's behalf. What was it?
Edgex tweet media
English
10
1
30
3K
Edgex
Edgex@SahilExec·
Would you merge this? It makes signup flexible. What can go wrong?
Edgex tweet media
English
2
1
17
2.3K