DEV Community

Discussion on: ORMs, Lazy Loading and Web Applications

Collapse
 
jonathan_hepp profile image
Jonathan Hepp

First, arguably nothing scales very well if badly implemented.
And second, not every software is Twitter. There is a huge realm of enterprise software where the domain and the user base is well defined enough that throwing out the context after every request would be a waste. Like I said, use cases.
Furthermore, the application doesn't even have to stick to one model or another, large systems can define a context for entities that are to be discarded after every request, like reporting data. And have another context attached to session for data related to the user. It is even possible to have a specific context that is application scoped, and never gets destroyed, that can hold general configuration data.
That's what profiling is for.