A Gentle Intro for Redis

A Gentle Intro for Redis

The Redis website defines its product to be an in-memory data structure store which support strings, hashes, sets and so on. For the in-memory part, it means that -When the server is started- the processing of the database is done in RAM not in the hard-disk which of-course is much faster as the time for accessing the desk is no longer needed.

The Redis website defines its product to be an in-memory data structure store which support strings, hashes, sets and so on.

For the in-memory part, it means that -When the server is started- the processing of the database is done in RAM not in the hard-disk which of-course is much faster as the time for accessing the desk is no longer needed.

Now if the file is loaded in RAM, how does Redis stay persistent?

The persistence is handled in Redis by 2 methods:

  • Redis database files (RDB) (activated by default)

  • Append-only file (AOF)

First, RDB:

It takes snapshots of the data creating point-in-time copies of the data. It is like make a backups after every specific time or changes in the database. Generally it is perfect for backups.

I find it easy to visualize it as a GitHub Repo that keeps track of your changes but it self-commits after a certain number of changes or some specific time.

Second, AOF:

It depends on logs to reconstruct the database when the server is restarted. When you start your Redis server, AOF keeps track of the changes you make to the database and keeps logs describing it. When the server is restarted, Redis makes sure to reconstruct the original database using these log files.

This way the data is always persistent.

This file is named “_Appendonly.aof_” and kept in the same folder where you installed Redis.

A last note about data persistence, The 2 methods don’t actually oppose each other and can be used together.

redis rdb aof

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Redis Transactions & Long-Running Lua Scripts

Redis Lua scripting is the popularly recommended approach for handling transactions. Learn the common Lua Scripts error and how to handle for sentinel systems. Redis offers two mechanisms for handling transactions – MULTI/EXEC based transactions and Lua scripts evaluation. Redis Lua scripting is the recommended approach and is fairly popular in usage.

What is Redis - All You Need To Know About Redis

What is Redis and why use it? Our Redis guide tells you all you need to know about Redis, a highly performant in-memory data store and caching system. Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker.

Redis 6 arrives with multithreading for faster I/O

With I/O threading enabled, the new version of Redis can serve up to twice as many operations as before on a single instance, say creators.Among the most significant changes in Redis 6 is threading for I/O, a long-desired feature now available as an option. With I/O threading enabled, Redis’s creators claim the database can serve up to twice as many operations as before on a single instance.

Redis Labs Partners with Microsoft to Deliver a New Redis Cache

In a recent blog post, Microsoft announced a new partnership with Redis Labs to deliver Redis Enterprise as newly, fully integrated tiers of Azure Cache for Redis.

How to implement Redis in Spring Boot using Spring Data Redis & Jedis

I will show you how to implement Redis in Spring Boot Application using Spring Data Redis and Jedis Client