It is a system design requirement, like scalability or availability.
If your architecture starts without threat modeling, you are already exposed.
First principle: STRIDE threat modeling.
Every component must be analyzed:
Spoofing
Tampering
Repudiation
Information disclosure
Denial of service
Elevation of privilege
Because in reality, every system has an attacker model, whether you define it or not.
Example they ignored:
A login endpoint like:
SELECT * FROM users WHERE email = '$email' AND password = '$password'
One input change:
' OR 1=1 --
And suddenly authentication is bypassed.
No password needed.
That’s SQL injection.
Still happening in 2026.
Another failure:
A transfer API that accepted:
{ amount, recipient, timestamp }
Attackers intercepted a valid request and replayed it multiple times.
Same payload. Different outcomes.
Result: one ₦10,000 transfer became ₦100,000 in seconds.
No nonce. No signature validation. No protection.
Then authentication cracks:
Session tokens never expired properly.
Attackers stole JWTs from compromised devices and reused them across IPs.
No device binding. No token rotation.
So even after password changes, access remained active.
That is not a bug.
That is broken auth design.
Fixing this requires more than patches.
You move to Zero-Trust Architecture:
mTLS between services
Short-lived tokens
Request signing (HMAC or asymmetric)
Replay protection using nonces + timestamps
Device-bound sessions
Every request must prove it belongs.
Minimum baseline if you’re not there yet:
Input validation everywhere
WAF with OWASP Core Rules
Prepared statements only
Strict CORS + CSP policies
Rate limiting at gateway
Dependency scanning (Snyk, Dependabot)
Security chaos testing
No shortcuts.
The startup rebuilt everything.
STRIDE modeling first.
Replay protection added.
SQL injection eliminated via strict ORM + prepared queries.
JWT system redesigned with rotation + expiration enforcement.
Anomaly detection introduced for transaction spikes.
Backend Engineers throw Kafka into every architecture nowadays like it’s a compulsory tech stack.
Meanwhile, many applications genuinely do not need Kafka at all.
So, when exactly should Kafka actually be used?
Asynchronous background processing at scale.
A user uploads a video, submits a huge report, or places an order.
You don’t want them waiting 10–30 seconds for processing.
Push the job into Kafka.
Consumers process it in the background while the API returns instantly.
This is how large platforms handle:
• Video encoding
• PDF generation
• Image resizing
• Email campaigns
Event-driven architecture & service decoupling.
Multiple services need to react to the same event, like:
“UserPlacedOrder”
Instead of chaining HTTP requests between services and creating cascading failures…
One service publishes an event to Kafka.
Other services consume it independently.
This is the foundation of properly decoupled microservices.