Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use Spring Boot session without Redis?

Looking at the Spring Boot docs I only found examples to use session with Redis, Is it possible to use it without Redis?

like image 295
Fabio Avatar asked Oct 27 '15 23:10

Fabio


People also ask

Can we use session in spring boot?

HTTPSession is stored in the database and not in the server disk/ memory. Spring sessions a transparent replacement in Spring Boot. We don't need any code change (few configurations) and adding spring session as dependency in our project. Spring session make it easy to work in clustered applications.

What is spring session data Redis?

Spring Session Data Redis - provides SessionRepository and ReactiveSessionRepository implementation backed by Redis and configuration support. Spring Session JDBC - provides SessionRepository implementation backed by a relational database and configuration support.


1 Answers

As said in another answer: Yes, you can change the Session persistence backend by changing the SessionRepository implementation.

And, there is an built-in alternatives provided by Spring-Session, which is MapSessionRepository for which you can save session in a Map.

In the samples of Spring Session, there is a sample using Hazelcast as persistence backend. It is utilizing the above-mentioned MapSessionRepository with the Map instance created by Hazelcast.

like image 162
Adrian Shum Avatar answered Sep 28 '22 00:09

Adrian Shum