Cloud Native Spring in Action by Thomas Vitale
Author:Thomas Vitale [Vitale, Thomas]
Language: eng
Format: epub, mobi
Publisher: Manning Publications Co.
Published: 2023-01-11T23:00:00+00:00
9.4 Distributed session management with Redis
In the previous chapters, I often highlighted how cloud native applications should be stateless. We scale them in and out, and if they werenât stateless, we would lose the state every time an instance is shut down. Some state needs to be saved, or the applications would probably be useless. For example, Catalog Service and Order Service are stateless, but they rely on a stateful service (the PostgreSQL database) to permanently store the data about books and orders. Even if the applications are shut down, the data will survive and be available to all the application instances.
Edge Service is not dealing with any business entities it needs to store, but it still needs a stateful service (Redis) to store the state related to the RequestRateLimiter filter. When Edge Service is replicated, itâs important to keep track of how many requests are left before exceeding the threshold. Using Redis, the rate limiter functionality is guaranteed consistently and safely.
Furthermore, in chapter 11 youâll expand Edge Service to add authentication and authorization. Since itâs the entry point to the Polar Bookshop system, it makes sense to authenticate the user there. Data about the authenticated session will have to be saved outside the application for the same reason as the rate limiter information is. If it wasnât, the user might have to authenticate themselves every time a request hits a different Edge Service instance.
The general idea is to keep the applications stateless and use data services for storing the state. As you learned in chapter 5, data services need to guarantee high availability, replication, and durability. In your local environment, you can ignore that aspect, but in production youâll rely on the data services offered by cloud providers, both for PostgreSQL and Redis.
The following section will cover how you can work with Spring Session Data Redis to establish distributed session management.
Download
Cloud Native Spring in Action by Thomas Vitale.mobi
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7793)
Grails in Action by Glen Smith Peter Ledbrook(7705)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(6678)
Azure Containers Explained by Wesley Haakman & Richard Hooper(6671)
Running Windows Containers on AWS by Marcio Morales(6196)
Kotlin in Action by Dmitry Jemerov(5076)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(4977)
Combating Crime on the Dark Web by Nearchos Nearchou(4565)
Microsoft Cybersecurity Architect Exam Ref SC-100 by Dwayne Natwick(4457)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4426)
The Ruby Workshop by Akshat Paul Peter Philips Dániel Szabó and Cheyne Wallace(4232)
The Age of Surveillance Capitalism by Shoshana Zuboff(3964)
Python for Security and Networking - Third Edition by José Manuel Ortega(3803)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3515)
The Ultimate Docker Container Book by Schenker Gabriel N.;(3470)
Learn Wireshark by Lisa Bock(3377)
Mastering Python for Networking and Security by José Manuel Ortega(3363)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3338)
Blockchain Basics by Daniel Drescher(3308)
