Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Spring Data Hazelcast: Fluently Accessing Distributed Repositories

1,058 views

Published on

SpringOne Platform 2016
Speakers: Viktor Gamov; Senior Solution Architect, Hazelcast & Neil Stevenson; Solutions Architect, Hazelcast

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.

Published in: Technology
  • Be the first to comment

Spring Data Hazelcast: Fluently Accessing Distributed Repositories

  1. 1. Spring Data Hazelcast Fluently Accessing Distributed Repositories By Viktor Gamov / Neil Stevenson @gamussa / @hazelcast
  2. 2. 3
  3. 3. What’s is Hazelcast • Distributed Java Collections (Map, Set, List, Queue) • NoSQL in-memory store - <K,V> • Scalability and Resilience for free • Spring support out-of-the-box 4
  4. 4. 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
  5. 5. dependencies { compile 'com.github.hazelcast:spring-data-hazelcast:1.0' }
  6. 6. MOAR Queries! 9 public interface PersonRepository extends HazelcastRepository<Person, String> { 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<Person> findByFirstname(String firstname); public List<Person> findByFirstname_AndLastname(String firstname, String lastname); public List<Person> findByFirstnameOrLastname(@Param("lastname") String s1, @Param("firstname") String s2); public List<Person> findByFirstnameGreaterThan(String firstname); public Page<Person> findByLastname(String lastname, Pageable pageable); public Page<Person> findByOrderByLastnameDesc(Pageable pageable); public Slice<Person> findByIdLike(String pattern, Pageable pageable);
  7. 7. 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
  8. 8. Learn More. Stay Connected. Follow @hazelcast / @gamussa @springcentral spring.io/blog @pivotal pivotal.io/blog @hazelcast http://blog.hazelcast.com

×