Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bootiful multi-model applications with Redis Stack

Bootiful multi-model applications with Redis Stack

Redis Stack provides a seamless and straightforward way to use different data models and functionality from Redis, including a document store, a graph database, a time series data database, probabilistic data structures, and a full-text search engine. In this session, I will walk you thru the building of a Spring Boot application that uses a hybrid model with Redis OM Spring. Redis OM Spring provides a robust repository and custom object-mapping abstractions built on the powerful Spring Data Redis (SDR) framework to tap into all the modules of Redis Stack.

270b71aa52e822fa5920e618fd693d0c?s=128

Brian Sam-Bodden

May 28, 2022
Tweet

Other Decks in Programming

Transcript

  1. BOOTIFUL MULTI-MODEL APPLICATIONS

  2. BOOTIFUL MULTI-MODEL APPLICATIONS with Redis Stack

  3. bsb@redis.com @bsbodden github.com/bsbodden

  4. THE PREMISE OF THIS SESSION...

  5. YOUR CACHE IS YOUR DATABASE!

  6. AND IF YOUR CACHE IS YOUR DATABASE...

  7. THEN YOUR CACHE SHOULD BE A REAL DATABASE!

  8. None
  9. REDIS ≅CACHE

  10. REDIS ≅CACHE

  11. REDIS ≅CACHE

  12. None
  13. REMOTE DICTIONARY SERVER

  14. REMOTE DICTIONARY SERVER

  15. REMOTE DICTIONARY SERVER

  16. REMOTE DICTIONARY SERVER

  17. In-memory First Optionally Persistent

  18. REMOTE DATA STRUCTURE SERVER

  19. REMOTE DATA STRUCTURE SERVER

  20. REMOTE DATA STRUCTURE SERVER

  21. REMOTE DATA STRUCTURE SERVER

  22. REMOTE DATA STRUCTURE SERVER

  23. Lists [ A → B → C → D →

    E ] Hashes { A: “foo”, B: “bar”, C: “baz” } Bitmaps 0011010101100111001010 Strings "I'm a Plain Text String!” Bit field {23334}{112345569}{766538} 🗝 KEY Streams →{id1=time1.seq1(A:“xyz”, B:“cdf”), d2=time2.seq2(D:“abc”, )}→ Hyperloglog 00110101 11001110 Sorted Sets { A: 0.1, B: 0.3, C: 100 } Sets { A , B , C , D , E } Geospatial Indexes { A: (51.5, 0.12), B: (32.1, 34.7) }
  24. Lists [ A → B → C → D →

    E ] Hashes { A: “foo”, B: “bar”, C: “baz” } Bitmaps 0011010101100111001010 Strings "I'm a Plain Text String!” Bit field {23334}{112345569}{766538} 🗝 KEY Streams →{id1=time1.seq1(A:“xyz”, B:“cdf”), d2=time2.seq2(D:“abc”, )}→ Hyperloglog 00110101 11001110 Sorted Sets { A: 0.1, B: 0.3, C: 100 } Sets { A , B , C , D , E } Geospatial Indexes { A: (51.5, 0.12), B: (32.1, 34.7) }
  25. Lists [ A → B → C → D →

    E ] Hashes { A: “foo”, B: “bar”, C: “baz” } Bitmaps 0011010101100111001010 Strings "I'm a Plain Text String!” Bit field {23334}{112345569}{766538} 🗝 KEY Streams →{id1=time1.seq1(A:“xyz”, B:“cdf”), d2=time2.seq2(D:“abc”, )}→ Hyperloglog 00110101 11001110 Sorted Sets { A: 0.1, B: 0.3, C: 100 } Sets { A , B , C , D , E } Geospatial Indexes { A: (51.5, 0.12), B: (32.1, 34.7) }
  26. Lists [ A → B → C → D →

    E ] Hashes { A: “foo”, B: “bar”, C: “baz” } Bitmaps 0011010101100111001010 Strings "I'm a Plain Text String!” Bit field {23334}{112345569}{766538} 🗝 KEY Streams →{id1=time1.seq1(A:“xyz”, B:“cdf”), d2=time2.seq2(D:“abc”, )}→ Hyperloglog 00110101 11001110 Sorted Sets { A: 0.1, B: 0.3, C: 100 } Sets { A , B , C , D , E } Geospatial Indexes { A: (51.5, 0.12), B: (32.1, 34.7) }
  27. Lists [ A → B → C → D →

    E ] Hashes { A: “foo”, B: “bar”, C: “baz” } Bitmaps 0011010101100111001010 Strings "I'm a Plain Text String!” Bit field {23334}{112345569}{766538} 🗝 KEY Streams →{id1=time1.seq1(A:“xyz”, B:“cdf”), d2=time2.seq2(D:“abc”, )}→ Hyperloglog 00110101 11001110 Sorted Sets { A: 0.1, B: 0.3, C: 100 } Sets { A , B , C , D , E } Geospatial Indexes { A: (51.5, 0.12), B: (32.1, 34.7) }
  28. Lists [ A → B → C → D →

    E ] Hashes { A: “foo”, B: “bar”, C: “baz” } Bitmaps 0011010101100111001010 Strings "I'm a Plain Text String!” Bit field {23334}{112345569}{766538} 🗝 KEY Streams →{id1=time1.seq1(A:“xyz”, B:“cdf”), d2=time2.seq2(D:“abc”, )}→ Hyperloglog 00110101 11001110 Sorted Sets { A: 0.1, B: 0.3, C: 100 } Sets { A , B , C , D , E } Geospatial Indexes { A: (51.5, 0.12), B: (32.1, 34.7) }
  29. Lists [ A → B → C → D →

    E ] Hashes { A: “foo”, B: “bar”, C: “baz” } Bitmaps 0011010101100111001010 Strings "I'm a Plain Text String!” Bit field {23334}{112345569}{766538} 🗝 KEY Streams →{id1=time1.seq1(A:“xyz”, B:“cdf”), d2=time2.seq2(D:“abc”, )}→ Hyperloglog 00110101 11001110 Sorted Sets { A: 0.1, B: 0.3, C: 100 } Sets { A , B , C , D , E } Geospatial Indexes { A: (51.5, 0.12), B: (32.1, 34.7) }
  30. Lists [ A → B → C → D →

    E ] Hashes { A: “foo”, B: “bar”, C: “baz” } Bitmaps 0011010101100111001010 Strings "I'm a Plain Text String!” Bit field {23334}{112345569}{766538} 🗝 KEY Streams →{id1=time1.seq1(A:“xyz”, B:“cdf”), d2=time2.seq2(D:“abc”, )}→ Hyperloglog 00110101 11001110 Sorted Sets { A: 0.1, B: 0.3, C: 100 } Sets { A , B , C , D , E } Geospatial Indexes { A: (51.5, 0.12), B: (32.1, 34.7) }
  31. Lists [ A → B → C → D →

    E ] Hashes { A: “foo”, B: “bar”, C: “baz” } Bitmaps 0011010101100111001010 Strings "I'm a Plain Text String!” Bit field {23334}{112345569}{766538} 🗝 KEY Streams →{id1=time1.seq1(A:“xyz”, B:“cdf”), d2=time2.seq2(D:“abc”, )}→ Hyperloglog 00110101 11001110 Sorted Sets { A: 0.1, B: 0.3, C: 100 } Sets { A , B , C , D , E } Geospatial Indexes { A: (51.5, 0.12), B: (32.1, 34.7) }
  32. Lists [ A → B → C → D →

    E ] Hashes { A: “foo”, B: “bar”, C: “baz” } Bitmaps 0011010101100111001010 Strings "I'm a Plain Text String!” Bit field {23334}{112345569}{766538} 🗝 KEY Streams →{id1=time1.seq1(A:“xyz”, B:“cdf”), d2=time2.seq2(D:“abc”, )}→ Hyperloglog 00110101 11001110 Sorted Sets { A: 0.1, B: 0.3, C: 100 } Sets { A , B , C , D , E } Geospatial Indexes { A: (51.5, 0.12), B: (32.1, 34.7) }
  33. Lists [ A → B → C → D →

    E ] Hashes { A: “foo”, B: “bar”, C: “baz” } Bitmaps 0011010101100111001010 Strings "I'm a Plain Text String!” Bit field {23334}{112345569}{766538} 🗝 KEY Streams →{id1=time1.seq1(A:“xyz”, B:“cdf”), d2=time2.seq2(D:“abc”, )}→ Hyperloglog 00110101 11001110 Sorted Sets { A: 0.1, B: 0.3, C: 100 } Sets { A , B , C , D , E } Geospatial Indexes { A: (51.5, 0.12), B: (32.1, 34.7) }
  34. None
  35. None
  36. None
  37. None
  38. RedisJSON

  39. None
  40. RediSearch

  41. None
  42. RedisGraph

  43. None
  44. RedisTimeSeries

  45. None
  46. RedisAI

  47. None
  48. RedisGears

  49. None
  50. RedisBloom

  51. REDIS STACK

  52. Docker Hub Installers Redis Cloud https://redis.io/docs/stack/

  53. None
  54. None
  55. None
  56. None
  57. LOW-LEVEL COMMAND-BASED

  58. Lettuce LOW-LEVEL COMMAND-BASED

  59. Jedis Lettuce LOW-LEVEL COMMAND-BASED

  60. Jedis Lettuce JRedisJSON JRediSearch JRedisBloom JRedisTimeSeries JRedisGraph JRedisAI JRedisGears Jedis-based

    Module Clients LOW-LEVEL COMMAND-BASED
  61. Jedis Lettuce JRedisJSON JRediSearch JRedisBloom JRedisTimeSeries JRedisGraph JRedisAI JRedisGears Jedis-based

    Module Clients LOW-LEVEL COMMAND-BASED COMMAND-BASED AND SOME QUERYING APIS
  62. Jedis Lettuce Spring Data Redis JRedisJSON JRediSearch JRedisBloom JRedisTimeSeries JRedisGraph

    JRedisAI JRedisGears Jedis-based Module Clients LOW-LEVEL COMMAND-BASED COMMAND-BASED AND SOME QUERYING APIS
  63. Jedis Lettuce Spring Data Redis JRedisJSON JRediSearch JRedisBloom JRedisTimeSeries JRedisGraph

    JRedisAI JRedisGears Jedis-based Module Clients LOW-LEVEL COMMAND-BASED TEMPLATES + BASIC OBJECT-MAPPING/INDEXING COMMAND-BASED AND SOME QUERYING APIS
  64. JRedisJSON JRediSearch JRedisBloom JRedisTimeSeries JRedisGraph JRedisAI JRedisGears Jedis-based Module Clients

    Redis OM Spring
  65. JRedisJSON JRediSearch JRedisBloom JRedisTimeSeries JRedisGraph JRedisAI JRedisGears Jedis-based Module Clients

    Redis OM Spring
  66. Spring Data Redis JRedisJSON JRediSearch JRedisBloom JRedisTimeSeries JRedisGraph JRedisAI JRedisGears

    Jedis-based Module Clients Redis OM Spring
  67. Spring Data Redis JRedisJSON JRediSearch JRedisBloom JRedisTimeSeries JRedisGraph JRedisAI JRedisGears

    Jedis-based Module Clients Redis OM Spring MULTI-MODEL OBJECT-MAPPING AND QUERYING
  68. LET'S BUILD SOMETHING!

  69. DEMO A sample domain mapped to Redis Hashes Spring Data

    Repositories powered by RediSearch A sample domain mapped to Redis JSON More complex searching with RediSearch Some extras (ITP)... 
 Entity Streams, Bloom Filters, AutoComplete
  70. https://developer.redis.com/riot IF LOADING A LOT OF DATA INTO REDIS...

  71. https://developer.redislabs.com/riot

  72. https://developer.redislabs.com/riot Julien Ruaux

  73. https://developer.redislabs.com/riot Julien Ruaux Not Brian

  74. https://github.com/bsbodden/bootiful-redis-stack ALL THE CODE CAN BE FOUND AT:

  75. https://redis.io/modules https://redis.com/community/redis-modules-hub/ https://redis.com/modules/get-started/ github.com/redis/redis-om-spring

  76. TRY STACK ON REDIS CLOUD! https://redis.com/try-free/ USE CODE RESP200 FOR

    $200 IN CREDITS!
  77. LEARN MORE AT REDIS DEVELOPER https://developer.redis.com

  78. LEARN MORE AT REDIS UNIVERSITY https://university.redis.com

  79. THANK YOU!!!

  80. THANK YOU!!!