+ All Categories
Home > Technology > Next Level Redis with Spring

Next Level Redis with Spring

Date post: 15-Jan-2017
Category:
Upload: spring-io
View: 307 times
Download: 0 times
Share this document with a friend
30
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Next Level Redis With Spring Christoph Strobl @stroblchristoph
Transcript

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

Next Level Redis With SpringChristoph Strobl

@stroblchristoph

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 2

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 3

RemoteDirectoryServer

KeyValue StoreCache Q

ueue

s

Ana

lytic

s

Geo Indexing

Sess

ion

Stor

e

Distributed Locks

Strings

Has

hesLists

Sets

Sort

ed S

ets

HyperLogLog

Transactions

Pub/Sub Scrip

ting

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 4

DataTypes & Commands

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 5

V A L U E

SETGET K E Y

STRLEN

APPEND

GETSET

GETRANGESETRANGE

3 . 1 4 1

INCRINCRBY

DECRDECRBY

INCRBYFLOAT

DECRBYFLOAT

SETNX

Strings

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

Arya

6

S T A R K

LPUSHLPOP

RPUSHRPOP

LLEN

LSETLGET

LINSERT

LRANGE

LREM

Lists

Jon Bran

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 7

Sets

L A N N I S T E R

Tyrion

Jaime

CerseiSADD

SPOP

SREM

SCARD

SMEMBERS

SISMEMBER

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 8

Hashes

D A E N E R Y S

firstname

lastname

gender

daenerys

targaryen

female

HSET

HGETHMSET

HMGET

HVALSHKEYS

HDEL

HLEN

HGETALL

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 9

multi/exec

MULTI

EXEC

SET key valueGET key

QUEUEDQUEUED

[OK, value]DISCARDOK

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 10

Single Node / HA / Cluster

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 11

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 12

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 13

S

S

S

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 14

Slots:0 - 8192

Slots:8993 - 16384

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 15

DEMOcluster commands

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 16

Object Hash Mapping

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 17

class Person { String id; String firstname; String lastname; Address address;}

SET {person}:123 { "id":123, "firstname":"jon", "lastname":"snow", "address": { "country":"the north" } }

HMSET {person}:123 _class org.example.Person id 123 firstname jon lastname snow address.country the north

GET {person}:123HGETALL {person}:123HGET {person}:123 id lastname

HSET {person}:123 lastname doe

HEXISTS {person}:123 age

...

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 18

DEMOObject Hash Mapping

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 19

Secondary Indexes

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 20

class Person { String id; String firstname; String lastname; Address address;}

HMSET {person}:123 _class org.example.Person id 123 firstname jon lastname snow address.country the north

SADD {person}:firstname:jon 123 SADD {person}:lastname:snow 123

123

{person}:firstname:jon

101567

721

{person}:lastname:snow

122

133

987

SINTER {person}:firstname:jon {person}:lastname:snow

SUNION {person}:firstname:jon {person}:lastname:snow

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 21

@RedisHash("{person}")class Person { @Id String id; @Indexed String firstname; @Indexed String lastname; Address address;}

HMSET {person}:123 id 123 firstname john ...SADD {person}:firstname:john 123 SADD {person}:lastname:snow 123

SINTER {person}:firstname:jon {person}:lastname:snow

interface PersonRepository extends CrudRepository<Person, String> {""}

repo.save(new Person("123", "john", "snow"));

repo.update( newPartialUpdate("123", Person.class) .set("firstname", "jon"));

HSET {person}:123 firstname jonSREM {person}:firstname:john 123 SADD {person}:firstname:jon 123

List<Person> findByFirstnameAndLastname(String firstname, String lastname);

repo.findByFirstnameAndLastname("jon", "snow");HGETALL {person}:123

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 22

DEMORedis Repositories

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 23

Expire CommandsCustom ConversionsSpEL based indexing

References

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 24CC BY 2.0

https://www.flickr.com/photos/crystalflickr/2317183342

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 25

Reactive Data AccessGeo Indexes

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 26

@RedisHash("{person}")class Person { @Id String id; Address address;}

HMSET {person}:123 id 123 firstname jon ...GEOADD {person}:address:location 13.361389 39.115556 123

GEORADIUS {person}:address:location 15.0 37.0 200.0 km

interface PersonRepository extends CrudRepository<Person, String> {""}

repo.save(new Person("123", "jon", "snow") .withAddress( new Address("winterfell", new Point(13.361389D, 38.115556D))));

List<Person> findByAddressLocationNear(Point location, Distance distance);

repo.findByAddressLocationNear( new Point(15D, 37D), new Distance(200, Metrics.KILOMETERS));

HGETALL {person}:123

class Address { String city; @GeoIndexed Point location;}

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 / 27

Unless o therwise ind ica ted , these s l ides a re © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion -NonCommerc ia l l i cense : h t tp : / /c rea t ivecommons .org / l i censes /by -nc /3 .0 /

Related Sessions

• Wed, 3rd, August, 2016 • 2:00 pm – John Blum, Mark Paluch

Outlook: Spring Data Cassandra 1.5 "

• Thu, 4th, August, 2016 • 9:00 am – John Blum, Luke Shannon

Spring Data and In-Memory Data Management in Action "

• Thu, 4th, August, 2016 • 11:45 am – Viktor Gamov, Neil Stevenson

Spring Data Hazelcast: Fluently Accessing Distributed Repositories

28

Unless o therwise ind ica ted , these s l ides a re © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion -NonCommerc ia l l i cense : h t tp : / /c rea t ivecommons .org / l i censes /by -nc /3 .0 /

Learn More. Stay Connected.

Follow us @SpringData

@springcentral spring.io/blog

@pivotal pivotal.io/blog

@pivotalcf http://engineering.pivotal.io

Talk to us spring-projects/spring-data

Unless o therw ise ind ica ted , these s l ides are © 2013-2016 P ivo ta l So f tware , Inc . and l i censed under a Creat ive Commons At t r ibu t ion-NonCommerc ia l l i cense: h t tp : / / c rea t ivecommons.org / l i censes /by-nc /3 .0 /

Safe Harbor Statement

• The following is intended to outline the general direction of Pivotal's offerings. It is intended for information purposes only and may not be incorporated into any contract. Any information regarding pre-release of Pivotal offerings, future updates or other planned modifications is subject to ongoing evaluation by Pivotal and is subject to change. This information is provided without warranty or any kind, express or implied, and is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions regarding Pivotal's offerings. These purchasing decisions should only be based on features currently available. The development, release, and timing of any features or functionality described for Pivotal's offerings in this presentation remain at the sole discretion of Pivotal. Pivotal has no obligation to update forward looking information in this presentation.

30


Recommended