Comment

Comment by throwaway13337

The simplest load balancing I've done is modulo the user ID by the number of servers then point at that server.

This solves caching too since you are only ever receiving and caching user data on a single server. No cache communication required. You can enforce it on the server side for security as well.

Doesn't require a load balance server - just an extra line of code.

Keep it simple.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton