Search
Lessons (40)
- Async JavaScript: Promises, async/await and Node's Event Loop
From callbacks to promises to async/await: running work in parallel, handling errors, timeouts and cancellation with AbortController …
- TypeScript in Practice
… It reads your code before it runs and says "you promised this was a User , but here it …
- Advanced TypeScript for Frontend
… Promise<ApiResult<T { const response = await fetch(url); return response.json() as Promise<ApiResult<T ; } Generics describe the …
- I — Interface Segregation Principle
… Promise<Order ; list(filter: Filter): Promise<Order[] ; } interface OrderWriter { save(order: Order): Promise<void ; delete(id: string): Promise …
- Hexagonal Architecture (Ports & Adapters)
… bookId: string): Promise<boolean ; markBorrowed(bookId: string): Promise<void ; } export interface LoanRepository { save(loan: Loan): Promise<void ; countActiveFor …
- JavaScript Essentials: Event Loop, Closures & this
… Split heavy work into chunks, or move it to a Web Worker . async/await is promises underneath js …
- L — Liskov Substitution Principle
… changing height also changes width](/img/solid/lsp-square.svg) Square broke a promise that Rectangle made: "setting …
- Capacity Planning, SLOs and Error Budgets
… An SLO is the target we promise ourselves. An error budget is how much failure that promise permits …
- 500 Users Upload Documents at Once: Design the Background Job Pipeline
… the API promises a fast answer, the database promises an honest status, the queue promises delivery at least …
- Multi-Region and Disaster Recovery
… Do not choose it only because it sounds more available. Promise Design consequence --- --- RPO = 0 for orders Synchronous …
- Clean Architecture in Depth
… save(order: Order): Promise<void ; } export interface PaymentGateway { charge(customerId: string, amountCents: number): Promise<{ paymentId: string } ; } export interface …
- Design a Chat Application
… Offline push comes from the durable event, not an in-memory gateway. Define the message promise For a …
- SQL vs NoSQL Databases
… the four promises Letter Promise Example --- --- --- A tomicity All or nothing Transfer $100: debit AND credit both happen …
- TypeScript Essentials
… Promise<T { const response = await fetch(url); if (!response.ok) throw new Error( HTTP ${response.status} ); return response …
- ACID, Transactions & Locks
… recovered from WAL/replication. Consistency is not a promise that every replica is instantly current; it means the …
- Event-Driven Architecture
… E) = Promise<void ; class EventBus { private handlers = new Map<string, Handler<any [] (); on<E extends { type: string } (type …
- Next.js Rendering: CSR, SSR, SSG, ISR & Server Components
… 15+, params is a Promise export default async function ProductPage({ params }: { params: Promise<{ id: string } }) { const { id } = await …
- Time, Consistency and Distributed Transactions
Reason about clocks, ordering, split brain, locks, CRDTs and transactions without promising impossible global certainty. The problem in …
- Real-Time, Pub/Sub, Webhooks and CDC
… Do not promise one global order across all orders. A consumer receiving version 8 after version 9 should …
- System Design Interview Framework
… is no stated audience, load, group size, delivery promise or retention policy. What must be true Turn the …
- Design a File Storage Service
… Authorize download requests and choose signed-link lifetimes consistent with the revocation promise. Walk through a failure and …
- Database Relations & Foreign Keys
… It is a database promise: an order belongs to one customer; an order contains many items; a student …
- Database Internals, Replication and Scaling
… true Scale reads while preserving the specific consistency promise for read-after-write and protecting database resources. Practical …
- Scalable Frontend Architecture
… boundary. ts export async function getOrder(id: string): Promise<Order { const response = await http.get( /orders/${id} ); return …
- Domain-Driven Design: Tactical Patterns
… OrderRepository { get(id: OrderId): Promise<Order ; // loads the WHOLE aggregate save(order: Order): Promise<void ; // saves the WHOLE …
- Design a Ride-Sharing Service
… perhaps exclude drivers whose last update is older than 30 seconds, rather than promising exact live positions. Measure …
- Design an E-Commerce Checkout
… invariant comes first For an order, the important promise is: stock is never oversold and a customer action …
- Message Delivery: Queues, Kafka, Ordering and DLQs
… needs idempotent writes plus transaction boundaries. Do not promise global ordering unless you can name the ordering key …
- What Is Artificial Intelligence? A Developer's Guide
… new order + saved model → estimated delivery time A prediction is an estimate, not a promise. Changes in traffic …
- The L6 System-Design Thinking Loop
… name the promise, show the normal path, break one dependency, then explain recovery and evidence.
- API Gateway, BFF & Service Discovery
… async (req, res) = { const [user, orders, recs] = await Promise.all([ usersClient.get(req.user.id), ordersClient.recent(req …
- Resilience Patterns
… Math.random() backoff; // spread clients out await new Promise((r) = setTimeout(r, jitter)); } } } Retry rules: - ✅ Retry transient errors …
- React Hooks in Practice
… pending state, result, errors useOptimistic Show the expected result instantly, before the server confirms use Read a promise …
- Cross-Service Data: How to Join Without a Database JOIN
… responses in memory. js const [order, user] = await Promise.all([ orders.get( /orders/${orderId} ), users.get( /users/${userId …
- JavaScript Language Fundamentals
… math.js"; const { readFile } = await import("node:fs/promises"); // dynamic import ES modules CommonJS --- --- --- Syntax import / export require …
- Behavioral Patterns II: Chain, Template, Iterator, Mediator, Memento, Visitor
… class CsvImporter extends DataImporter { read(path) { return fs.promises.readFile(path, "utf8"); } parse(text) { return text.split("\n …
- Node.js and Express
… err.message, // never leak internals }); }); Express 5 (the current major version) forwards rejected promises from async handlers to …
- The Hot SKU Alert Problem
… Define whether the product promises every price version or only the latest meaningful change. 5. Use durable idempotency …
- Python Fundamentals
… It's promising, but most production code still assumes the GIL. Testing with pytest python test pricing.py …
- Rust: Types, Errors and Concurrency
… trait is a set of methods a type promises to have, like an interface. rust trait Shape { fn …