2 ms·
Because it happens. Typically in places where it shouldn't (e.g. bad programming) but sometimes it does (e.g. enormously complex active system state.) The poin
by ecaron 14y ago
Because it happens. Typically in places where it shouldn't (e.g. bad programming) but sometimes it does (e.g. enormously complex active system state.)
The point is that there are solutions offering equivalent speed without that barrier, so why select a technology that has limitations?
- batista 14y ago"Because it happens" is not a very good technical answer. Anything can happen, even 1GB session data. But even anything approaching even half a MB of session data I would take as an architectural failure, and work to fix it, instead of letting it dictate what tools I use (ie. redis vs memcached). >The point is that there are solutions offering equivalent speed without that barrier, so why select a technology that has limitations? Because all decisions have tradeoffs and it more wise to depend on your particular use case to choose than to depend on a scenario (> 1MB session data) that can only happen with a seriously fucked up application design.
- disordinary 14y agoYou can easily get to 1mb if you follow the cache everything mantra that reddit is using here.
- nostrademons 14y agoWhy in sessions, though? Why not cache everything as uniquely-identified resources and store only the resource ID in the session? That way, resources can be shared across different sessions. I'm trying to think of a case where a user's actions (that's what's supposed to be in sessions, right?) can result in 1M of data and drawing a blank. Maybe if they're uploading images or video transiently, like in Google's Search-by-Image feature, but even that seems like a case where you should upload the image permanently and just store a reference to it in the session. Edit: Answered my own question: oftentimes it's useful to store a history of the user's recent actions in their session, because then you can build a more responsive, more tailored UI. You can save transient data they've already entered, avoid showing them promos they've already indicated no interest in, and potentially use it to predict useful things to show them next. Even then, though, it'd take 500 pageviews at 2K apiece (which is a very generous estimate) to hit a meg of data.
- Morg 14y agoNO ffs NO. There is absolutely no reason to store anything but the session ID in a session cookie. You can keep it in the js, so why use session ? multiple pages ? dude you're living in the past.