Generally you can just use file for session, but something like a load balancer you need database.
File used to be the default, I have no idea why now it's database.
But just because it's default doesn't mean you have to do it that way.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
as a default thing in Laravel 11.x, Session Driver is Database.
But I want to think a little bit deeper, how much if it is taken as automatic, although it puts some effect on the duration of the queries (try in Laravel Telescope), which will find that the files are less than the Database by about 100ms (files session driver is winer here), I know it is relatively small but if there are many users at the same time on the database, I think it will have a negative effect?
The same question but in the opposite direction, what will happen if the driver files and there are many users?
@Thomas_Emad I don't know what kind of "technical way" you're after.
Session reads and writes use a primary key. That means the time complexity of a query is at worst O(log n). I could populate the session table with millions of rows, but I know it wouldn't affect query times in any real way because of how databases work.
Session data is read once per request and changes are flushed to the DB once, at the end of the request. So you'll have one lookup and one write per request. The delay of these queries is insignificant compared to the boot time of the app. And yes, even if you use Octane.
We've used database sessions on live apps for years without issues. If you have a very high traffic site, other parts of your app will start breaking before your sessions do. But if you need better session performance, you can always switch to Redis.
Please or to participate in this conversation.