DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Securing Your Software Supply Chain with JFrog and Azure
Register Today

Trending

  • Design Patterns for Microservices: Ambassador, Anti-Corruption Layer, and Backends for Frontends
  • Decoding eBPF Observability: How eBPF Transforms Observability as We Know It
  • Front-End: Cache Strategies You Should Know
  • How AI Will Change Agile Project Management

Trending

  • Design Patterns for Microservices: Ambassador, Anti-Corruption Layer, and Backends for Frontends
  • Decoding eBPF Observability: How eBPF Transforms Observability as We Know It
  • Front-End: Cache Strategies You Should Know
  • How AI Will Change Agile Project Management
  1. DZone
  2. Software Design and Architecture
  3. Microservices
  4. Using Redis For Session Storage

Using Redis For Session Storage

Shiv Kumar Ganesh user avatar by
Shiv Kumar Ganesh
·
Aug. 15, 13 · Interview
Like (1)
Save
Tweet
Share
16.83K Views

Join the DZone community and get the full member experience.

Join For Free

A few days back, I was just messing around with Redis and all of a sudden there was a necessity where I had to externalize the sessions from Apache Tomcat. Redis seemed to be a great option for this. It took a bit of tweaking, but by the end, things were as smooth as ever. I thought of designing the architecture to show how Redis can help us by being the ultimate session store with really low latency. The diagram below depicts the entire scenario with great precision.


Here's my explanation for the diagram above:

  1. Any request coming from the internet would be received by the web server first.  The web server is running with a load balancer configured.
  2. There would be multiple Tomcat instances running across the app layer which would be connected with the common Redis Server (I have not looked into Redis Cluster so am not mentioning it here).
  3. Next we would follow the traditional approach; any request coming from the internet would go through the load balancer which would then decide which container to send it to.
  4. Since different containers are connected to the same Redis server, and we have externalized the session management, even if one server goes down the sessions will remain intact and the other Tomcat containers would replace any downed servers, leaving behind a great experience. This model could be scaled pretty well.

This approach can easily scale up the web application and also is easy to set up. I would write a detailed article about the setup in some time.

Image: Courtesy http://shivganesh.com 

Redis (company) Session (web analytics)

Opinions expressed by DZone contributors are their own.

Trending

  • Design Patterns for Microservices: Ambassador, Anti-Corruption Layer, and Backends for Frontends
  • Decoding eBPF Observability: How eBPF Transforms Observability as We Know It
  • Front-End: Cache Strategies You Should Know
  • How AI Will Change Agile Project Management

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: