Urgent.News

What's breaking now, across thousands of outlets.

Tech

Sticky Routing That Never Expires Isn't Sticky It's Permanent

Session affinity is a simple idea: route a client to the same backend node it used last time, so state that lives on that node (a cache, a connection, an in-memory session) doesn't have to move. Assign once, store the assignment, reuse it on every subsequent request. It's a standard pattern, and on its own it's fine. The failure mode isn't in the assignment logic. It's in what happens after the…

Session affinity is a straightforward concept in routing clients to specific backend servers to maintain state. The issue arises when the assignment is permanent, never expiring even when the client is no longer active. This creates an imbalance, as certain backend nodes become overloaded with old, inactive assignments, while others remain comparatively idle.

The failure is subtle, often manifesting as imbalance, pressure alerts, or oscillating autoscaling behavior. The root cause lies in the absence of a cleanup mechanism for expired assignments. Similar issues can occur in other systems that write state on events without removing it when there's no corresponding event. Adding a time-to-live (TTL) to assignments, refreshed on each successful use, ensures that idle clients' assignments expire, allowing the system to correctly allocate them to the least loaded nodes. This simple fix addresses the silent failure class caused by permanent assignments.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Understanding Subqueries and CTE's

Introduction Imagine you are a data analyst working for a retail company. Your manager asks you to identify customers who spend more than the average customer, employees earning above their…

  • Subqueries are SQL statements placed inside other queries for complex calculations.
  • CTEs are temporary named result sets defined within SQL statements to simplify queries.
  • Subqueries come in three types: scalar, multiple-row, and correlated.

More from Saturday 26 September →