Search
Lessons (40)
- State, Remote Backends, and Locking
Share state through S3, enable native locking, migrate safely, and protect recovery data. Why state exists A resource …
- ACID, Transactions & Locks
Make multi-step changes correct with atomic transactions, isolation choices, constraints and short-lived locks. The bank-transfer …
- HCL, Resource Addresses, and Project Layout
… Review the lock-file diff and resulting plan together. The lock file does not lock remote module versions …
- CI/CD and Reviewed Production Changes
… Two jobs writing the same state should not race; use both backend locking and CI concurrency controls. Commands …
- Debug Latency Like an Investigator
… No trolley free? You wait at the door. Lock wait Time spent waiting because another request is using …
- Transactions, Indexes & Concurrency
… transactions protect invariants while indexes speed access and locks coordinate writers](/img/database-interviews/transactions.svg) Q8: What …
- Distributed Coordination: Consensus, Heartbeats and Gossip
… the lock deletes itself after, say, 30 seconds). What can go wrong? <details <summary Show answer</summary The …
- Database Indexing & Transactions
… lock the row (pessimistic locking) sql BEGIN; SELECT seats left FROM flights WHERE id = 42 FOR UPDATE; -- others …
- Time, Consistency and Distributed Transactions
… A background worker also processes orders, and it holds a lock with a time limit (a lease : "this …
- Drift, Troubleshooting, and Disaster Recovery
… review State lock error Another runner, crashed operation, lock metadata Wait or establish that the lock is stale …
- L6 Production Debugging Casebook
… waiting in a queue, waiting for a database connection, running SQL, a remote call, a lock, or GC …
- Arrays & Strings
… Because the lockers are side by side and numbered, you can walk straight to locker 42 without opening …
- SSH, Networking & Firewalls
… 2. Locks on every door you don't use: a firewall closes all ports except the few you …
- Concurrency, Resilience & Distributed Workflows
… FOR UPDATE (pessimistic locking) or a version column (optimistic locking). Keep transactions short, never call an external service …
- Go Concurrency: Goroutines, Channels and Context
… a goroutine stops until something happens (data arrives, a lock frees) Channel A typed pipe for sending values …
- Resilience, Disaster Recovery and Multi-Region Design
… Lock (WORM) to protect against ransomware and deletion. - Enable S3 versioning , MFA delete where appropriate, and Object Lock …
- 10,000 Users Do Not Need 10,000 Database Connections
… more queries fight over the same locks (a lock is a "do not touch, I'm using this …
- Production Capstone and Interview Practice
… Require a reviewed lock file and serialized applies. After apply, inspect bucket settings, record the resource addresses, and …
- Jenkins in Production: Deploys, Docker and Scaling
… Deploy to production') { when { branch 'main' } steps { lock('production') { // Lockable Resources plugin: one prod deploy at a time …
- Indexes, EXPLAIN & Query Plans
… Check connections and locks Sometimes the SQL is fine, and the time goes on waiting : ![Request time split …
- Caching & Redis
… A lock is an optimization, not a reason to make the database unavailable. 4. Caching errors and empty …
- A WhatsApp OTP Is Only Single Use If You Make It So
… The database locks the row for the first request (a lock is a "wait, I'm using this …
- Encapsulation
… The cash is locked inside. You can't open the box and take money. You use the buttons …
- Rust: Types, Errors and Concurrency
… Vec< = (0..8) .map( { let counter = Arc::clone(&counter); thread::spawn(move { counter.lock().unwrap() += 1; }) }) .collect(); for …
- Database Internals, Replication and Scaling
… Is a transaction holding locks too long, making others wait? 4. Is the app actually waiting for a …
- Storage Engines & Database Operations
… wait, active connections, transaction age, slow-query fingerprints, lock waits, replica lag, cache hit rate, WAL/checkpoint or …
- Docker & Containers
… small and secure ---- FROM node:22-alpine WORKDIR /app ENV NODE ENV=production COPY package.json package-lock …
- Multi-Account Strategy, Governance and Security Operations
… A bad SCP can lock teams out. Control Tower and landing zones AWS Control Tower builds a landing …
- Serverless Architecture
… several seconds, depending on runtime and bundle Vendor lock-in Triggers, IAM and managed services are provider-specific …
- DynamoDB Modeling, RDS Scaling and Data Resilience
… across up to 100 items Conditional writes Optimistic locking: attribute not exists(PK) DAX In-memory cache for …
- The Hot SKU Alert Problem
… The product row stays locked for minutes, and nobody else can update it. 2. Everything for this product …
- Bash Scripting & Scheduled Jobs
… s in package-lock.json , deletes node modules first, and fails if the lock file is out of …
- Edge, Platform & Frontend Delivery
… Build once from a pinned dependency lockfile. 2. Publish immutable static assets before or with the application release …
- Data in Microservices: Sagas & the Outbox Pattern
… It exists, but in microservices it's usually avoided: - Every participant is locked while waiting for the slowest …
- Your First Terraform Project
… belongs in Git? Commit .tf files and .terraform.lock.hcl . Do not commit the downloaded .terraform/ directory, state …
- Rust: Ownership, Borrowing and Lifetimes
… This frees memory and closes files, sockets and locks. rust { let file = File::create("log.txt")?; let guard …
- OOP Mistakes and Interview Questions
… Item) { if (this. status !== "draft") throw new Error("Order is locked"); this. items.push(item); } submit() { if (this …
- Design a File Storage Service
… private, look at the real contents, and quarantine (lock away) anything suspicious. Rule 3: Check permission at every …
- Secrets, Ephemeral Values, and Least Privilege
… read-only. Handle artifacts carefully Commit the provider lock file; keep secrets out of Git. Protect plan artifacts …
- Deploy a Node.js App to a VPS, Step by Step
… Install and build bash cd /var/www/myapp npm ci exact versions from package-lock.json npm run …