SlideShare une entreprise Scribd logo
1  sur  23
SPRING BOOT & REDIS
Nikhil Dole
12/12/2017
Redis Introduction
• Redis is the leading opensource in-memory database
platform, supporting any high performance operational,
analytics or hybrid use case.
• Redislabs also offers commercial product called Redis
Enterprise.
• Redis is not a replacement for Relational Databases nor
Document Stores.
• Key characteristics – NoSql, Key value, In Memory, Open
source.
• Redis is an advanced key-value store, where keys can
contain data structures as values supporting a set of
atomic operations on these data types.
The Redis Community
Redis – Mature and stable database
Redis – Usecases for Modern Apps
Who Uses Redis
• Twitter
• Github
• Pinterest
• Snapchat
• Craigslist
• Stackoverflow
• Flickr
• Weibo
• Digg
Redis on Cloud
Redis Advantages
• Technology
• Procedure
• Policies
• Benefits
• No Schemas & column names.
• Support for complex datatypes &
structures.
• Atomic operations.
• Scalability.
• CLI availability.
• Performance.
• Availability.
• Fault Tolerance.
• Portability.
• Pipelining.
• Simple to install , setup and manage
• Highly Configurable
• Supported on many languages
• Straightforward and well
documented API
• Open source
• Available on Azure and AWS.
• LRU(Least Recently Used) eviction
of keys.
• Keys with limited time to live.
• LUA scripting support
Redis Supported Datatypes
• Basic
– Strings
– Lists
– Sets
– Sorted Sets
– Hashes
• Advanced
– Bitmaps
– Hyperloglog
– Geospatial Indexes
REDIS VS OTHER
NOSQL/IN
MEMORY CACHING
FRAMEWORKS
Redis Vs Memcached
• Read/write speed:
– Both are extremely fast. Benchmarks vary by workload, versions, and
many other factors but Redis and Memcached are comparable in
terms of speed.
• Memory usage:
– Redis is better.
• Usability
– Memcached:
• We specify the cache size and as we insert items the daemon quickly grows
to a little more than this size.
• There is never really a way to reclaim any of that space, short of restarting
memcached. All our keys could be expired, you could flush the database,
and it would still use the full chunk of RAM you configured it with.
– Redis:
• Setting a max size is up to you. Redis will never use more than it has to
and will give us back memory it is no longer using.
Redis Vs Memcached
• Persistence:
– A clear win for Redis since it does this by default and has very configurable
persistence. Memcached has no mechanisms for dumping to disk without 3rd
party tools.
• Scaling:
– Redis provides tools to help for scaling while memcached does not.
• Documentation:
– Redis is better documented than memcached.
• Datatypes:
– Redis provides support for multiple data types however memcached does not.
Redis Vs MongoDB
• Read/write speed:
– Being in memory database Redis is faster than MongoDB.
• Usability:
– Redis is typically not a company’s only database but a faster alternative to an
existing database when they need more speed. MongoDB is more frequently
used as company’s only database.
– Redis is a great choice if we have a clearly defined data design and need very
fast access.
– MongoDB is great choice if we have structured and/or unstructured data
without clear definition of the data structure.
• Scalability:
– Because of MongoDB’s flexible design it scales better than Redis.
• Datatypes:
– Redis has multiple datatypes however MongoDB always stores data as
documents which can be modified on the fly.
Scaling Redis
Redis topologies
 Standalone
– The master data is optionally replicated to slaves.
– The slaves provides data redundancy, reads off loading and save-to-disk
offloading.
– Clients can connect to the Master for read/write operations or to the slaves for
read operations.
– Slaves can also replicate to its own slaves.
– There is no automatic failover.
 Sentinel (Automatic Failover)
– Redis Sentinel provides a reliable automatic failover in a master/slave topology,
automatically promoting a slave to master if existing master fails.
– Sentinel does not distribute data across nodes.
– Sentinel does the monitoring of master and slave nodes.
Scaling Redis
 Twemproxy (Distribute Data)
– It works as a proxy between the clients and multiple Redis instances.
– It is able to automatically distribute data among different standalone Redis
Instances.
– Supports consistent hashing with different strategies and hashing functions.
– Multi-Key commands and transactions are not supported.
 Cluster (Automatic Failover and distribute data)
– Redis Cluster distributes the data across different Redis instances and
perform automatic failover if any problem happens to any master instance.
– All nodes are directly connected with service channel.
– The keyspace is divided into hash slots. Different nodes will hold a subset of
hash slots.
– Multi-key commands are only allowed for keys in the same hash slot.
Redis Cluster
Redis Persistence
• Persistence in Redis is a matter of configuration, balancing trade off
between performance , disk I/O and data durability.
– RDB is a very compact single-file point-in-time representation of the
Redis dataset.
– AOF is a simple text log of write operations.
• RDB Advantages-
– RDB is compact and perfect for backups and for disaster recovery.
– RDB allows faster restarts with big datasets as compared to AOF.
– RDB maximizes Redis performance since only work the Redis parent
process needs to do in order to persist is forking a child that will do
all the rest.
Redis Persistence
• RDB Disadvantages-
– RDB is not good to minimize the chance for data loss in case Redis
stops working. In this case the last minutes data can be lost.
– RDB needs to fork a child process to persist on disk. Fork can be time
consuming if the dataset is big and the CPU performance not great.
This may result in Redis to stop serving clients for few milliseconds.
– RDB snapshoting generates a higher volume of disk writes because
whole file is being rewritten each time.
Redis Persistence
• AOF Advantages-
– AOF log is an append only log, there are no corruption problems if
there is a power outage.
– AOF generates less blocks writes to disk because data is only
appended to file.
– Redis is able to automatically rewrite to AOF in background.
• AOF Disadvantages-
– AOF takes more time to load in memory on server restart.
– AOF can be slower than RDB
– AOF files are usually bigger than the equivalent RDB files for the
same dataset.
Redis and Security
 Network Security
– It is possible to just listen to one or multiple interfaces using “bind” configuration
directive followed by one or more IP addresses.
– Designed to be accessed by trusted clients inside trusted environments.
– Does not allow external access / Internet exposure.
– Redis is not optimized for maximum security but for maximum performance and
simplicity.
 Authentication Feature
– Redis provides a layer of authentication that can be turned on by updating the
configuration file. Client can authenticate itself by sending AUTH command followed
by password.
 Data Encryption
– Data encryption is not supported
 Disabling Specific Commands
– It is possible to disable commands in Redis or to rename them into an un-guessable
name so that clients are limited to a specified list of commands.
 String Escaping and No SQL Injection
– Redis protocol has no concept of string escaping so injection is impossible.
– The protocol uses prefixed length strings and is completely binary safe.
Redis Application
• Redis POC Application
– Spring Boot app to do basic CRUD operation for a sample Data in Redis.
– Tech stack Spring Boot ,Thymeleaf library, Java 8,Gson library, Spring Data Redis.
• Following Steps were done for the application-
– Installed Redis on Linux Redhat OS/Windows as well as created instance on Microsoft
Azure.
– Created the REST Web service application to do basic CRUD operation for a sample
Data in Redis.
– Secured the Web service with MFA using Okta.
– Installed and setup Redis GUI for viewing the data stored in Redis datastore.
– Experimented with Redis GUI- Redis Desktop manager.
Demo
About me
• Nikhil Dole
• nik_dole@yahoo.com
• https://www.linkedin.com/in/nikhil-dole-
96bb2015/
• @NikhilDole
• https://github.com/NikhilDole

Contenu connexe

Tendances

Hdfs 2016-hadoop-summit-dublin-v1
Hdfs 2016-hadoop-summit-dublin-v1Hdfs 2016-hadoop-summit-dublin-v1
Hdfs 2016-hadoop-summit-dublin-v1Chris Nauroth
 
Red Hat Storage Day Seattle: Why Software-Defined Storage Matters
Red Hat Storage Day Seattle: Why Software-Defined Storage MattersRed Hat Storage Day Seattle: Why Software-Defined Storage Matters
Red Hat Storage Day Seattle: Why Software-Defined Storage MattersRed_Hat_Storage
 
Securing Data in Hybrid on-premise and Cloud Environments using Apache Ranger
Securing Data in Hybrid on-premise and Cloud Environments using Apache RangerSecuring Data in Hybrid on-premise and Cloud Environments using Apache Ranger
Securing Data in Hybrid on-premise and Cloud Environments using Apache RangerDataWorks Summit
 
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSEDB
 
Red Hat Storage Day Boston - Supermicro Super Storage
Red Hat Storage Day Boston - Supermicro Super StorageRed Hat Storage Day Boston - Supermicro Super Storage
Red Hat Storage Day Boston - Supermicro Super StorageRed_Hat_Storage
 
RedisConf18 - Re-architecting Redis-on-Flash with Intel 3DX Point™ Memory
RedisConf18 - Re-architecting Redis-on-Flash with Intel 3DX Point™ MemoryRedisConf18 - Re-architecting Redis-on-Flash with Intel 3DX Point™ Memory
RedisConf18 - Re-architecting Redis-on-Flash with Intel 3DX Point™ MemoryRedis Labs
 
Lessons Learned from Dockerizing Spark Workloads: Spark Summit East talk by T...
Lessons Learned from Dockerizing Spark Workloads: Spark Summit East talk by T...Lessons Learned from Dockerizing Spark Workloads: Spark Summit East talk by T...
Lessons Learned from Dockerizing Spark Workloads: Spark Summit East talk by T...Spark Summit
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenDie 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenEDB
 
Lessons Learned from Dockerizing Spark Workloads
Lessons Learned from Dockerizing Spark WorkloadsLessons Learned from Dockerizing Spark Workloads
Lessons Learned from Dockerizing Spark WorkloadsBlueData, Inc.
 
Backup management with Ceph Storage - Camilo Echevarne, Félix Barbeira
Backup management with Ceph Storage - Camilo Echevarne, Félix BarbeiraBackup management with Ceph Storage - Camilo Echevarne, Félix Barbeira
Backup management with Ceph Storage - Camilo Echevarne, Félix BarbeiraCeph Community
 
Reducing Database Pain & Costs with Postgres
Reducing Database Pain & Costs with PostgresReducing Database Pain & Costs with Postgres
Reducing Database Pain & Costs with PostgresEDB
 
Installing Postgres on Linux
Installing Postgres on LinuxInstalling Postgres on Linux
Installing Postgres on LinuxEDB
 
Red Hat Storage Day Atlanta - Why Software Defined Storage Matters
Red Hat Storage Day Atlanta - Why Software Defined Storage MattersRed Hat Storage Day Atlanta - Why Software Defined Storage Matters
Red Hat Storage Day Atlanta - Why Software Defined Storage MattersRed_Hat_Storage
 
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?Clustrix
 
SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!Andraz Tori
 
Hadoop Security and Compliance - StampedeCon 2016
Hadoop Security and Compliance - StampedeCon 2016Hadoop Security and Compliance - StampedeCon 2016
Hadoop Security and Compliance - StampedeCon 2016StampedeCon
 
Postgres for Digital Transformation: NoSQL Features, Replication, FDW & More
Postgres for Digital Transformation:NoSQL Features, Replication, FDW & MorePostgres for Digital Transformation:NoSQL Features, Replication, FDW & More
Postgres for Digital Transformation: NoSQL Features, Replication, FDW & MoreAshnikbiz
 
Hardware planning & sizing for sql server
Hardware planning & sizing for sql serverHardware planning & sizing for sql server
Hardware planning & sizing for sql serverDavide Mauri
 
[NetApp] Simplified HA:DR Using Storage Solutions
[NetApp] Simplified HA:DR Using Storage Solutions[NetApp] Simplified HA:DR Using Storage Solutions
[NetApp] Simplified HA:DR Using Storage SolutionsPerforce
 

Tendances (20)

Hdfs 2016-hadoop-summit-dublin-v1
Hdfs 2016-hadoop-summit-dublin-v1Hdfs 2016-hadoop-summit-dublin-v1
Hdfs 2016-hadoop-summit-dublin-v1
 
Red Hat Storage Day Seattle: Why Software-Defined Storage Matters
Red Hat Storage Day Seattle: Why Software-Defined Storage MattersRed Hat Storage Day Seattle: Why Software-Defined Storage Matters
Red Hat Storage Day Seattle: Why Software-Defined Storage Matters
 
Securing Data in Hybrid on-premise and Cloud Environments using Apache Ranger
Securing Data in Hybrid on-premise and Cloud Environments using Apache RangerSecuring Data in Hybrid on-premise and Cloud Environments using Apache Ranger
Securing Data in Hybrid on-premise and Cloud Environments using Apache Ranger
 
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
 
Red Hat Storage Day Boston - Supermicro Super Storage
Red Hat Storage Day Boston - Supermicro Super StorageRed Hat Storage Day Boston - Supermicro Super Storage
Red Hat Storage Day Boston - Supermicro Super Storage
 
RedisConf18 - Re-architecting Redis-on-Flash with Intel 3DX Point™ Memory
RedisConf18 - Re-architecting Redis-on-Flash with Intel 3DX Point™ MemoryRedisConf18 - Re-architecting Redis-on-Flash with Intel 3DX Point™ Memory
RedisConf18 - Re-architecting Redis-on-Flash with Intel 3DX Point™ Memory
 
Lessons Learned from Dockerizing Spark Workloads: Spark Summit East talk by T...
Lessons Learned from Dockerizing Spark Workloads: Spark Summit East talk by T...Lessons Learned from Dockerizing Spark Workloads: Spark Summit East talk by T...
Lessons Learned from Dockerizing Spark Workloads: Spark Summit East talk by T...
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenDie 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
 
Lessons Learned from Dockerizing Spark Workloads
Lessons Learned from Dockerizing Spark WorkloadsLessons Learned from Dockerizing Spark Workloads
Lessons Learned from Dockerizing Spark Workloads
 
Backup management with Ceph Storage - Camilo Echevarne, Félix Barbeira
Backup management with Ceph Storage - Camilo Echevarne, Félix BarbeiraBackup management with Ceph Storage - Camilo Echevarne, Félix Barbeira
Backup management with Ceph Storage - Camilo Echevarne, Félix Barbeira
 
Reducing Database Pain & Costs with Postgres
Reducing Database Pain & Costs with PostgresReducing Database Pain & Costs with Postgres
Reducing Database Pain & Costs with Postgres
 
Installing Postgres on Linux
Installing Postgres on LinuxInstalling Postgres on Linux
Installing Postgres on Linux
 
Red Hat Storage Day Atlanta - Why Software Defined Storage Matters
Red Hat Storage Day Atlanta - Why Software Defined Storage MattersRed Hat Storage Day Atlanta - Why Software Defined Storage Matters
Red Hat Storage Day Atlanta - Why Software Defined Storage Matters
 
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?
 
SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!
 
Hadoop Security and Compliance - StampedeCon 2016
Hadoop Security and Compliance - StampedeCon 2016Hadoop Security and Compliance - StampedeCon 2016
Hadoop Security and Compliance - StampedeCon 2016
 
SQL on Azure
SQL on AzureSQL on Azure
SQL on Azure
 
Postgres for Digital Transformation: NoSQL Features, Replication, FDW & More
Postgres for Digital Transformation:NoSQL Features, Replication, FDW & MorePostgres for Digital Transformation:NoSQL Features, Replication, FDW & More
Postgres for Digital Transformation: NoSQL Features, Replication, FDW & More
 
Hardware planning & sizing for sql server
Hardware planning & sizing for sql serverHardware planning & sizing for sql server
Hardware planning & sizing for sql server
 
[NetApp] Simplified HA:DR Using Storage Solutions
[NetApp] Simplified HA:DR Using Storage Solutions[NetApp] Simplified HA:DR Using Storage Solutions
[NetApp] Simplified HA:DR Using Storage Solutions
 

Similaire à Redis meetup

Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisArnab Mitra
 
What's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis LabsWhat's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis LabsRedis Labs
 
Redis data structure and Performance Optimization
Redis data structure and Performance OptimizationRedis data structure and Performance Optimization
Redis data structure and Performance OptimizationKnoldus Inc.
 
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...Qian Lin
 
RedisConf17 - Redis Enterprise: Continuous Availability, Unlimited Scaling, S...
RedisConf17 - Redis Enterprise: Continuous Availability, Unlimited Scaling, S...RedisConf17 - Redis Enterprise: Continuous Availability, Unlimited Scaling, S...
RedisConf17 - Redis Enterprise: Continuous Availability, Unlimited Scaling, S...Redis Labs
 
Redis - The Universal NoSQL Tool
Redis - The Universal NoSQL ToolRedis - The Universal NoSQL Tool
Redis - The Universal NoSQL ToolEberhard Wolff
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP LondonRicard Clau
 
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020Redis Labs
 
Redis. Seattle Data Science and Data Engineering Meetup
Redis. Seattle Data Science and Data Engineering MeetupRedis. Seattle Data Science and Data Engineering Meetup
Redis. Seattle Data Science and Data Engineering MeetupAbhishek Goswami
 
EN - Azure - Cache for Redis.pdf
EN - Azure - Cache for Redis.pdfEN - Azure - Cache for Redis.pdf
EN - Azure - Cache for Redis.pdfArnaudMorvillier1
 
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...Amazon Web Services
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabasesAdi Challa
 
Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...Dinh Pham
 
Redis as a Cache Boosting Performance and Scalability
Redis as a Cache Boosting Performance and ScalabilityRedis as a Cache Boosting Performance and Scalability
Redis as a Cache Boosting Performance and ScalabilityInexture Solutions
 
New York REDIS Meetup Welcome Session
New York REDIS Meetup Welcome SessionNew York REDIS Meetup Welcome Session
New York REDIS Meetup Welcome SessionAleksandr Yampolskiy
 
Running Production CDC Ingestion Pipelines With Balaji Varadarajan and Pritam...
Running Production CDC Ingestion Pipelines With Balaji Varadarajan and Pritam...Running Production CDC Ingestion Pipelines With Balaji Varadarajan and Pritam...
Running Production CDC Ingestion Pipelines With Balaji Varadarajan and Pritam...HostedbyConfluent
 
Cost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWSCost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWSAmazon Web Services
 

Similaire à Redis meetup (20)

Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Redis - Partitioning
Redis - PartitioningRedis - Partitioning
Redis - Partitioning
 
What's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis LabsWhat's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis Labs
 
Redis data structure and Performance Optimization
Redis data structure and Performance OptimizationRedis data structure and Performance Optimization
Redis data structure and Performance Optimization
 
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
 
RedisConf17 - Redis Enterprise: Continuous Availability, Unlimited Scaling, S...
RedisConf17 - Redis Enterprise: Continuous Availability, Unlimited Scaling, S...RedisConf17 - Redis Enterprise: Continuous Availability, Unlimited Scaling, S...
RedisConf17 - Redis Enterprise: Continuous Availability, Unlimited Scaling, S...
 
Redis vs Memcached
Redis vs MemcachedRedis vs Memcached
Redis vs Memcached
 
Redis - The Universal NoSQL Tool
Redis - The Universal NoSQL ToolRedis - The Universal NoSQL Tool
Redis - The Universal NoSQL Tool
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP London
 
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
 
Redis. Seattle Data Science and Data Engineering Meetup
Redis. Seattle Data Science and Data Engineering MeetupRedis. Seattle Data Science and Data Engineering Meetup
Redis. Seattle Data Science and Data Engineering Meetup
 
EN - Azure - Cache for Redis.pdf
EN - Azure - Cache for Redis.pdfEN - Azure - Cache for Redis.pdf
EN - Azure - Cache for Redis.pdf
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
 
Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...
 
Redis as a Cache Boosting Performance and Scalability
Redis as a Cache Boosting Performance and ScalabilityRedis as a Cache Boosting Performance and Scalability
Redis as a Cache Boosting Performance and Scalability
 
New York REDIS Meetup Welcome Session
New York REDIS Meetup Welcome SessionNew York REDIS Meetup Welcome Session
New York REDIS Meetup Welcome Session
 
Running Production CDC Ingestion Pipelines With Balaji Varadarajan and Pritam...
Running Production CDC Ingestion Pipelines With Balaji Varadarajan and Pritam...Running Production CDC Ingestion Pipelines With Balaji Varadarajan and Pritam...
Running Production CDC Ingestion Pipelines With Balaji Varadarajan and Pritam...
 
Cost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWSCost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWS
 

Dernier

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 

Dernier (20)

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 

Redis meetup

  • 1. SPRING BOOT & REDIS Nikhil Dole 12/12/2017
  • 2. Redis Introduction • Redis is the leading opensource in-memory database platform, supporting any high performance operational, analytics or hybrid use case. • Redislabs also offers commercial product called Redis Enterprise. • Redis is not a replacement for Relational Databases nor Document Stores. • Key characteristics – NoSql, Key value, In Memory, Open source. • Redis is an advanced key-value store, where keys can contain data structures as values supporting a set of atomic operations on these data types.
  • 4. Redis – Mature and stable database
  • 5. Redis – Usecases for Modern Apps
  • 6. Who Uses Redis • Twitter • Github • Pinterest • Snapchat • Craigslist • Stackoverflow • Flickr • Weibo • Digg
  • 8. Redis Advantages • Technology • Procedure • Policies • Benefits • No Schemas & column names. • Support for complex datatypes & structures. • Atomic operations. • Scalability. • CLI availability. • Performance. • Availability. • Fault Tolerance. • Portability. • Pipelining. • Simple to install , setup and manage • Highly Configurable • Supported on many languages • Straightforward and well documented API • Open source • Available on Azure and AWS. • LRU(Least Recently Used) eviction of keys. • Keys with limited time to live. • LUA scripting support
  • 9. Redis Supported Datatypes • Basic – Strings – Lists – Sets – Sorted Sets – Hashes • Advanced – Bitmaps – Hyperloglog – Geospatial Indexes
  • 10. REDIS VS OTHER NOSQL/IN MEMORY CACHING FRAMEWORKS
  • 11. Redis Vs Memcached • Read/write speed: – Both are extremely fast. Benchmarks vary by workload, versions, and many other factors but Redis and Memcached are comparable in terms of speed. • Memory usage: – Redis is better. • Usability – Memcached: • We specify the cache size and as we insert items the daemon quickly grows to a little more than this size. • There is never really a way to reclaim any of that space, short of restarting memcached. All our keys could be expired, you could flush the database, and it would still use the full chunk of RAM you configured it with. – Redis: • Setting a max size is up to you. Redis will never use more than it has to and will give us back memory it is no longer using.
  • 12. Redis Vs Memcached • Persistence: – A clear win for Redis since it does this by default and has very configurable persistence. Memcached has no mechanisms for dumping to disk without 3rd party tools. • Scaling: – Redis provides tools to help for scaling while memcached does not. • Documentation: – Redis is better documented than memcached. • Datatypes: – Redis provides support for multiple data types however memcached does not.
  • 13. Redis Vs MongoDB • Read/write speed: – Being in memory database Redis is faster than MongoDB. • Usability: – Redis is typically not a company’s only database but a faster alternative to an existing database when they need more speed. MongoDB is more frequently used as company’s only database. – Redis is a great choice if we have a clearly defined data design and need very fast access. – MongoDB is great choice if we have structured and/or unstructured data without clear definition of the data structure. • Scalability: – Because of MongoDB’s flexible design it scales better than Redis. • Datatypes: – Redis has multiple datatypes however MongoDB always stores data as documents which can be modified on the fly.
  • 14. Scaling Redis Redis topologies  Standalone – The master data is optionally replicated to slaves. – The slaves provides data redundancy, reads off loading and save-to-disk offloading. – Clients can connect to the Master for read/write operations or to the slaves for read operations. – Slaves can also replicate to its own slaves. – There is no automatic failover.  Sentinel (Automatic Failover) – Redis Sentinel provides a reliable automatic failover in a master/slave topology, automatically promoting a slave to master if existing master fails. – Sentinel does not distribute data across nodes. – Sentinel does the monitoring of master and slave nodes.
  • 15. Scaling Redis  Twemproxy (Distribute Data) – It works as a proxy between the clients and multiple Redis instances. – It is able to automatically distribute data among different standalone Redis Instances. – Supports consistent hashing with different strategies and hashing functions. – Multi-Key commands and transactions are not supported.  Cluster (Automatic Failover and distribute data) – Redis Cluster distributes the data across different Redis instances and perform automatic failover if any problem happens to any master instance. – All nodes are directly connected with service channel. – The keyspace is divided into hash slots. Different nodes will hold a subset of hash slots. – Multi-key commands are only allowed for keys in the same hash slot.
  • 17. Redis Persistence • Persistence in Redis is a matter of configuration, balancing trade off between performance , disk I/O and data durability. – RDB is a very compact single-file point-in-time representation of the Redis dataset. – AOF is a simple text log of write operations. • RDB Advantages- – RDB is compact and perfect for backups and for disaster recovery. – RDB allows faster restarts with big datasets as compared to AOF. – RDB maximizes Redis performance since only work the Redis parent process needs to do in order to persist is forking a child that will do all the rest.
  • 18. Redis Persistence • RDB Disadvantages- – RDB is not good to minimize the chance for data loss in case Redis stops working. In this case the last minutes data can be lost. – RDB needs to fork a child process to persist on disk. Fork can be time consuming if the dataset is big and the CPU performance not great. This may result in Redis to stop serving clients for few milliseconds. – RDB snapshoting generates a higher volume of disk writes because whole file is being rewritten each time.
  • 19. Redis Persistence • AOF Advantages- – AOF log is an append only log, there are no corruption problems if there is a power outage. – AOF generates less blocks writes to disk because data is only appended to file. – Redis is able to automatically rewrite to AOF in background. • AOF Disadvantages- – AOF takes more time to load in memory on server restart. – AOF can be slower than RDB – AOF files are usually bigger than the equivalent RDB files for the same dataset.
  • 20. Redis and Security  Network Security – It is possible to just listen to one or multiple interfaces using “bind” configuration directive followed by one or more IP addresses. – Designed to be accessed by trusted clients inside trusted environments. – Does not allow external access / Internet exposure. – Redis is not optimized for maximum security but for maximum performance and simplicity.  Authentication Feature – Redis provides a layer of authentication that can be turned on by updating the configuration file. Client can authenticate itself by sending AUTH command followed by password.  Data Encryption – Data encryption is not supported  Disabling Specific Commands – It is possible to disable commands in Redis or to rename them into an un-guessable name so that clients are limited to a specified list of commands.  String Escaping and No SQL Injection – Redis protocol has no concept of string escaping so injection is impossible. – The protocol uses prefixed length strings and is completely binary safe.
  • 21. Redis Application • Redis POC Application – Spring Boot app to do basic CRUD operation for a sample Data in Redis. – Tech stack Spring Boot ,Thymeleaf library, Java 8,Gson library, Spring Data Redis. • Following Steps were done for the application- – Installed Redis on Linux Redhat OS/Windows as well as created instance on Microsoft Azure. – Created the REST Web service application to do basic CRUD operation for a sample Data in Redis. – Secured the Web service with MFA using Okta. – Installed and setup Redis GUI for viewing the data stored in Redis datastore. – Experimented with Redis GUI- Redis Desktop manager.
  • 22. Demo
  • 23. About me • Nikhil Dole • nik_dole@yahoo.com • https://www.linkedin.com/in/nikhil-dole- 96bb2015/ • @NikhilDole • https://github.com/NikhilDole

Notes de l'éditeur

  1. Summarize presentation content by restating the important points from the lessons. What do you want the audience to remember when they leave your presentation? Save your presentation to a video for easy distribution (To create a video, click the File tab, and then click Share.  Under File Types, click Create a Video.)