Architecture
376 bites tagged Architecture — interview questions with model answers, and 60-second explainers.
TypeScript Namespaces: The Original Module System
TypeScript namespaces bundle related code under a single global name, preventing name collisions. They are useful for older projects or UMD library types, but the footgun is using them in modern apps; prefer standard ES modules.
React Fiber: Making UI Rendering Interruptible
React Fiber treats rendering like a cooperative scheduler. It breaks UI updates into small, pausable chunks, preventing long, blocking tasks. This lets high-priority work like user input interrupt heavy rendering, keeping animations and gestures smooth.
Single Source of Truth: Centralized App State
A Single Source of Truth consolidates all application state into one central object, or 'store.' This makes state predictable and easier to debug, especially in libraries like Redux, by creating one place to look for data.
React Native's New Architecture Interop Layer
The Interop Layer is a compatibility bridge, letting legacy native modules run in React Native's New Architecture without a full rewrite. Library maintainers must ensure compatibility for users on RN 0.74+. The footgun: remove partial Codegen specs.
React Native's Two Threads: JS and UI
React Native splits work between a JS thread for React logic and a UI thread for drawing pixels, keeping the app responsive. The JS thread runs your code and calculates layout, while the UI thread handles native view updates.
Fabric Renderer: React's Native UI Interpreter
Fabric is React Native's interpreter, translating abstract components into concrete native views for iOS and Android. It's the core renderer in the New Architecture, enabling more synchronous UI updates. The footgun is thinking it's a library you import.
The React Native Bridge: Why It's Being Replaced
Think of the React Native Bridge as an asynchronous JSON message queue between your JavaScript code and the native UI. This design is the source of its core limitation: communication delays that cause visible UI jank and prevent modern React features.
Layered Architecture: Separating API from Business Logic
A layered architecture separates your API into distinct jobs: routing, controlling, and serving. This keeps code maintainable, like an organized toolbox. It's crucial for growing FastAPI apps.
API-as-a-Product: Your API Is Your Business
Treat your API as a core product with developers as your customers, not just a technical integration. This mindset is crucial when exposing data to partners or building a developer ecosystem, like Stripe or Twilio do.
HATEOAS: Let Your API Tell You What's Next
HATEOAS makes an API self-discoverable, like a website where you click links instead of guessing URLs. The server's response includes links for the next possible actions, decoupling the client from hardcoded endpoints.
REST: The Architectural Style of the Web
REST is a set of design rules, not a strict protocol, for building massive distributed systems like the web. These constraints enable independent component deployment, scalable interactions, and a layered architecture that supports caching and security.
Node.js Circular Dependencies: The Unfinished Export
When module A requires B, and B requires A, Node.js avoids an infinite loop by returning an unfinished version of one module's exports. This happens in complex apps with tightly coupled modules. The code doesn't crash; it fails later with a TypeError.
Structuring Express Apps with Layered Architecture
Think of your Express app as a three-story building: a web layer for HTTP traffic, a service layer for business logic, and a data layer for your database. This keeps code organized and testable.
Node.js Events and the EventEmitter
Node.js handles concurrency with an event-driven model, not threads. "Emitters" fire named events that "listeners" react to, enabling non-blocking I/O for things like file reads and web requests.
Data Sharding: Splitting a Database for Scale
Sharding splits a huge database into smaller, independent databases (shards), each on its own server. It's like giving different volumes of a phone book to different librarians. This is critical for massive datasets, but a bad shard key creates 'hot spots'.
Bulkhead Pattern: Isolate Failures, Protect Your System
The Bulkhead pattern partitions a system like a ship's hull, containing failures to prevent a total outage. By isolating resource pools for each service or consumer, a fault in one component won't cascade and take down the entire application.
Horizontal Scaling: Add More Machines, Not Bigger Ones
Horizontal scaling (scaling out) means handling more load by adding more machines to your resource pool, not upgrading a single one. It’s used for web servers behind a load balancer. The footgun is that your app must be stateless to avoid losing user data.
Single Point of Failure: Your System's Achilles' Heel
A single point of failure (SPOF) is your system's Achilles' heel—one component whose failure causes a total outage. This is critical in high-availability design, like ensuring a website survives a server crash. The footgun is missing implicit SPOFs.
Non-Functional Requirements: How a System Should Be, Not Just What It Does
Non-Functional Requirements (NFRs) define *how well* a system performs its tasks, not *what* tasks it performs. They're the adjectives (fast, secure, reliable) for a system's verbs.
Workflow Engine: The Conductor for Your Business Logic
A workflow engine conducts your business logic, ensuring complex tasks run in the right order. It's for multi-step processes like order fulfillment or data pipelines. The footgun is building one from scratch—you'll poorly reinvent state management and retries.
Multimodal Fusion: Combining Senses for AI
Multimodal fusion lets an AI combine data types like text, images, and audio into one understanding, much like a human brain. It's key for visual question answering or analyzing video sentiment.
Latent Diffusion Models (LDM)
Latent diffusion models denoise in a compressed latent space instead of raw pixels. A pretrained autoencoder shrinks the image first and expands it back after, cutting compute enough to make text to image generation practical on consumer hardware.
VIPER: Taming Massive iOS View Controllers
VIPER is a strict architectural pattern that tames "Massive View Controllers" by splitting features into five layers: View, Interactor, Presenter, Entity, and Router. It's used in large iOS apps to make business logic and navigation explicitly testable.
The Coordinator Pattern: Untangling iOS Navigation
The Coordinator pattern makes a separate object the 'boss' of app navigation, leaving view controllers to just manage their view. This lets you reuse views in different flows without them knowing what comes next.
Get Architecture bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.