$30 off During Our Annual Pro Sale. View Details »

Distributed Caching for Your next Node.js Project

Distributed Caching for Your next Node.js Project

Viktor Gamov

June 15, 2017
Tweet

More Decks by Viktor Gamov

Other Decks in Programming

Transcript

  1. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Distributed Caching
    for Your next Node.js Project
    @gamussa @hazelcast #cloudfoundry #cfsummit17

    View Slide

  2. @gamussa @hazelcast #cloudfoundry #cfsummit17
    > whoami

    View Slide

  3. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Señor Solutions Architect
    > whoami

    View Slide

  4. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Señor Solutions Architect
    Developer Advocate
    > whoami

    View Slide

  5. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Señor Solutions Architect
    Developer Advocate
    @gamussa in internetz
    > whoami

    View Slide

  6. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Señor Solutions Architect
    Developer Advocate
    @gamussa in internetz
    Please, follow me on Twitter
    > whoami

    View Slide

  7. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Señor Solutions Architect
    Developer Advocate
    @gamussa in internetz
    Please, follow me on Twitter
    I’m very interesting ©
    > whoami

    View Slide

  8. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Why cache?

    View Slide

  9. @gamussa @hazelcast #cloudfoundry #cfsummit17

    View Slide

  10. @gamussa @hazelcast #cloudfoundry #cfsummit17

    View Slide

  11. @gamussa @hazelcast #cloudfoundry #cfsummit17

    View Slide

  12. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Applications are like onions
    Applications have layers

    View Slide

  13. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Business Application (instance 1)
    Service Service Service
    RDBMS Mainframe
    MongoDB

    NoSQL
    REST

    View Slide

  14. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Business Application (instance 2)
    Business Application (instance 1)
    Service Service Service
    RDBMS Mainframe
    MongoDB

    NoSQL
    REST

    View Slide

  15. @gamussa @hazelcast #cloudfoundry #cfsummit17

    View Slide

  16. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Business Application (instance 2)
    Business Application (instance 1)
    Service Service Service
    RDBMS Mainframe NoSQL REST
    CACHE

    View Slide

  17. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Business Application (instance 2)
    Business Application (instance 1)
    Service Service Service
    RDBMS Mainframe NoSQL REST
    CACHE
    Scale out

    View Slide

  18. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Business Application (instance 2)
    Business Application (instance 1)
    Service Service Service
    RDBMS Mainframe NoSQL REST
    CACHE
    Scale out
    Read thought
    Write through

    View Slide

  19. @gamussa @hazelcast #cloudfoundry #cfsummit17
    CACHES
    CACHES EVERYWHERE!

    View Slide

  20. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Cache is good for…

    View Slide

  21. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Cache is good for…
    ◇Improving performance

    View Slide

  22. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Cache is good for…
    ◇Improving performance
    ◇Offload expensive parts of the architecture

    View Slide

  23. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Cache is good for…
    ◇Improving performance
    ◇Offload expensive parts of the architecture
    ◇Scale up your – get the most out of one machine

    View Slide

  24. @gamussa @hazelcast #cloudfoundry #cfsummit17

    View Slide

  25. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Cache is good for…
    ◇Performance
    ◇Offload expensive parts of the architecture
    ◇Scale up – get the most out of one machine
    ◇Scale out – add more capacity with more machines

    View Slide

  26. @gamussa @hazelcast #cloudfoundry #cfsummit17

    View Slide

  27. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Caching use cases:
    ◇Performance
    ◇Offload expensive parts of the architecture
    ◇Scale up – get the most out of one machine
    ◇Scale out – add more capacity with more machines
    ◇Usually very fast and easy to apply

    View Slide

  28. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Problem
    ◇Data doesn’t fit just one machine
    ONE DOES NOT SIMPLY
    FIT ALL DATA IN ONE MACHINE

    View Slide

  29. @gamussa @hazelcast #cloudfoundry #cfsummit17
    ◇Amount of data is 

    too big to fit 


    View Slide

  30. @gamussa @hazelcast #cloudfoundry #cfsummit17
    ◇Data is too
    important to have
    it only one machine

    View Slide

  31. @gamussa @hazelcast #cloudfoundry #cfsummit17
    What’s

    View Slide

  32. @gamussa @hazelcast #cloudfoundry #cfsummit17

    View Slide

  33. @gamussa @hazelcast #cloudfoundry #cfsummit17
    REPLICATION

    View Slide

  34. @gamussa @hazelcast #cloudfoundry #cfsummit17
    REPLICATION
    SHARDING

    View Slide

  35. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Replication or Sharding?
    http://book.mixu.net/distsys/single-page.html

    View Slide

  36. @gamussa @hazelcast #cloudfoundry #cfsummit17
    What’s Hazelcast IMDG?

    View Slide

  37. @gamussa @hazelcast #cloudfoundry #cfsummit17
    What’s Hazelcast IMDG?
    ◇In-memory Data Grid

    View Slide

  38. @gamussa @hazelcast #cloudfoundry #cfsummit17
    What’s Hazelcast IMDG?
    ◇In-memory Data Grid
    ◇Apache v2 Licensed

    View Slide

  39. @gamussa @hazelcast #cloudfoundry #cfsummit17
    What’s Hazelcast IMDG?
    ◇In-memory Data Grid
    ◇Apache v2 Licensed
    ◇Distributed
    ■Caches (IMap, JCache)
    ■Collections (IList, ISet, IQueue)
    ■Messaging (Topic, RingBuffer)
    ■Computation (ExecutorService, M-R)

    View Slide

  40. @gamussa @hazelcast #cloudfoundry #cfsummit17
    https://network.pivotal.io/products/hazelcast

    View Slide

  41. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Tile Capabilities
    ◇dedicated VM for service
    ◇Support for multiple availability zones
    ◇Bosh ensures the availability of all VMs
    ◇Only Tile, no separate Bosh release for ODB

    View Slide

  42. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Polyglot Platform

    View Slide

  43. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Demo time!
    Let’s see some code, yay!

    View Slide

  44. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Useful materials
    ◇ Features https://hazelcast.org/clients/node-js/
    ◇Refcard http://bit.ly/hzNodeRefcard
    ◇NPM package https://www.npmjs.com/package/hazelcast-client

    View Slide

  45. @gamussa @hazelcast #cloudfoundry #cfsummit17
    https:/
    /github.com/hazelcast/
    cfsummit17-wednesday

    View Slide

  46. @gamussa @hazelcast #cloudfoundry #cfsummit17
    Thanks!
    Any questions?
    You can find me at:
    ◇@gamussa
    [email protected]
    ◇http://gamov.io

    View Slide