Reader small image

You're reading from  Redis Stack for Application Modernization

Product typeBook
Published inDec 2023
PublisherPackt
ISBN-139781837638185
Edition1st Edition
Right arrow
Authors (2):
Luigi Fugaro
Luigi Fugaro
author image
Luigi Fugaro

Luigi Fugaro's first encounter with computers was in the early 80s when he was a kid. He started with a Commodore Vic-20, passing through a Sinclair, a Commodore 64, and an Atari ST 1040, where he spent days and nights giving breath mints to Otis. In 1998, he started his career as a webmaster doing HTML, JavaScript, Applets, and some graphics with Paint Shop Pro. He then switched to Delphi, Visual Basic, and then started working on Java projects. He has been developing all kinds of web applications, dealing with backend and frontend frameworks. In 2012, he started working for Red Hat and is now an architect in the EMEA Middleware team. He has authored WildFly Cookbook and Mastering JBoss Enterprise Application Platform 7 by Packt Publishing.
Read more about Luigi Fugaro

Mirko Ortensi
Mirko Ortensi
author image
Mirko Ortensi

Mirko Ortensi earned a degree in Electronic Engineering and a Master's degree in Software Engineering. Mirko's career has spanned several roles from Software Engineering to Customer Support, particularly centered around distributed database systems. As a Senior Technical Enablement Architect at Redis, Mirko shares technical knowledge about Redis's products and services.
Read more about Mirko Ortensi

View More author details
Right arrow

Preface

Redis Stack for Application Modernization is written by industry experts from Redis, making this an insightful reference for database administrators and developers, with best practices to administer and manage the server, scalability, high availability, data integrity, stored functions, and more.

Modern applications require efficient operational and analytical capabilities and must ensure predictable performance regardless of the workload. Redis is a de facto standard caching system, with real-time response and flexible data types that fulfill all the different data modeling requirements. This book introduces you to Redis Stack, an extension of Redis presented in 2022, and it guides you through the multiple data modeling capabilities, together with examples to perform real-time queries and searches. Redis Stack represents a new approach to providing a rich data modeling experience all within the same database server.

You will learn how to model and search your data in the JSON and hash data types and work with features such as vector search, which adds semantic search capabilities to your application (for example, to search for similar texts, images, or audio files). You will understand how to use the probabilistic Bloom filters to resolve efficiently recurrent big data problems. Next, we dive into the strengths of Redis Stack as a data platform, show use cases to manage database events, and introduce stream processing features. Scenarios to use Redis Stack in microservices architectures complete the picture.

Who this book is for

This book is for software developers, software architects, and database administrators who want to discover the powerful real-time, multi-model capabilities of the Redis Stack database.

You will work with JSON and hash documents, vectors, time series models, probabilistic data structures, and stream processing, with an eye on the performance and security of the database and the integrity of the data.

The prerequisite to reading this book is a basic understanding of Redis and databases in general and software development skills in at least one of the Java, Python, C#, Golang, or JavaScript languages.

What this book covers

Chapter 1, Introducing Redis Stack, introduces you to Redis Stack, its differences with Redis, and why Redis can’t be considered as a caching system only, but a full-fledged database, augmenting and replacing relational databases in many use cases.

Chapter 2, Resolving Use Cases with Redis Stack, explores how Redis Stack extends Redis’s well-known capabilities thanks to its modular architecture, thus becoming a document store, a vector database, and a time series database. The probabilistic data types help to efficiently resolve many problems. Redis Stack is a modern real-time solution that can replace traditional relational databases in many use cases.

Chapter 3, Getting Started with Redis Stack, teaches you how Redis Stack can be installed in a variety of methods and on the most popular operative systems. This means that Redis Stack can be installed easily on Linux, macOS, and Windows systems using native installation packages (Linux tarballs are also available). Docker images are also available in Docker Hub. In addition, Redis Stack is available as a service with Redis Cloud.

Chapter 4, Setting Up Client Libraries, describes how the Redis Stack ecosystem provides a set of client libraries to ease developers’ lives. Those include libraries for the most used programming languages such as Python, Java, GoLang, C#, and JavaScript. In addition to client libraries, Redis provides a framework used for object mapping: Redis OM.

Chapter 5, Redis Stack as a Document Store, presents Redis Stack’s capability to perform real-time queries and searches against the hash and JSON types. From full-text to tagging, from aggregation to auto-completion, and the new vector search, Redis Stack can be used as a document store with advanced features.

Chapter 6, Redis Stack as a Vector Database, highlights why, among the advanced search features of Redis Stack, Vector Search stands as a core feature and deserves a chapter on its own. You will learn data modeling concepts and how to perform similarity searches for recommendation engines.

Chapter 7, Redis Stack as a Time Series Database, explains how Redis Stack, as a multi-model, real-time data structure server, can store data using data points for time series. Each data point can be enriched by adding metadata, known as labels. Each data point can have multiple labels that can be used for filtering, searching, querying, and aggregations using the built-in reducer functions.

Chapter 8, Understanding Probabilistic Data Structures, explores probabilistic data structures, which are a group of data structures that give a very reasonable approximation of an answer in just a fraction of the usual time and use very little memory. Questions such as “Has the user paid from this location already?”, “What are the 10 players with the highest score?”, or “How many unique users have played this song?” address the typical use cases for these data structures

Chapter 9, Programmability of Redis Stack, describes how, in addition to the traditional Redis Lua scripts and functions, Redis Stack includes a JavaScript serverless engine for transaction, batch, and event-driven data processing, allowing users to write and run their functions on data stored in Redis. With this capability, the database reacts to events occurring in the data while taking advantage of different Redis data structures and modules and promoting interoperability between them.

Chapter 10, RedisInsight – the Data Management GUI, covers RedisInsight, which is a graphical desktop manager that connects to Redis Stack databases and offers useful visualization tools for the different data models that can be stored.

Chapter 11, Using Redis Stack as a Primary Database, explains how Redis, as the leading real-time database, is used often as an in-memory cache, backed by a primary database. However, Redis Stack extends Redis with multi-model capabilities and is a good fit in many use cases to replace a traditional relational database. In this chapter, you will learn about the configuration to work with Redis Stack as the only primary database serving multi-model applications

Chapter 12, Managing Development and Production Environments, explains how moving from a development environment to deploying and running Redis at scale and monitoring the systems where the databases are running requires effort and the implementation of several maintenance duties. Redis Enterprise and Redis Cloud alleviate system and database administrators from their duties and can be managed using an intuitive UI.

To get the most out of this book

It is important that you have an understanding of database platforms, specifically in the areas of data insertion, updating, and deletion. Additionally, having a basic knowledge of SQL would be beneficial. You should also be comfortable with executing commands using a command-line interface, and familiarity with Unix-like systems is a plus. Prior experience with Redis or similar technologies is not required.

Software/hardware covered in the book

Operating system requirements

Redis Stack 7.2 or later

Windows, macOS, or Linux

RedisInsight 2.36 or later

Windows, macOS, or Linux

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Redis-Stack-for-Application-Modernization. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “However, since Python version 3.3, a tool named virtualenv was integrated into Python’s standard library.”

A block of code is set as follows:

client = redis.Redis(host='127.0.0.1', port=6379,
username='<YOUR_USERNAME>',
password='<YOUR_PASSWORD>')
client.set("Redis", "Stack")
print(client.get("Redis"))

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

<dependency>
    <groupId>redis.clients</groupId>
    <artifactId>jedis</artifactId>
    <version>5.0.0</version>
</dependency>

Any command-line input or output is written as follows:

$ apt install python3.9-venv

Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “The application prompts you first to establish a connection with a Redis database. Start this process by clicking on the ADD REDIS DATABASE button.”

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at customercare@packtpub.com and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you’ve read Redis Stack for Application Modernization, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

  1. Scan the QR code or visit the link below

https://packt.link/free-ebook/9781837638185

  1. Submit your proof of purchase
  2. That’s it! We’ll send your free PDF and other benefits to your email directly
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Redis Stack for Application Modernization
Published in: Dec 2023Publisher: PacktISBN-13: 9781837638185
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.
undefined
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 $15.99/month. Cancel anytime

Authors (2)

author image
Luigi Fugaro

Luigi Fugaro's first encounter with computers was in the early 80s when he was a kid. He started with a Commodore Vic-20, passing through a Sinclair, a Commodore 64, and an Atari ST 1040, where he spent days and nights giving breath mints to Otis. In 1998, he started his career as a webmaster doing HTML, JavaScript, Applets, and some graphics with Paint Shop Pro. He then switched to Delphi, Visual Basic, and then started working on Java projects. He has been developing all kinds of web applications, dealing with backend and frontend frameworks. In 2012, he started working for Red Hat and is now an architect in the EMEA Middleware team. He has authored WildFly Cookbook and Mastering JBoss Enterprise Application Platform 7 by Packt Publishing.
Read more about Luigi Fugaro

author image
Mirko Ortensi

Mirko Ortensi earned a degree in Electronic Engineering and a Master's degree in Software Engineering. Mirko's career has spanned several roles from Software Engineering to Customer Support, particularly centered around distributed database systems. As a Senior Technical Enablement Architect at Redis, Mirko shares technical knowledge about Redis's products and services.
Read more about Mirko Ortensi