Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 299783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:51:15+00:00 2026-05-12T06:51:15+00:00

Is there a best-practice for scalable http session management? Problem space: Shopping cart kind

  • 0

Is there a best-practice for scalable http session management?

Problem space:

  • Shopping cart kind of use case. User shops around the site, eventually checking out; session must be preserved.
  • Multiple data centers
  • Multiple web servers in each data center
  • Java, linux

I know there are tons of ways doing that, and I can always come up with my own specific solution, but I was wondering whether stackoverflow’s wisdom of crowd can help me focus on best-practices

In general there seem to be a few approaches:

  • Don’t keep sessions; Always run stateless, religiously [doesn’t work for me…]
  • Use j2ee, ejb and the rest of that gang
  • use a database to store sessions. I suppose there are tools to make that easier so I don’t have to craft all by myself
  • Use memcached for storing sessions (or other kind of intermediate, semi persistent storage)
  • Use key-value DB. “more persistent” than memcached
  • Use “client side sessions”, meaning all session info lives in hidden form fields, and passed forward and backward from client to server. Nothing is stored on the server.

Any suggestions?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:51:16+00:00Added an answer on May 12, 2026 at 6:51 am

    I would go with some standard distributed cache solution.
    Could be your application server provided, could be memcached, could be terracotta
    Probably doesn’t matter too much which one you choose, as long as you are using something sufficiently popular (so you know most of the bugs are already hunted down).

    As for your other ideas:

    • Don’t keep session – as you said not possible
    • Client Side Session – too unsecure – suppose someone hacks the cookie to put discount prices in the shopping cart
    • Use database – databases are usually the hardest bottleneck to solve, don’t put any more there than you absolutely have to.

    Those are my 2 cents 🙂

    Regarding multiple data centers – you will want to have some affinity of the session to the data center it started on. I don’t think there are any solutions for distributed cache that can work between different data centers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a best practice when it comes to setting client side onclick events
Is there a best-practice or common way in JavaScript to have class members as
Is there a best practice for avoiding a browser freeze when loading an applet?
Is there any best practice data model for authentication/authorization scheme?
Is there a performance gain or best practice when it comes to using unique,
It may not be best practice but are there ways of removing unsused classes
Is there a way in Cocoa that is currently considered best practice for creating
Is there best practice for managing Object shared by 2 or more others Object.
I'm pretty new to code igniter. Is there best practice for serving different view
Is there some best practice or some recommended way how to validate forms in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.