Redis

Card Puncher Data Processing

About

Redis is an open source (BSD licensed), in-memory key-value data store used as:

Redis is an acronym for Remote Dictionary Server.

Data structures

  • Hash, (if you have objects representing users in a web application, instead of using different keys for name, surname, email, password, use a single hash with all the required fields)
  • Sorted Set
  • Set

More .. https://redis.io/topics/data-types-intro

Management

The below paragraph shows you the difference between SQL and Redis Query.

Insert

SQL:

insert into Products (id, name, description, price) values (10200, “ZXYW”,“Description for ZXYW”, 300);

Redis:

MULTI
HMSET product:10200 name ZXYW desc “Description for ZXYW” price 300
ZADD product_list 10200 product:10200
ZADD product_price 300 product:10200
EXEC

Get / Query

Equality

SQL:

select * from Products where id = 10200

Redis:

HGETALL product:10200

Range

SQL:

select * from Product where price < 300

Redis:

ZRANGEBYSCORE product_price 0 300
  • Returns the keys
HGETALL product:10001
HGETALL product:10002
HGETALL product:10003

The same idea can be used to perform theta join (complex join)

Annexes





Discover More
Card Puncher Data Processing
Aws - Elasticache

in Aws
Data System Architecture
Database - Model

relational model the Hierarchical_database_modelhierarchical model and network model. object-oriented databases. Object-Relation type-Object model is based on the assumption that any fact can...
Card Puncher Data Processing
Design Pattern - Observer (Publish-subscribe model|Pub Sub)

An observer makes a observation by creating an event and passing it to a callback method of the subscriber. The observer is also called a message broker because it dispatches the event (ie message) to...
Data System Architecture
What is a Key Value Database/Store?

A key-value database / store is a NoSQL database based on the key-value data that is stored in btree or map data structure. You store some data, called a value, inside a key. The data can later be...



Share this page:
Follow us:
Task Runner