Search code examples
redisspring-data-jpaspring-dataredisson

Relational DBMS model migration to Redis


I need to migrate my Spring Boot app to Redis instead of some useless relational DBMS (i need some scalability among other reasons). I made some research but couldn't make clear some questions before the start:

  1. Should i use Redisson as Hibernate cache
  2. Should i somehow modify my model/entities to use 'em in NoSQL Redis? The relations in my model are not primitive and i wonder should i perform any steps to port the model to run under Redis?

Thanks in advance for any assist.


Solution

  • You should think around following:

    1. Access Patterns: These help decide which NoSQL to chose. Redis is a Key-Value store. All the access patterns are key based. It doesn't have a query language.

    2. Architecture: Redis is completely in-memory and therefore amazingly fast. It is one of the most popular cache solutions. However, if you use it as Database then work out the pricing as Memory is costly than disk space. Moreover, there is a minor chance to lose data if the cluster crashes and data has not yet been replicated to disk.

    3. If you are able to tick all the boxes then I would suggest to keep it simple and use a Java Client like Jedis rather than Redisson.

    4. You will have to write a new DAO layer to adapt to key based access patterns.