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

Spring Data Hazelcast - SpringOne Platform

Spring Data Hazelcast - SpringOne Platform

The primary goal of the Spring Data project is to make it easier to build Spring-powered applications that use data access technologies. In this talk, Neil and Viktor will present using a new Spring Data for Hazelcast project and demonstrate how using the Spring Data paradigm gains the power of a distributed data repository.

The implementation is built on the new Spring Data KeyValue module and is one of the first projects to do this. This module provides infrastructure components for creating repository abstractions for stores dealing with Key/Value pairs like java.util.Map or Hazelcast IMap.

Through the means of the repository interface, CRUD operations, and expression-based query methods can interrogate an in-memory data store in a manner consistent with the other Spring Data projects so developers can become productive quickly and easily.

Viktor Gamov

August 04, 2016
Tweet

More Decks by Viktor Gamov

Other Decks in Programming

Transcript

  1. Spring Data Hazelcast
    Fluently Accessing Distributed Repositories
    By Viktor Gamov / Neil Stevenson
    @gamussa / @hazelcast

    View full-size slide

  2. What’s is Hazelcast
    • Distributed Java Collections (Map, Set, List, Queue)
    • NoSQL in-memory store -
    • Scalability and Resilience for free
    • Spring support out-of-the-box
    4

    View full-size slide

  3. Why Spring Data Hazelcast
    • Started by Oliver Gierke & Christoph Strobl
    • Familiar "Spring Data" approach,
    • developers do not need to learn a new technology to be able to use it
    • Utilizes the new Spring-Data-Key value abstraction
    • Reduces vendor lock-in
    • One can swap Hazelcast in place of more expensive or slower options
    • FURTHER eases the integration of Hazelcast into Spring and clouds
    6

    View full-size slide

  4. dependencies {
    compile 'com.github.hazelcast:spring-data-hazelcast:1.0'
    }

    View full-size slide

  5. MOAR Queries!
    9
    public interface PersonRepository extends HazelcastRepository {
    public Long countByFirstname(String firstname);
    public Long countByIdLessThanEqual(String id);
    public Long countDistinctLastnameByFirstname(String firstname);
    public Person deleteByLastname(String firstname);
    public Person findFirstIdByOrderById();
    public Person findFirstIdByFirstnameOrderByIdDesc(String firstname);
    public List findByFirstname(String firstname);
    public List findByFirstname_AndLastname(String firstname, String lastname);
    public List findByFirstnameOrLastname(@Param("lastname") String s1, @Param("firstname") String s2);
    public List findByFirstnameGreaterThan(String firstname);
    public Page findByLastname(String lastname, Pageable pageable);
    public Page findByOrderByLastnameDesc(Pageable pageable);
    public Slice findByIdLike(String pattern, Pageable pageable);

    View full-size slide

  6. Resources
    • Project home https://github.com/hazelcast/spring-data-hazelcast
    • This demo https://github.com/gAmUssA/springoneplatform-demo
    • More Hazelcast Demos https://github.com/hazelcast/hazelcast-code-samples/
    10

    View full-size slide

  7. Learn More. Stay Connected.
    Follow @hazelcast / @gamussa
    @springcentral
    spring.io/blog
    @pivotal
    pivotal.io/blog
    @hazelcast
    http://blog.hazelcast.com

    View full-size slide