# Persisting a user session in a web application: load-balancer affinity or a database?

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/2342/persist-user-session-web-application
Source observed: 2026-11-05T00:54:21.514Z
Last checked: 2026-11-05T00:54:21.514+00:00
Indexed: 2026-11-07T03:03:24.758+00:00

---

# Persisting a user session in a web application: load-balancer affinity or a database?

We publish interview questions and preparation resources through Aced, formerly Exponent. This question asks how to choose between persisting a user's web session through affinity on the load balancer and persisting it in a database.

## Question details

- **Interview type:** Technical
- **Last asked:** 4 years ago
- **Role:** [Solutions Architect](https://www.aced.io/questions?role=solutions-architect)
- **Company:** [Amazon](https://www.aced.io/questions?company=amazon)
- **Category:** [Technical](https://www.aced.io/questions?type=technical)

## Community answers

No answers have been contributed by the community yet. To submit an answer, [log in or sign up](https://www.aced.io/signup?src=nav&returnPath=/questions/2342/persist-user-session-web-application). Submitting an answer marks the question complete.

Detailed company statistics for this question are available through [Upgrade](https://www.aced.io/upgrade?src=questions).

## Related questions

- [You have a web application with one load balancer and two servers. Sometimes a user needs to log in again during their session. What could have happened?](https://www.aced.io/questions/2343/user-login-issue-web-application)
- [How would you launch peer-to-peer payment on a chat application?](https://www.aced.io/questions/364/launch-peer-to-peer-payment-chat-app)

## Related courses

### [Solutions Architect Interview Prep](https://www.aced.io/courses/solution-architect-interview)

![Solutions Architect Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/4SbcRuNAKq4eMNZnrxnQgo/13d197a8e79c4fb9bda37007191b0875/thought-catalog-505eectW54k-unsplash_976942ecbb__281_29_82a8a89f8f.jpeg?w=800&h=800&fm=webp&q=75)

We help candidates prepare for solutions architect roles at Amazon, Google, Meta, Microsoft, Salesforce, and other top companies through mock interviews, frameworks, and advice from senior candidates. The course covers system design principles and leadership skills.

### [Software Engineering Interview Prep](https://www.aced.io/courses/software-engineering)

![Software Engineering Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/4VkuYewBHUFIVUS5oJDW5h/02e833439b1289f25f38f13f81cbdca3/adobe_stock_optimized.jpeg?w=800&h=800&fm=webp&q=75)

We help candidates prepare for software engineering roles at Google, Amazon, Microsoft, Meta, Apple, and other top companies through mock interviews, frameworks, and advice from senior candidates. Preparation includes data structures, algorithms, system design, people management, behavioral interviews, and more.

## More Aced resources

We offer interview courses and practice resources for Product Management, Forward Deployed Engineering, Engineering Management, Software Engineering, System Design, Data Science, Machine Learning, Data Engineering, AI Engineering, Investment Banking, Generative AI, Security Engineering, TPM, Solutions Architecture, UX / Product Design, and BizOps & Strategy. We also provide interview questions, practice, coaching, resume review, salary negotiation, job referrals, and related resources.

- [All Questions](https://www.aced.io/questions)
- [Courses](https://www.aced.io/courses?src=nav)
- [Practice](https://www.aced.io/practice?src=nav)
- [Coaching](https://www.aced.io/coaching?src=nav)
- [Pricing](https://www.aced.io/upgrade?src=nav)
- [Log in](https://www.aced.io/login?src=nav)
- [Sign up](https://www.aced.io/signup?src=nav)

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F2342%2Fpersist-user-session-web-application&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F2342%2Fpersist-user-session-web-application). Opening a form does not execute a tool.