
Episode 17 · Season 11
Session Management - Architecting State Data
About this episode
Most modern business applications have some state or context. This model can be easy to implement in a stand-alone application. However, multi-user applications like web sites can be a challenge when you consider session management. While security is often a hot topic, tracking data correctly can be an issue to itself. We need to build our architecture to handle the ways we pass around such data.
Session Management Is More Than Global Values
One of the "rookie mistakes" of session management is the use of it as a sort of global bucket. It is not uncommon to see all manner of objects and values shoved into the session. While this approach makes it easier to pass values, it is not secure and wastes resources. Therefore, it is important to think through what values should be stored. As with manner, other design decisions, when in doubt, leave it out (of the session). There should be a strong reason for each item you store at the user or application level.
Now Vs. Later Comparison
While we just said it makes sense to keep the session small, there is also caching to take into account. There are valid reasons to store values in the session rather than make multiple calls to retrieve them. Thus, this is not an area of architecture that is always cut and dry. There are application-specific requirements that will come into play. Keep in mind the trade-off of memory to cache data and network traffic to load it.
Design, Not Implementation
We can always kick decisions like this down the road. The implementation team can make choices related to caching data and session management. However, that can lead to ad-hoc storage and other challenging to maintain situations. It is worth the time and effort to architect your session situation. Future developers and maintainers will thank you,
More from Develpreneur: Become a Better Developer and Entrepreneur
A handful of people love your MVP. Their suggestions keep coming, and AI helps you turn those requests into working features quickly. The product is growing. Whether it is growing in the right directi…
Your team can generate an interface faster than ever. Meanwhile, customers are still staring at confusing error messages, waiting for pages to load, and trying to figure out what happens after they cl…
After a year of deadlines, long hours, and projects that seemed determined to last forever, Thanksgiving offers a chance to pause and enjoy what all that effort has made possible. In this Thanksgiving…
The holiday is almost here, but your brain is still at work. There is something to finish, something to check, and probably something you could squeeze in before everyone arrives. Closing the laptop s…
Building a successful business requires more than developing a great product. As companies grow, they face new challenges involving customer expectations, operational efficiency, financial decisions,…