Redis Persistence Between Maintenances
apostolosvarvatis
HOBBYOP

2 months ago

I encountered an issue where I believed Redis was persistent during maintenance and restarts, but all my data was unexpectedly wiped out (maybe during the latest maintenance). How can I prevent this from happening in the future? Is there a setting I need to enable? I couldn't find anything on the settings page; am I missing something?

Thanks in advance!

Solved

3 Replies

Railway
BOT

2 months ago

Redis stores data in memory by default and will lose data on restarts or maintenance unless you attach a volume to your Redis service with a mount path of /data, which allows Redis to persist its RDB/AOF snapshots to disk across restarts.


Status changed to Awaiting User Response Railway 2 months ago


Railway

Redis stores data in memory by default and will lose data on restarts or maintenance unless you attach a [volume](https://docs.railway.com/volumes) to your Redis service with a mount path of `/data`, which allows Redis to persist its RDB/AOF snapshots to disk across restarts.

apostolosvarvatis
HOBBYOP

2 months ago

I have already done this as shown here:

Attachments


Status changed to Awaiting Railway Response Railway 2 months ago


2 months ago

We can see your volume is mounted at /data and Redis is successfully performing background saves to disk. Your current setup is correct, and data written going forward will persist across restarts and maintenance. The data that was previously lost was likely stored before the volume was attached, meaning it existed only in ephemeral storage and was not recoverable once the container restarted. Unfortunately, the previously lost data cannot be restored.


Status changed to Awaiting User Response Railway 2 months ago


Status changed to Solved apostolosvarvatis about 2 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...