RPO 5min means continuous replication (cross-region streaming + PITR); RTO 30min means a warm standby ready to promote (IaC-provisioned, S3 CRR, Route 53 failover). Active-passive is the right fit for these numbers. But an untested plan is a guess — rehearse regularly.
#resilience#infrastructure#database
Fix both layers: throttle/sample repetitive logs in the app ('×10,000' as one line) and back off retries; on the host use logrotate with size/count caps and write logs to a dedicated volume, not the root disk. Treat unbounded logging as a bug.
#resilience#observability#infrastructure
Per-IP limits lose to rotating proxies. Key a Redis-backed sliding-window on multiple dimensions — username + IP + subnet/ASN + UA + country; add account lockout and CAPTCHA, and push true volumetric DDoS to the edge (Cloudflare). Fail closed on the login path.
#resilience#security#redis
Decide in advance what's critical (browse, cart, checkout) and what's nice-to-have (recommendations, similar products, reviews); put the nice-to-haves behind feature flags and short timeouts. Under load a kill-switch turns them off or serves mock data. Don't improvise at 98% CPU — rehearse first.
#resilience#architecture#scaling
Split one atomic transaction into a sequence of local transactions, each with a compensating action. An orchestrator drives the steps over a queue and runs compensations in reverse on failure. Make every step idempotent and publish via the outbox pattern.
#resilience#microservices#queue
Let a node be primary only if it holds a majority (quorum). Don't hand-roll failover; use Patroni + etcd/Consul (Raft), and have the old primary cut off from the quorum demote itself (fencing). Use an odd number of voting members.
#resilience#postgresql#database
Stop calling a failing dependency: count failures while CLOSED, fail fast to a fallback while OPEN, probe with trial calls while HALF-OPEN. But the real killer is the 30s timeout — pair the breaker with a short timeout, a bulkhead and a fallback.
#resilience#architecture#laravel
Query-string busting is unreliable — some CDNs ignore the query in the cache key. The robust pattern is content-hashed filenames (`app.a8f9b2.js`): the name changes only when content changes, so you cache forever with `immutable`. The one thing you must never cache long is the HTML that points to those hashes.
#performance#ci-cd#infrastructure
`wildcard`/`regexp` scan at query time, don't use the inverted index, and burn CPU at 10M docs. Move the work to index time: build the prefixes when you index with `edge_ngram`, so autocomplete becomes a plain term lookup (milliseconds).
#performance#elasticsearch#database
`file_get_contents`/`Storage::get` loads the whole file into RAM — fatal at 2-5 GB. Best of all, don't pipe the bytes through PHP: a presigned S3 URL or `X-Sendfile`. If you must, use `Storage::readStream` + `StreamedResponse` and emit chunk-by-chunk so memory stays flat at a few MB.
#performance#laravel#infrastructure