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

  • SEARCH
  • Home
  • 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 7694635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:21:51+00:00 2026-05-31T21:21:51+00:00

When is it best to use database as a session store in PHP? I

  • 0

When is it best to use database as a session store in PHP? I know that 1 instance will be when I am sharing request load across multiple servers, I will need to maintain session state across those servers.

An article i am currently reading http://onlamp.com/pub/a/php/excerpt/webdbapps_8/index.html?page=2 says

Using files as the session store is adequate for most applications in
which the numbers of concurrent sessions are limited

I do not get why the number of concurrent sessions should affect the preferred session store.

Are there other reasons why I should choose to store session data in a database?

  • 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-31T21:21:52+00:00Added an answer on May 31, 2026 at 9:21 pm

    Storing a large amount of data in files can get slow as you have to search through large amounts of possibly unrelated data to the page you are currently serving up.

    Interfaces for interacting with data in files are also not as streamlined as interfaces, to, say, MySQL – MySQL is built for this sort of thing, while single files aren’t really.

    Concurrency is another issue – databases will handle it for you if different users of your website are simultaneously trying to read and write data – this happens more often as the user base becomes larger. Doing these tasks simultaneously is possible with a database, but much more difficult with storing information in files. You would end up having to program some synchronization code, and that may get messy.

    If you expect your userbase to grow over time, then it may be best to immediately design your program around a database, so that you may not have to switch as users start to wait on other requests being filled before their page gets loaded.

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

Sidebar

Related Questions

What is the best way to use an embedded database, say sqlite in Python:
best solution for use access in project for database with security i need to
What is the best way to use SQL Server 2008 as a development database,
What is the best currency format to use in my database in conjunction with
Is CPAN DBI the best database interface to use in Perl for general database
This question is about best use scenarios in projects with ORMs like NHibernate, Subsonic,
What are the best use cases for anonymous types? It would seem to me
Best to use an example to describe the problem. Lets say I have a
Which component is best to use for receiving HTTP requests in Delphi application?
When using divs when is it best to use a class vs id ?

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.