Kwok (@kodemojo) header
Kwok (@kodemojo) profile picture

Senior engineer and AI enthusiast. I mentor developers to build, ship, and operate production-grade systems.

Joined March 2024
Photo by Kwok (@kodemojo)Photo by Kwok (@kodemojo)Photo by Kwok (@kodemojo)Photo by Kwok (@kodemojo)
I'm a senior engineer building apps in public. I document the engineering patterns that actually work. Follow me if you want: 👇 ⚙️ Better backend skills 🤖 Smarter AI powered development 🏗️ Scalable architecture habits 🚀 Guidance for busy developers who want to ship
13
1
71
2,108
Do you want to think like a senior backend engineer? Start by understanding what happens when connections run out. - Borrow late. - Release early. - Keep transactions short. - Watch waiting requests. - Investigate before increasing pool size. Connections are shared, they are not unlimited.
2
63
7 secrets management rules every senior developer should follow: 1. Never commit credentials. 2. Never share production passwords in chat. 3. Restrict permissions by default. 4. Separate environment credentials. 5. Prefer short-lived tokens. 6. Automate exposure detection. 7. Assign every secret an owner. Security is built through repeated small decisions.
1
2
41
Do you want to think like a senior backend engineer? Start by understanding what happens when connections run out. - Reuse existing connections. - Understand pool limits. - Keep connection usage short. - Prevent connection leaks. - Configure sensible timeouts. - Monitor waiting operations. A fast query means nothing if it spends seconds waiting for a connection. You have to learn to manage resources, not just write queries.
2
36
TTL looked simple on the whiteboard. Production had other plans. A five-minute cache seemed reasonable. Then prices went stale. Cache entries expired together. Database traffic spiked. Sessions expired mid-checkout. A few lessons: - Base TTL on business rules. - Add jitter to cache expiration. - Coordinate cache refreshes. - Separate expiration from deletion. - Set absolute session lifetimes. - Test expiry scenarios. Setting a timer is easy. Engineering starts when it expires.
1
2
104
You said "My code is thread-safe because all my tests pass." You demonstrated that your code works under the conditions you tested. The production is different. Can two threads overwrite each other's changes? Can a different execution order violate a business rule? Can separate operations interfere? Those are the questions worth answering.
3
157
A healthy engineering team is one where junior developers are more afraid of shipping an incorrect assumption than asking a question.
1
1
55
Making authorization explicit takes effort. Reviewing access rules takes effort. Testing denied operations takes effort. But explaining why one customer could access another customer's financial records takes far more effort. Choose when to spend your engineering time. Before the security incident or after it.
1
41
You don't need more consumers just because consumer lag is increasing. You need to understand: - Partition distribution - Event processing time - Downstream limits - Rebalancing frequency Adding workers is easy. Architecture is knowing whether they will actually help.
2
56
5 reasons slow queries are often design problems: - Data models determine query complexity. - Access patterns determine useful indexes. - Business requirements determine workload. - Service boundaries determine network calls. - Consistency requirements determine caching options. Before tuning SQL, check first the architecture. A faster query isn't always the best answer.
3
91
Microservices aren't always the next step. Start with a modular monolith. One application. One deployment. Separate Orders, Inventory, and Payments by responsibility. Give each module clear rules and interfaces. Split into services when there is a real need. Good boundaries beat more services.
1
25
New to enterprise apps? Learn these 6 boot checks: 1. Entry point 2. Required config 3. Dependency creation 4. External connections 5. Readiness checks 6. Shutdown hooks You don't have to master the whole codebase. Just learn how it comes alive.
1
68
Your DB connection pool is full. Don't blindly increase the size. Check 5 things first: 1. Active vs. idle connections 2. Requests waiting for a connection 3. Connection acquisition time 4. Slow queries and long transactions 5. Total connections across all instances A bigger pool doesn't fix a connection leak. It just gives the leak more room to grow.
1
4
105
Feature toggles make releases safer. Until nobody knows which version of production is running. 3 toggles = 8 possible combinations. 10 toggles = 1,024. Every toggle adds complexity: - More test cases. - More environment differences. - More dead code. - More debugging. - More forgotten decisions. Give every toggle an owner, a purpose, and an expiry date. Feature toggles should control releases, not create permanent complexity.
2
75
Bad code doesn't cost the team only once. It charges everyone who touches it. The new hire trying to understand it. The on-call engineer debugging it. The next developer changing it. Save just 10 minutes across 20 reads a month. 20 x 12 x 10 = 2400 mins That's equivalent to 40 hours a year. You write code once. Your team reads it hundreds of times. Always make it readable.
3
41
4 stats that should make every engineering team audit their alerts: - 77% receive 10+ alerts a day. - 57% say fewer than 30% are actionable. - 83% admit alerts sometimes get ignored. - 44% link incidents to ignored alerts. That's from a 2026 survey. Too many alerts create noise. Noise creates fatigue. Fatigue creates missed incidents. Your monitoring shouldn't train engineers to ignore production fires.
3
144
Some shortcuts doesn't save time. They borrow it from every future feature. Copy a discount rule to ship faster. Months later, that same rule is scattered across checkout, billing, refunds, and support. Now one small change means touching 4 places. And let's hope you don't get a fifth. Technical debt doesn't always hit you all at once. Sometimes it sends a bill with every feature.
1
3
43
What is the fastest cache we shipped? No cache. Our status endpoint was loading entire event histories to return one row. We fixed the SQL. Latency dropped. No Redis. No TTL. No invalidation. No extra infrastructure. Sometimes the best optimization is to fix the query, not to add another component.
3
3
124
Threat modeling is not about listing attacks. It is about closing real security gaps. Pick a workflow. Password reset. Find the trust boundaries. Think like an attacker. Prioritize real risks. Assign owners. Write tests. Fix gaps. If nothing changes, you didn't model threats. You documented them.
3
5
80
5 signs you are extracting too early: 1. Only two callers exist. 2. Their rules change separately. 3. The helper needs a mode flag. 4. Most parameters are optional. 5. Fixing one caller risks breaking another. Sometimes duplication is cheaper than the wrong dependency.
2
6
35
Enterprise maturity isn't about the latest tech stack. It's about control. Ship small. Detect fast. Diagnose clearly. Roll back safely. Recover predictably. No guesswork. No deployment drama. Great enterprise systems don't need to look impressive. They need to be dependable when everything goes wrong.
1
3
29