Improve API Performance using Redis, MYSQL in Spring Boot App

Making faster responses and decreasing dependency on expensive DB query.

Md Sajedul Karim
Javarevisited

--

Image Credit — Wikipedia

More often during API design, each API may server respond after querying data from a database or from external API calling. Sometimes there are some tables those data are not frequently changed, which means those tables are not transactional.

Database query or external API calls are very much expensive. In this case, we may cache those data into faster storage and server our client from that storage instead of fetch from there.

To achieve this goal, Redis has come. It not only caches data but also persistent with the database periodically and also it works in the distributed system.

Redis stands for Remote Dictionary Server, is a Keystore-based, fast, open-source in-memory-based data store. Its main usages are used as a database, cache, message broker, and queue.

According to the website Redis.io:

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker.

Redis support data types like string, lists, hashes, bitmaps, geospatial indexes…

--

--

Md Sajedul Karim
Javarevisited

Back-end developer, Spring, JAVA, Distributed system, AWS, Google Cloud, Docker, CD/CI, Kubernetes, databases. https://www.linkedin.com/in/sajedulkarim/