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! 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
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Redis Stack for Application Modernization
Redis Stack for Application Modernization

Redis Stack for Application Modernization: Build real-time multi-model applications at any scale with Redis

Arrow left icon
Profile Icon Luigi Fugaro Profile Icon Ortensi
Arrow right icon
£19.99 £22.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (2 Ratings)
eBook Dec 2023 336 pages 1st Edition
eBook
£19.99 £22.99
Paperback
£27.99
Subscription
Free Trial
Renews at £16.99p/m
Arrow left icon
Profile Icon Luigi Fugaro Profile Icon Ortensi
Arrow right icon
£19.99 £22.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (2 Ratings)
eBook Dec 2023 336 pages 1st Edition
eBook
£19.99 £22.99
Paperback
£27.99
Subscription
Free Trial
Renews at £16.99p/m
eBook
£19.99 £22.99
Paperback
£27.99
Subscription
Free Trial
Renews at £16.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Redis Stack for Application Modernization

Introducing Redis Stack

Redis has achieved several important milestones since its inception in 2009, from taking the lead as the most popular key-value data store, according to the ranking published every month by the website DB-Engines (and the sixth among all database systems), up to establishing the record as the most downloaded container image on Docker. Not to mention that Redis has been the most loved database for five years in a row, according to the Developer Survey published by Stack Overflow in the years 2016-2021. And, for sure, you, or a friend of yours, have used it for some reason, work, or hobby.

If you are reading this book, chances are you have programmed an application using a Redis server, or at least you know what it is and what it is used for. In this chapter, we’ll recap what made Redis the most famous caching system in the world and we’ll share some anecdotes about the development undertaken by its creator, Salvatore Sanfilippo. We won’t stay long on the story of Redis, though, because this book is about application modernization. As you read through, you will discover how the original database, designed for speed and simplicity, has evolved to resolve many of the new challenges of this age, without compromising on the ease of adoption, flexibility, and, above all, speed.

Redis Stack is an extension of Redis presented in 2022, which introduces JSON, vector, and time series data modeling capabilities, all supporting real-time queries and searches. Redis Stack represents a new approach to providing a rich data modeling experience all within the same database server. It introduces features such as vector similarity search to query structured and unstructured data (for example, text, images, or audio files) and delivers probabilistic Bloom filters to efficiently resolve recurrent big data problems. Redis Stack is also a data platform that supports event-driven programming and introduces stream processing features. By the end of this chapter, you will understand what Redis Stack is and how it enhances the Redis server with many new capabilities. Above all, you will learn the motivation behind Redis Stack and why multi-model databases can increase the speed of technological innovation for organizations of all sizes. In this chapter, we are going to cover the following topics:

  • Exploring the history of Redis
  • The open source project
  • From key-value to multi-model real-time databases
  • Redis Stack deployment types

Technical requirements

To follow along with the examples in the chapter, you will need the following:

  • Redis Stack Server version 7.2 or later installed on your development environment. Alternatively, you can create a free Redis Cloud subscription to achieve a free plan and use a managed Redis Stack database. Refer to Chapter 3, Getting Started with Redis Stack.
  • The dataset used in the examples – a conversion of the rows in the popular MySQL World database to Redis Hash data types. Find and download it from this book’s repository if you’d like to test the examples that we propose in this chapter: https://github.com/PacktPublishing/Redis-Stack-for-Application-Modernization.

Exploring the history of Redis

Redis was conceived and designed in 2009 by the Italian software engineer Salvatore Sanfilippo as a solution to scaling LLOOGG, an online analytics server co-founded with Fabio Pitrola that empowered web admins to track user activities. Challenged by the scalability limitations of MySQL, Salvatore decided to rethink the concept of key-value storage and design something that would (admittedly) be different from Memcached, while preserving its simplicity and speed. The first beta release was shared on Google Code on February 25, 2009. A few months later, in September 2009, the first stable release, Redis 1.0, was published as a tar package of less than 200 KB.

Redis has been designed to offer an alternative for problems where relational databases (RDBMSs) are not a good fit because there is something wrong if we use an RDBMS for all kinds of work. However, in comparison to other data storage options that became popular when the NoSQL wave shook the world of databases (Memcached, the key-value data store released in 2003, or MongoDB, the document store released in 2009, and many more), Redis has its roots in computer science and makes a rich variety of data structures available. This is one of the distinguishing features of Redis and the likely reason that fostered its adoption by software engineers and developers – presenting data structures such as hashes, lists, sets, bitmaps, and so on that are familiar to software engineers so they could transfer the programming logic to data modeling without any lengthy and computationally expensive data transformation. Viewed in this light, we could say that Redis is about persisting the data structures of a programming language. An example of the simplicity of storing a Python dictionary in a Redis hash data structure follows:

user = {"name":"John",
        "surname":"Smith",
        "company":"Redis",
        "department":"Sales"}
r.hset("user:{}".format(str(2345)), mapping=user)

In the same way, adding elements to a Redis Set can be done using Python lists:

languages = ['Python', 'C++', 'JavaScript']
r.sadd("coding", *languages)

In these examples, the user dictionary and the languages list are stored without transformations, and this is one of the advantages that Redis data structures offer to developers: simplifying data modeling and reducing the transformational overhead required to convert the data in a format that can be mapped to the data store (thus reducing the so-called impedance mismatch).

There was a short gap between the first release and its adoption by Instagram and GitHub. If we try to dig into the reasons that made Redis so popular, we can mention a few, among which we count the speed and simplicity of deployment. Beyond the user experience, Redis is an act of dedication and passion, and as we read in Redis’s own manifesto, code is like poetry; it’s not just something we write to reach some practical result. People love beautiful stories and simplicity and everybody should fight against complexity.

What is surely true is that Redis is an idea to solve problems where relational databases, still tied to rigid paradigms, wouldn’t fit the purpose. It is the product of creativity, inspiration, and love for things done manually, where good design and craftsmanship intertwine to accomplish something that simply works. An intimate artwork. And we like to recall Salvatore’s words about the creative approach when writing Redis:

My wife claims I wrote it mostly while sitting on the WC for the first years, on a MacBook Air 11. Would be nice to tell her she is wrong, but she happens to be perfectly right about the matter.

From the most-used thinking room in Sicily to becoming the most-loved and used key-value database in the world, this is the story we have decided to tell in this book, and we are sure you will find the journey through the pages an exciting adventure.

One of the guiding principles behind Redis is being open source and driven by a community of enthusiast contributors. We’ll explore that in the next section.

The open source project

The success of a technical project is always measurable in terms of the innovation of the proposal, simplicity of use, exhaustive documentation, high performance, low footprint, and stability, among other aspects. However, and this is true for many things, at the end of the day what matters is the capacity to resolve a problem and the impact of the solution. Organizations that decide to add new technology to their stack face several challenges to understand, prototype, validate, and set up a plan to deploy test environments together with a release strategy, a maintenance plan, and, finally, a plan to develop competence. Success stories require careful planning. From these many perspectives, Redis is considered first-in-class, and in this book, we will expose many of the reasons that made Redis the de-facto standard among the in-memory data stores in the world. But even before digging into the features of Redis Stack, Redis, as an open source project, has undoubtedly added value to many businesses:

  • A variety of options exist to get it running close to the application. It is available as a managed service in every public cloud provider, it can be installed from the source code or as a binary file, and Docker images are available for all the versions and flavors.
  • It has good documentation and a command reference, together with examples (from the https://redis.io/ website).
  • It is straightforward to set up and test. The source code is self-contained and does not depend on external libraries.
  • Client libraries for the most popular programming languages are available and supported (Java, JavaScript, Python, Go, and C#/.NET).
  • The well-known and permissive BSD license grants the freedom to use, modify, and distribute Redis, among other advantages. Users can test and run Redis in production without any concerns.

These reasons, together with the fact that it’s very easy to learn Redis, make it an attractive option to set up and use. On a computer configured to build C projects, pulling the source code from the GitHub repository, compiling it, and running the server can be done in less than a minute:

git clone https://github.com/redis/redis.git
cd redis/
make
./src/redis-server &
./src/redis-cli PING
PONG

The open source project delivers the core Redis server plus additional utilities, such as these:

  • redis-cli, the command-line interface to administer the server and manage the data. This utility assists also in configuring scalable deployments with Redis Cluster and high availability with replication and Sentinel. Among other features, it includes auto-completion, online help for single commands (for example, HELP HSET), or by group of commands (for example, HELP @hash, to learn about the commands that can be used with the Hash data structure). Just type HELP to understand how to make use of the online help.
  • redis-benchmark, a simple benchmarking utility to perform batches of tests for different data structures. Useful to evaluate how well the server performs on determined hardware.
  • redis-sentinel, the agent that automates the management of replicated topologies and provides clients with a discovery service.
  • create-cluster, a utility useful to set up a Redis Cluster environment for testing.
  • redis-check-rdb and redis-check-aof, utilities to health check AOF and RDB persistence files.

Now that we have reviewed the basic principles behind Redis and its utilities, we are ready to dive into the world of data modeling. This journey will take us from relational databases to Redis core data structures, and we will see how the multi-model capabilities of Redis Stack simplify many data modeling problems.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Model, index, and search data using JSON and vector data types
  • Modernize your applications with vector similarity search, documents hybrid search, and more
  • Configure a scalable, highly available, and secure server using RedisInsight
  • Purchase of the print or Kindle book includes a free PDF eBook

Description

In modern applications, efficiency in both operational and analytical aspects is paramount, demanding predictable performance across varied workloads. This book introduces you to Redis Stack, an extension of Redis and guides you through its broad data modeling capabilities. With practical examples of real-time queries and searches, you’ll explore Redis Stack’s new approach to providing a rich data modeling experience all within the same database server. You’ll learn how to model and search your data in the JSON and hash data types and work with features such as vector similarity search, which adds semantic search capabilities to your applications to search for similar texts, images, or audio files. The book also shows you how to use the probabilistic Bloom filters to efficiently resolve recurrent big data problems. As you uncover the strengths of Redis Stack as a data platform, you’ll explore use cases for managing database events and leveraging introduce stream processing features. Finally, you’ll see how Redis Stack seamlessly integrates into microservices architectures, completing the picture. By the end of this book, you’ll be equipped with best practices for administering and managing the server, ensuring scalability, high availability, data integrity, stored functions, and more.

Who is this book for?

This book is for database administrators, database developers, software developers, and software architects who want to discover the powerful real-time, multi-model capabilities of the Redis Stack database. A basic understanding of Redis and databases in general, coupled with software development skills in at least one of Java, Python, C#, Golang, or JavaScript languages will help you understand the concepts covered in this book.

What you will learn

  • Get started with data modeling using JSON and hash documents, vectors, and time series
  • Implement microservices patterns and resolve typical use cases
  • Use probabilistic data structures to analyze datasets and streams
  • Integrate Redis Stack into your Java, Python, C#, Golang, and Node.js projects
  • Develop powerful data flows using triggers and stream processing features
  • Manage your database server for scalability, high availability, and security
  • Visualize and manage your data with RedisInsight

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 29, 2023
Length: 336 pages
Edition : 1st
Language : English
ISBN-13 : 9781837637591
Category :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 29, 2023
Length: 336 pages
Edition : 1st
Language : English
ISBN-13 : 9781837637591
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
£16.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
£169.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just £5 each
Feature tick icon Exclusive print discounts
£234.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just £5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total £ 112.97
Mastering PostgreSQL 15
£46.99
Building Data Science Applications with FastAPI
£37.99
Redis Stack for Application Modernization
£27.99
Total £ 112.97 Stars icon

Table of Contents

17 Chapters
Part 1: Introduction to Redis Stack Chevron down icon Chevron up icon
Chapter 1: Introducing Redis Stack Chevron down icon Chevron up icon
Chapter 2: Developing Modern Use Cases with Redis Stack Chevron down icon Chevron up icon
Chapter 3: Getting Started with Redis Stack Chevron down icon Chevron up icon
Chapter 4: Setting Up Client Libraries Chevron down icon Chevron up icon
Part 2: Data Modeling Chevron down icon Chevron up icon
Chapter 5: Redis Stack as a Document Store Chevron down icon Chevron up icon
Chapter 6: Redis Stack as a Vector Database Chevron down icon Chevron up icon
Chapter 7: Redis Stack as a Time Series Database Chevron down icon Chevron up icon
Chapter 8: Understanding Probabilistic Data Structures Chevron down icon Chevron up icon
Part 3: From Development to Production Chevron down icon Chevron up icon
Chapter 9: The Programmability of Redis Stack Chevron down icon Chevron up icon
Chapter 10: RedisInsight – the Data Management GUI Chevron down icon Chevron up icon
Chapter 11: Using Redis Stack as a Primary Database Chevron down icon Chevron up icon
Chapter 12: Managing Development and Production Environments Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(2 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Gabriel Cerioni Mar 12, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Redis Stack for Application Modernization is an exceptional guide that stands out in the tech publication sphere. This book not only demystifies the advanced features of Redis Stack but does so with an eloquent, hands-on approach that empowers developers and architects alike to build scalable, multi-model applications with ease.Right from the start, the book dives into the multi-model capabilities of Redis Stack, breaking down complex topics like vector databases and probabilistic data structures into digestible, easily understandable sections. The key feature discussions are a highlight, presenting modern solutions such as vector similarity searches and document hybrid searches, which are game-changers for application development.What I found particularly beneficial were the real-world examples that tied theory to practice, making application modernization a tangible goal rather than a daunting task. The book's clear instructions on configuring a scalable and secure server using RedisInsight give it a practical edge that is often missing in other tech books.Additionally, the inclusive approach of integrating Redis Stack with popular programming languages like Java, Python, C#, Golang, and Node.js ensures that no reader is left behind. Whether you're looking to sharpen your existing database skills or venture into new territories with microservices and stream processing features, this book is a comprehensive guide that covers it all.By the end, I was not only educated on the administrative best practices for managing a Redis server but was also equipped with actionable insights on ensuring scalability and high availability. It's evident that this book is crafted for those who aim to stay at the forefront of database technology and application development.In conclusion, Redis Stack for Application Modernization is a must-read for any professional looking to modernize applications at scale. It’s a well-rounded resource that earns a solid five stars for its breadth of knowledge, clarity of writing, and practical applicability.
Amazon Verified review Amazon
Owen Taylor Mar 21, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The style is human-friendly, with many examples and good reasoning for identifying why a particular strategy is applicable or not.Redis has grown to be much much more than a simple key/value store, this book shines light on all that is now possible.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.