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

Building Event-Driven Java Applications using Redis Streams

Mark Paluch
November 15, 2018

Building Event-Driven Java Applications using Redis Streams

Slides to the talk I gave at Redis Day London 2018

Code: https://github.com/mp911de/redis-stream-demo

Mark Paluch

November 15, 2018
Tweet

More Decks by Mark Paluch

Other Decks in Programming

Transcript

  1. #RedisStreams @mp911de
    Event-Driven Java Applications 

    with Redis Streams
    Mark Paluch
    @mp911de

    View Slide

  2. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    Mark Paluch
    @mp911de
    Spring Data Project Lead at
    !2

    View Slide

  3. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    Use Cases
    !3

    View Slide

  4. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    Stream
    !4
    events
    15269848-0
    name: Alice
    15269858-1
    name: John
    last: Doe
    15269858-0
    name: Bob

    View Slide

  5. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    Stream
    !5
    events
    15269848-0
    name: Alice
    15269858-1
    name: John
    last: Doe
    ✕ Body Hash-like
    ✕ Consumer Groups
    ✕ Append-Only*
    15269858-0
    name: Bob

    View Slide

  6. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    Stream API
    !6
    15269848-0
    name: Alice
    15269858-1
    name: John
    last: Doe
    15269858-0
    name: Bob
    XRANGE
    XTRIM
    XREAD
    XADD
    XLEN
    events

    View Slide

  7. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    !7
    Demo
    redis-cli

    View Slide

  8. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    !8
    Demo
    Java

    View Slide

  9. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    Stream
    !9
    events

    View Slide

  10. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    Stream: Consumer Groups
    !10
    my-group
    consumer1: 15269848-0
    consumer2: 15269858-0
    another-group
    some-consumer:
    (offset)
    events

    View Slide

  11. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    Stream: Consumer Groups
    !11
    my-group
    consumer1: 15269848-0
    consumer2: 15269858-0
    another-group
    some-consumer:
    (offset)
    XREADGROUP
    XGROUP
    XACK
    events

    View Slide

  12. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    Stream Processing
    ! Inbound Messages
    ! Stream Consumer
    ! Result
    !12

    View Slide

  13. View Slide

  14. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    !14
    https://bit.ly/redis-streams

    View Slide

  15. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    Resources
    !Code: github.com/mp911de/redis-stream-demo
    !Slides: speakerdeck.com/mp911de/building-event-driven-java-
    applications-using-redis-streams (bit.ly/2RSa4dD)
    !15
    @mp911de
    /

    View Slide

  16. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a

    Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
    Thank you!
    /
    !16
    @mp911de

    View Slide