Software Architecture

Must-Know Web Development Concepts in 2026

· 14 min read

Must-Know Web Development Concepts in 2026
Contents

Software can be functional, secure, even fast, and still turn into a long-term problem. It happens when the code gets hard to change. Every small modification risks breaking something unrelated, features take longer, bugs show up in unexpected places, and at some point even simple improvements feel dangerous.

Knowing a framework doesn’t protect you from that. Frameworks change every few years, and what keeps a codebase changeable are the concepts underneath them. Below are the ones I’d expect any web developer to know in 2026, from clean code and architecture to caching, HTTP and the way a browser draws a page.

Clean code#

One of the earliest and most influential books on maintainable code is Robert C. Martin’s Clean Code: A Handbook of Agile Software Craftsmanship (2008). Its central idea is simple: write code for humans first and machines second. The computer doesn’t care whether a function is understandable. The next developer who opens it does. So the book argues for clear names, small functions, little complexity and a consistent structure. When code states its intent, developers spend less time deciphering it and more time improving it. If you want the key ideas without reading the whole book, there’s a decent summary on cleancodeguy.com.

SOLID#

Readable code is half of it. The other half is design, and here the usual reference is SOLID, five principles meant to reduce coupling and stop one change from rippling through unrelated parts of the system:

  • Single Responsibility. A module should have only one reason to change. When a function handles several concerns, a small modification for one of them can break the others.
  • Open/Closed. Code should be open for extension and closed for modification, so you extend behavior through abstractions instead of rewriting what already works.
  • Liskov Substitution (Barbara Liskov described it in 1987). If one class stands in for another, the application should keep working without surprises.
  • Interface Segregation. Don’t force implementations to depend on methods they don’t need. Small, focused interfaces are easier to understand and adapt.
  • Dependency Inversion. Depend on abstractions rather than concrete implementations, so components can evolve independently.

These principles buy flexibility, but they can also push you into overengineering, which is a trap of its own. Three older rules of thumb keep that in check. DRY (Don’t Repeat Yourself) says avoid duplicated logic, though not by introducing an abstraction too early. KISS (Keep It Simple, Stupid) says take the simplest solution that solves the problem. And YAGNI (You Ain’t Gonna Need It) warns against building features “just in case”. Most of the time those hypothetical features never arrive.

Separation of concerns#

Separation of concerns means different parts of a system handle different responsibilities and don’t leak into each other’s domains. When responsibilities are clearly separated, the system is easier to test, refactor and extend.

In a typical backend this shows up as layers. The controller layer is the entry point. It deals with HTTP requests, validates input, calls business logic and returns responses. In Next.js that’s usually a route handler:

// app/api/users/[id]/route.js
export async function GET(req, { params }) {
  const { id } = await params
  const user = await userService.getUser(id)
  return Response.json(user)
}

The service layer holds the business logic. Application rules and domain decisions live here. Services coordinate actions, enforce validation rules and orchestrate workflows.

// services/userService.js
export async function getUser(id) {
  const user = await userRepository.findById(id)

  if (!user) {
    throw new UserNotFoundError()
  }

  return user
}

Below that sits the repository layer, which talks to the database. It hides how data is stored and gives the rest of the app one consistent interface for reading and writing it. At the bottom is the infrastructure layer: database clients, caches like Redis, email providers, payment gateways, file storage adapters.

What matters most is the direction of dependencies. Controllers may call services, services may call repositories, repositories may use infrastructure, and never the other way around. That keeps business logic independent of frameworks and external systems.

Layered architecture: Controller → Service → Repository → Infrastructure

For a quick refresher, GeeksforGeeks has a concise overview of separation of concerns.

Clean and hexagonal architecture#

Take that idea one step further and you get Hexagonal Architecture, also called Ports and Adapters, which Alistair Cockburn described in 2005. Robert C. Martin’s Clean Architecture (2012) builds on it. The two get mixed up a lot, but the core philosophy is the same: the most valuable part of a system, the domain logic, should not depend on frameworks, databases or third-party services. Those are interchangeable. The business logic isn’t.

Now picture an API route that queries the database and calls a payment service directly. The route is now tightly coupled to implementation details, and testing its logic means bringing up the full environment. A cleaner design delegates. The route handler forwards the request to an application service, and that service talks to repositories and external adapters through abstractions:

export async function POST(req) {
  const body = await req.json()

  await createUser(
    new PrismaUserRepository(),
    new StripeAdapter(),
    body
  )

  return Response.json({ success: true })
}

The route handler is only an entry point for HTTP. It has no business rules, no database queries and no payment logic. The actual operation is delegated to the application layer through createUser, which could look like this:

// application/createUser.js
export async function createUser(users, payments, data) {
  const user = await users.create(data)
  await payments.createCustomer(user)
  return user
}

createUser has no idea Prisma or Stripe exist. It only knows it got something with a create method and something with a createCustomer method. So tomorrow you can replace Prisma with another database client or Stripe with another payment provider without touching the business logic. The concrete classes are still created in the route, and that’s fine, the route is where the app gets wired together. In a bigger codebase that wiring usually moves into one place (a composition root or a DI container).

Why go to that trouble? Framework code is relatively easy to replace. Rewriting business logic is expensive and risky.

Cockburn’s own explanation of Hexagonal Architecture is worth reading, and there’s also a practical walkthrough on YouTube.

Monolith vs microservices#

A monolith is a single deployable application. It’s usually easier to develop and debug, especially early on, but you can’t scale one hot component independently of the rest.

Microservices split the system into smaller services that are deployed and scaled independently. That flexibility costs complexity: network calls instead of function calls, partial failures across services, orchestration.

So which one? Unless you already know where the service boundaries are, start with a monolith and split it when a real scaling or team problem shows up. Martin Fowler made the same case in MonolithFirst back in 2015, and it still holds.

REST vs GraphQL#

REST has long been the default. It exposes resources through separate endpoints such as /users/1 or /orders/42 and leans on HTTP methods, status codes and HTTP caching.

GraphQL has a single endpoint where the client asks for exactly the data it needs. That solves REST’s over-fetching and under-fetching, though badly designed queries can get complex and expensive. Since queries usually go out as POST requests, you also lose plain HTTP caching. For one frontend talking to its own backend, I’d stay with REST. GraphQL pays off when many different clients need different shapes of the same data.

Stateless vs stateful#

In a stateless architecture the server keeps no client session between requests. Each request carries everything needed to process it, usually as a token such as a JWT. That suits the cloud well, because any server instance can handle any request:

// Express.js
app.use((req, res, next) => {
  const token = req.headers.authorization?.split(' ')[1]
  const payload = jwt.verify(token, SECRET)
  req.user = payload
  next()
})

jwt.verify throws on a missing or invalid token, so in real code you’d catch that and answer with 401. There’s also a fly in the ointment with JWTs in general: you can’t revoke one before it expires without keeping some state on the server after all (a denylist, for example).

A stateful system keeps session data on the server. That can simplify the application logic, but it makes scaling harder, because requests have to reach the server that holds the session:

// Express.js
app.use(session({
  secret: process.env.SESSION_SECRET,
  resave: false,
  saveUninitialized: false
}))

By default express-session keeps sessions in MemoryStore, which its README says is purposely not designed for production: it leaks memory and doesn’t scale past a single process. In practice sessions go into a shared store like Redis, and then the app servers are stateless again, at the cost of one lookup per request.

Modern cloud setups lean toward stateless designs because they fit container orchestration, serverless deployments and horizontal scaling.

Caching#

Performance in distributed systems depends a lot on caching, and there are several layers of it. Data can be cached in the browser, at the CDN edge, in a reverse proxy like Nginx, inside the application with something like Redis, and sometimes in the database itself.

Each layer solves its own problem. The browser cache saves repeated downloads of static assets. A CDN moves content geographically closer to users. A reverse proxy can cache whole responses from backend servers. An application cache keeps frequently accessed data around so you skip expensive database queries.

How cached data relates to the database depends on the strategy. Cache-aside, the most common one, reads from the cache first and falls back to the database on a miss. Write-through updates the cache and the database in the same operation. Write-behind writes to the cache first and updates the database asynchronously, trading some safety for speed.

In Next.js you control caching in route handlers, at the edge or in the rendering layer, depending on the data. Browser caching, for instance, follows the HTTP headers a route handler returns:

export async function GET() {
  const data = await fetchData()

  return new Response(JSON.stringify(data), {
    headers: {
      "Cache-Control": "public, max-age=60"
    }
  })
}

The browser may now reuse the response for 60 seconds without asking the server again. public also allows CDNs and proxies to keep a copy.

For cache-aside, Next.js applications often use Redis as the external cache:

const cached = await redis.get(`user:${id}`)

if (cached) return JSON.parse(cached)

const user = await db.user.findUnique({
  where: { id }
})

await redis.set(
  `user:${id}`,
  JSON.stringify(user),
  { EX: 60 }
)

return user

Next.js also supports ISR-style caching for server-rendered content. You set a revalidation interval, and the cached response is regenerated in the background when it expires:

export const revalidate = 60

export async function GET() {
  const data = await generatePageData()
  return Response.json(data)
}

That works well for content that doesn’t change often, such as public pages or aggregated API responses. You get fresh enough data and far less server load.

Load balancing#

As a system grows, one server isn’t enough. A load balancer such as HAProxy, Nginx or a cloud service spreads traffic across several servers.

Load balancer distributing traffic across Server A, B, and C

That improves throughput and resilience, and it’s one more argument for stateless design. Any request may land on any instance, so in-memory state stops being reliable. Sticky sessions (pinning a client to one server) work around it, but then losing that server means losing its sessions.

CSR, SSR and ISR#

On the frontend, the rendering strategy affects performance and scalability too. Client-side rendering (CSR) builds the UI entirely in the browser with JavaScript. Server-side rendering (SSR) generates HTML on every request. Incremental Static Regeneration (ISR), a Next.js feature, serves static pages and regenerates them in the background from time to time, which is what the revalidate example above does. Here’s the flow:

ISR cache flow: first request builds and caches the page, subsequent requests serve cached version, revalidation triggers background regeneration

Each approach trades performance, freshness and server load differently. Roughly: CSR for app-like screens behind a login, SSR for personalized or per-request data, ISR (or plain static) for content that changes now and then.

The Node.js event loop#

If you work with Node.js, you should know the basics of its event loop. Node runs your JavaScript on a single thread and gets concurrency from asynchronous I/O. Network calls (database queries included) go through the operating system’s async mechanisms, and file system work goes to libuv’s thread pool, four threads by default. When an operation completes, its callback is queued back onto the event loop. That’s how one Node process serves many requests at once, as long as nothing hogs the thread with heavy synchronous work. What happens if something does?

setTimeout(() => console.log("timer"), 0)

const end = Date.now() + 2000
while (Date.now() < end) {} // 2 seconds of synchronous work

console.log("done")

Output:

done
timer

The timer was due after 0 ms and fired after two seconds. Every request hitting that process waits the same way.

HTTP methods and status codes#

HTTP methods say what to do with a resource, and status codes report how it went. Knowing them well is what makes an API predictable.

Method Purpose Idempotent
GET retrieve data yes (and safe, no side effects)
POST create a new resource no
PUT replace an existing resource yes
PATCH partially update a resource not necessarily
DELETE remove a resource yes
Code Meaning
200 OK, request succeeded
201 Created, resource successfully created
204 No Content, success with no response body
301 / 302 Redirect (permanent / temporary)
400 Bad Request, client error
401 Unauthorized, which in practice means unauthenticated
403 Forbidden, authenticated but not allowed
404 Not Found
500 Internal Server Error

CORS#

Every web developer runs into CORS (Cross-Origin Resource Sharing) sooner or later. Browsers don’t let a page read responses from another origin unless that server explicitly allows it, and CORS is how the server allows it. The detail people often miss is that browsers enforce it, not servers. Server-to-server calls aren’t affected by CORS at all. For simple requests the browser even sends the request. It just won’t let your script read the response.

In a Next.js route handler, allowing cross-origin requests means returning the right headers:

export async function GET(req) {
  return new Response("ok", {
    headers: {
      "Access-Control-Allow-Origin": "https://frontend.com"
    }
  })
}

// For preflight requests
export async function OPTIONS() {
  return new Response(null, {
    headers: {
      "Access-Control-Allow-Origin": "https://frontend.com",
      "Access-Control-Allow-Methods": "GET,POST,OPTIONS",
      "Access-Control-Allow-Headers": "Content-Type, Authorization"
    }
  })
}

In practice many teams avoid CORS altogether by routing external API calls through their own backend or reverse proxy. The frontend calls its own endpoint, and that gets proxied to the third-party service. With Nginx it can look like this:

location /api/ {
    proxy_pass https://api.service.com;
    proxy_http_version 1.1;
    proxy_ssl_server_name on;
}

The browser stays on the same origin, and the backend gets a place to add authentication, caching or logging.

How the browser renders a page#

When a page loads, the browser downloads the HTML and builds the DOM tree. It may pause along the way when it hits a blocking script. CSS is parsed separately into the CSSOM, and since layout depends on styles, CSS is render-blocking. The browser then merges DOM and CSSOM into a render tree with only the visible elements. Next comes layout, where it calculates the position and size of every element. This step is also called reflow, and it gets expensive when triggered over and over. Once layout is known, the browser paints pixels: text, colors, borders, shadows. Finally the layers are composited, often on the GPU, especially when properties like transform or opacity are involved.

Browser render pipeline: HTML→DOM, CSS→CSSOM, merged into Render tree, then Layout, Paint, Composite

For everyday work that boils down to a few rules. Don’t force layout calculations repeatedly. Animate transform and opacity. Keep an eye on render-blocking resources such as synchronous scripts and large CSS files, and use defer or async on scripts where you can. In Next.js you also get the <Image /> component, which prevents layout shifts, dynamic imports for heavy components, and SSR or ISR to cut down the work the browser does during hydration.

The N+1 query problem#

On the database side, the fundamentals like indexing and query optimization haven’t changed much in decades. A few architectural problems still come up all the time, and N+1 is the most common one. The application fetches a list of records and then runs one more query per item to get related data:

const posts = await db.post.findMany() // 1 query

for (const post of posts) {
  post.comments = await db.comment.findMany({
    where: { postId: post.id }
  }) // N queries
}

With 100 posts that’s 101 queries, and it gets slow fast. The usual fixes are loading related data together with joins or eager loading, batching with WHERE IN (...), or a batching layer like the DataLoader pattern common in GraphQL APIs. With Prisma, eager loading is one option away:

const posts = await db.post.findMany({
  include: { comments: true }
})

ACID vs eventual consistency#

Traditional relational databases follow the ACID model. Atomicity means a transaction either fully succeeds or fully fails. Consistency keeps database constraints valid. Isolation stops concurrent transactions from interfering with each other. Durability guarantees that committed data survives a crash. The classic example is a bank transfer: taking money from one account and adding it to another must both succeed or both fail.

Distributed systems and many NoSQL databases work differently. They don’t promise immediate consistency, only eventual consistency. Replicas may disagree for a while, but over time all nodes converge to the same state. Say a user updates their profile picture. Some regions may show the old image for a short time until synchronization finishes. That’s usually an acceptable price for better scalability and global availability.

So the practical question is which data really needs ACID. Money, inventory and anything bound by a constraint do. A like counter or a profile picture can live with a few seconds of lag.