royclarkson / spring-rest-service-oauth

A simple OAuth protected REST service built with Spring Boot and Spring Security OAuth
Apache License 2.0
664 stars 339 forks source link

How to make this project scalable? #40

Open soulmachine opened 9 years ago

soulmachine commented 9 years ago

Since this project uses clients.inMemory(), it stores all access tokens in a single machine's memory, which makes it impossible to run multiple servers behind a load balancer.

To make this project scalable, I come up with three ideas for now:

  1. Use clients.jdbc() and store tokens into database
  2. Store tokens in Redis.
  3. Use JwtTokenStore. Since JWT is a kind of self-contained token, it is stateless and should be scalable.

As to 2 and 3, I don't know how to do it exactly.

Any ideas?