Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Redis

You're reading from   Learning Redis Design efficient web and business solutions with Redis

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781783980123
Length 318 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Vinoo Das Vinoo Das
Author Profile Icon Vinoo Das
Vinoo Das
Arrow right icon
View More author details
Toc

Persistence handling in Redis


Redis provides a wide range of options for persisting data. These mechanisms help in deciding what kind of persistence model we need for our data, and that solely depends on the kind of data we want to store in Redis. The four options that we have in Redis are as follows:

  • Persisting via the RDB option

  • Persisting via the AOF option

  • Persisting via combination of AOF and RDB option

  • Not persisting at all

Let's run a simple program and see the importance of persistence mechanism, because then only we can appreciate the importance of persistence. Follow the steps and see for yourself how lack of persistence can cause data loss:

  1. Start your Redis server.

  2. Open a Redis client command prompt.

  3. Execute the command SET msg 'temporary value'.

  4. Quickly kill the Redis server manually, either by Kill-9 option in Linux or through close option in Command Prompt in windows.

  5. Restart your Redis server.

  6. Execute the command get msg.

    Get msg without persistence handling

Persisting via the RDB option...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime