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

Ask A Question

Stats

  • Questions 192k
  • Answers 192k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could use the DATEPART() function SELECT * FROM record… May 12, 2026 at 6:21 pm
  • Editorial Team
    Editorial Team added an answer Looks like it is a width issue. Try changing the… May 12, 2026 at 6:21 pm
  • Editorial Team
    Editorial Team added an answer Only table-valued functions can be used in the FROM clause.… May 12, 2026 at 6:21 pm

Related Questions

I am pretty well versed with SQL Server, MySQL, Oracle etc but putting these
Is there a best practice for avoiding a browser freeze when loading an applet?
Is there a best practice for accessing C++ native COM functions to interop from
Is there a best practice for where configuration files should be stored in a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.