Más contenido relacionado La actualidad más candente (7) Similar a Fast and Furious: Searching in a Distributed World with Highly Available Spring Data Redis (20) Fast and Furious: Searching in a Distributed World with Highly Available Spring Data Redis1. Fast and Furious: Searching in a
Distributed World with Spring Data Redis
By Julien Ruaux
@TypeErasure
2. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Agenda
What is Redis?
Searching with Redis
Redis and Spring
Demo
Redis Enterprise
2
3. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Redis: 1 Billion Served!
3
4. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Redis: The Leading In-Memory Database
4
Extensibility
3
Redis Modules
Performance
NoSQL Benchmark
1
Simplicity
Redis Data Structures
2
Strings Sets
Bitmaps Sorted Sets
Bit Field Geospatial
Hashes Hyperloglogs
Lists Streams
5. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Performance
5
Highest Throughput & Lowest Latency
in High Volume of Writes Scenario
Least Servers Needed to Deliver
1 Million Writes/Sec
Benchmarks performed by Avalon Consulting Group Benchmarks published in the Google blog
1
6. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Simplicity
6
2
Lists
[ A → B → C → D → E ]
Hashes
{ A: “foo”, B: “bar”, C: “baz” }
Bitmaps
0011010101100111001010
Strings
"I'm a Plain Text String!”
Bit Fields
{23334}{112345569}{766538}
”Retrieve the e-mail address of the user with the highest
bid in an auction that started on July 24th at 11:00pm
PST”
ZREVRANGE 07242015_2300 0 0=
Streams
{id1=time1.seq1(A:“xyz”),
...}
Hyperloglog
00110101 11001110
Sorted Sets
{ A: 0.1, B: 0.3, C: 100 }
Sets
{ A , B , C , D , E }
Geospatial
{ A: (51.5, 0.12), B: (32.1,
34.7) }
Key
7. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Extensibility
7
3
ReJSON
Native JSON handling
RedisGraph
Based on GraphBLAS technology
Redis-ML
Serves models 2000 times faster
RediSearch
5X faster search
8. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
RediSearch
Uses Redis Modules API
Simple, fast indexing and searching
In-memory & efficient data structures
Flexible query language:
Full-text with Stemming
Phonetic matching
Numeric & Geo filters
8
9. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
RediSearch: Features
9
AggregateSearch
Query Auto
Comple
te
10. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
RediSearch: Query Example
10
ford -explorer
not
( |chev*)
prefixor
~truck
optional
@year:[2001 2011] numeric filter
@location:[-77.02 38.78 10 mi] geo filter
11. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
RediSearch: Autocomplete
• Radix tree-based
• Optimized for as-you-type completions
• Simple API
• Add a suggestion
• Get a suggestion
• Delete a suggestion
11
12. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Redis and Spring
Connection package with Redis drivers: Jedis & Lettuce
RedisTemplate
PubSub
Repositories
Spring Cache implementation
12
Spring Data Redis
13. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Demo Application
14. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Demo: Data Ingest
14
Spring Batch
Spring Data
Redis
Discogs DB
JRediSearch
index
hash
read
15. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Demo: Search API
15
Spring Data
Redis
Spring WebAngular
Spring CacheDiscogs API
JRediSearch
search
put
get
hgetall
http get
16. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Demo Time
17. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Demo Summary
Quickly write and deploy stateful Spring applications:
Redis and RediSearch
Integration with Spring Data Redis
Data ingest using Spring Batch
Transparent caching with Spring Cache
17
18. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Why Redis Enterprise?
18
Performance at Scale
Robust Security
High Availability & Durability
Active-Active Geo Distribution
Built-in Search
Tiered Memory: RAM +
Flash
Automation & Support
Multi-Model
19. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Active-Active Geo-Distribution
Based on CRDTs (Conflict-Free Replicated Data Types)
19
20. Unless otherwise indicated, these slides are © 2013 -2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Redis Enterprise on PCF
20
Dynamic Route Services/API Management
Your Applications
Data ServicesMicroservices
Infrastructure + OS + Container Orchestration
bind
21. > Stay Connected.
Demo App: https://github.com/Redislabs-Solution-Architects/rediscogs
RediSearch: https://oss.redislabs.com/redisearch
Redis Enterprise: https://redislabs.com/redis-enterprise
#springon
e
@s1
p
@RedisLab
s
#redis
Notas del editor Redis is an open source (BSD license) in-memory data structure store used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries bit fields: specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset
streams: Stream is a new data type introduced with Redis 5.0, which models a log data structure Implemented by Redis Modules, independent of the Redis core
Add-ons that use a Redis API to seamlessly support additional use cases and data structures
Loosely coupled design, i.e. load only models needed for your use case
Optimal data structure implementation for JSON, Graph, Search (and other) functionality, not just APIs
Add new capabilities and data structures to Redis – in speeds similar to normal Redis commands
Redis Enterprise Modules are tested and certified by Redis Labs RediSearch is a Redis module that allows for advanced search features, high performance and low memory footprint. It can perform simple text searches as well as complex structured queries, filtering by numeric properties and geographical distances. AND/OR/NOT, Exact Phrase, Geospatial, Prefix, Number Ranges, Optional Terms, ... Active-active geo-distributed topology is achieved by implementing CRDT techniques in Redis Enterprise using a global database that spans multiple clusters. This globe spanning database is called a CRDB.
CRDB provides 3 fundamental benefits over other geo-distributed solutions:
Local latency on read/write operations, regardless of the number of geo-replicated regions and their distance from each other
Seamless conflict resolution (“conflict free”) for simple and complex data types like those of the Redis core or the Redis modules.
Even if the majority of geo-replicated regions (for example 3 out of 5) are down, the remaining geo-replicated regions are uninterrupted and can continue to handle read and write operations.