Mastering Redis
eBook - ePub

Mastering Redis

  1. 366 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering Redis

Book details
Book preview
Table of contents
Citations

About This Book

Take your knowledge of Redis to the next level to build enthralling applications with ease

About This Book

  • Detailed explanation on Data structure server with powerful strings, lists, sets, sorted-sets, and hashes
  • Learn to Scale your data with Redis Cluster's distributed setup
  • This is a fast paced practical guide full of screenshots and real work examples to help you get to grips with Redis in no time.

Who This Book Is For

If you are a software developer with some experience with Redis and would now like to elevate your Redis knowledge and skills even further, then this book is for you.

What You Will Learn

  • Choose the right Redis data structure for your problem
  • Understand Redis event-loop and implement your own custom C commands
  • Solve complex workflows with Redis server-side scripting with Lua
  • Configure your Redis instance for optimal memory management
  • Scale your data in a distributed manner with Redis Cluster
  • Improve the stability of your Redis solution using Redis Sentinel
  • Complement your existing database and NoSQL environment with Redis
  • Exploit a wide range of features provided by Redis to become a DevOps expert.

In Detail

Redis is the most popular, open-source, key value data structure server that provides a wide range of capabilities on which multiple platforms can be be built. Its fast and flexible data structures give your existing applications an edge in the development environment.

This book is a practical guide which aims to help you deep dive into the world of Redis data structure to exploit its excellent features. We start our journey by understanding the need of Redis in brief, followed by an explanation of Advanced key management. Next, you will learn about design patterns, best practices for using Redis in DevOps environment and Docker containerization paradigm in detail. After this, you will understand the concept of scaling with Redis cluster and Redis Sentinel, followed by a through explanation of incorporating Redis with NoSQL technologies such as Elasticsearch and MongoDB. At the end of this section, you will be able to develop competent applications using these technologies. You will then explore the message queuing and task management features of Redis and will be able to implement them in your applications. Finally, you will learn how Redis can be used to build real-time data analytic dashboards, for different disparate data streams.

Style and approach

This is a hands on guide full of easy-to-follow examples, that illustrate important concepts and techniques to solve complex problems with Redis.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Mastering Redis by Jeremy Nelson in PDF and/or ePUB format, as well as other popular books in Computer Science & Databases. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781783988181
Edition
1

Mastering Redis


Table of Contents

Mastering Redis
Credits
About the Author
About the Reviewers
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
The philosophy behind Redis
What this book covers
Earn your Mastering Redis Open Badge
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Why Redis?
Is Redis right for me?
Experimenting with Redis
Popular usage patterns
Redis isn't right because …try again soon!
Summary
2. Advanced Key Management and Data Structures
Redis keys
Redis key schema
Key delimiters and naming conventions
Manually creating a Redis schema
Deconstructing a Redis object mapper
Key expiration
Key cautions
Big O notation
Computing big O notation for custom code
Reviewing the time complexity of Redis data structures
Strings
Hashes
Lists
Sets
Sorted sets
Advanced sorted set operations
Bitstrings and bit operations
HyperLogLogs
Summary
3. Managing RAM – Tips and Techniques for Redis Memory Management
Configuring Redis
Master-slave
32-bit Redis
About the INFO memory
Key expiration
LRU key evictions
Creating memory efficient Redis data structures
Small aggregate hashes, lists, sets, and sorted sets
Bits, bytes, and Redis strings as random access arrays
Optimizing hashes for efficient storage
Hardware and network latencies
Operating system tips
Summary
4. Programming Redis Part One – Redis Core, Clients, and Languages
Redis internals
Understanding redis.h and redis.c
Getting ready for Redis development with Git
Exercise – creating your own redis command
Redis Serialization Protocol (RESP)
Pipelining
Redis RDB format
Coroutines using Redis and Python
Todo list application using Node.js and Redis
Replication and public access
Summary
5. Programming Redis Part Two – Lua Scripting, Administration, and DevOps
The use of Lua in Redis
Using KEYS and ARGV with Redis
Advanced Lua scripting with Redis
MARC21 ingestion
Online Storefront Paper Stationery
Interoperability using JSON-LD, Lua, and Redis
Redis Lua Debugger
Programming Redis administration topics
Master-Slave replication
Transactions with MULTI and EXEC
Redis role in DevOps
Summary
6. Scaling with Redis Cluster and Sentinel
Approaches to partitioning data
Range partitioning
List partitioning
Hash partitioning
Composite partitioning
Key hash tags
Clustering Redis with Twemproxy
Testing Twemproxy with Linked Data Fragments server
Redis Cluster background
Overview of running Redis Cluster
Using Redis Cluster
Live reconfiguration and resharding Redis cluster
Failover
Replacing or upgrading nodes in Redis Cluster
Monitoring with Redis Sentinel
Sentinel for Area Code List Partition
Summary
7. Redis and Complementary NoSQL Technologies
The proliferation of NoSQL
Redis as an analytics complement to MongoDB
Redis as a preprocessor complement to ElasticSearch
Using Redis and ElasticSearch in BIBCAT
ElasticSearch, Logstash, and Redis
Redis as a smart cache complement to Fedora Commons
Summary
8. Docker Containers and Cloud Deployments
Linux containers
Docker basics with Redis
Layers in Docker images
Docker filesystem backends
Building images with a Dockerfile
Hosting and publishing Docker images
Docker and Redis issues
Packaging your application with Docker Compose
Redis and AWS
Dedicated cloud hosting options
Redis Labs
DigitalOcean Redis
Summary
9. Task Management and Messaging Queuing
Overview of Redis Pub/Sub
Pub/Sub RESP replies
SUBSCRIBE and UNSUBSCRIBE RESP Arrays
PSUBSCRIBE and UNSUBSCRIBE arrays
Pub/Sub with Redis CLI
Redis Pub/Sub in action
First workstation using Python Pub/Sub
Second workstation Node.js Pub/Sub
Third workstation Lua Client Pub/Sub
Redis keyspace notifications
Task management with Redis and Celery
GIS and RestMQ
Adding task management with RestMQ
Messaging with Redis technologies
Messaging with Disque
Summary
10. Measuring and Managing Information Streams
Extracting, transforming, and loading information with Redis
Extracting JSON to transform into RESP
Security considerations when managing Redis
Redis protected mode
Command obfuscation
Operational monitoring with a Redis web dashboard
Machine learning and Redis
Naïve Bayes and work classification
Creating training and testing datasets
Extracting word Tokens from BIBFRAME Works
Applying Naïve Bayes
Linear regression with Redis
Summary
A. Sources
Chapter 1: Why Redis?
Chapter 2: Advanced Key Management and Data Structures
Chapter 3: Managing RAM – Tips and Techniques for Redis Memory Management
Chapter 6: Scaling with Redis Cluster and Sentinel
Chapter 7: Redis and Complementary NoSQL Technologies
Chapter 10: Measuring and Managing Information Streams
Index

Mastering Redis

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: May 2016
Production reference: 1260516
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-818-1
www.packtpub.com

Credits

Author
Jeremy Nelson
Reviewers
Emilien Kenler
Saurabh Minni
Commissioning Editor
Kunal Parikh
Acquisition Editor
Harsha Bharwani
Content Development Editors
Kirti Patil
Mayur Pawanikar
Technical Editors
Utkarsha Kadam
Tanmayee Patil
Copy Editor
Merilyn Pereira
Project Coordinator
Nidhi Joshi
Proofreader
Safis Editing
Indexer
Rekha Nair
Graphics
Abhinash Sahu
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat
2323__perle...

Table of contents

  1. Mastering Redis