2© 2014 Pivotal Software, Inc. All rights reserved.
Presenter
John Blum @john_blum jxblumSenior Software EngineerSpring Data TeamPivotal Software, Inc.
Roles✧ Spring Data Team
✧ Spring Data GemFire Lead✧ Spring Data Cassandra Lead
✧ Apache Geode Committer
✧ Previously Pivotal GemFire Engineer & Technical Lead
3© 2014 Pivotal Software, Inc. All rights reserved. 3© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFirePast, Present & Future
John BlumSpring Data Team
4© 2014 Pivotal Software, Inc. All rights reserved.
Agenda✧ Background
✧ Project-Release Management
✧ Project Intent
✧ Recommended Practices (Tips)
✧ Improvements
✧ What’s next?
✧ QA
5© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data Team✧ John Blum
✧ Spring Data GemFire✧ Spring Data Cassandra
✧ Mark Paluch✧ Spring Data Redis✧ Spring Data Cassandra
✧ Christoph Strobl✧ Spring Data Redis✧ Spring Data MongoDB
✧ Greg Turnquist✧ Spring Data REST
✧ Oliver Gierke✧ Spring Data Team Lead
SpringData
✧ Spring Data Commons✧ Spring Data JPA✧ Spring Data MongoDB✧ Spring Data Redis✧ Spring Data Solr✧ Spring Data GemFire✧ Spring Data KeyValue✧ Spring Data REST✧ Spring Data Cassandra
http://projects.spring.io/spring-data/
6© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire Leadership✧ Costin Leau – Spring Team
✧ June 2010 – July 2012
✧ David Turanski – Spring Data/XD Teams
✧ August 2012 – August 2013
✧ John Blum – Spring Data Team
✧ August 2013 – Present SpringData
7© 2014 Pivotal Software, Inc. All rights reserved.
July 2013
July 2014
July 2015
July 2016
2012 - 2013SDG 1.2 – 1.3.2
GemFire 7.0David Turanski
2010-06-29Initial CommitGemFire 6.0.1Costin Leau
2013-08SDG 1.3.x
GemFire 7.0.1John Blum
2013-11-12SDG 1.3.3
GemFire 7.0.1
2014-04-03SDG 1.3.4
GemFire 7.0.1
2014-05-20SDG 1.4 GA
Dijkstra (1.4.6)GemFire 7.0.2
2014-09-05SDG 1.5 GA Evans (1.5.4)GemFire 7.0.2
2015-03-23SDG 1.6 GA
Fowler (1.6.3)GemFire 8.0.0
2015-09-01SDG 1.7 GA
Gosling (1.7.4)GemFire 8.1.0
2016-04-06SDG 1.8 GA
Hopper (1.8.2)GemFire 8.2.0
2016-07 ?SDG 1.9 M1
IngallsGemFire 8.2.1
2015-06-12SDG 1.7
(1.7.0.APACHE-GEODE-EA-SNAPSHOT)Apache Geode
1.0.0-incubating.SNAPSHOT
2016-02-10SDG 1.7
(1.7.0.APACHE-GEODE-EA-M1)Apache Geode
1.0.0-incubating-M1
2016-04-28Spring Data Geode 1.0.0
(1.0.0.APACHE-GEODE-INCUBATING-M2)Apache Geode
1.0.0-incubating.M2
2016-07 ?Spring Data Geode 1.0.0(1.0.0.APACHE-GEODE-
INCUBATING-M3)Apache Geode
1.0.0-incubating.M3
8© 2014 Pivotal Software, Inc. All rights reserved.
2013
2014
2015
2016
2017
2015
2016
2017
2015-09-01SDG 1.7 GA
Gosling (1.7.4)GemFire 8.1.0
2016-04-06SDG 1.8 GA
Hopper (1.8.2)GemFire 8.2.0
2016-12 ?SDG 1.9 GA
IngallsGemFire 8.2.1 …
2015-06-12SDG 1.7.0.APACHE-GEODE-EA-SNAPSHOTApache Geode 1.0.0-incubating.SNAPSHOT
2016-02-10SDG 1.7.0.APACHE-GEODE-EA-M1
Apache Geode 1.0.0-incubating-M1
2016-04-28Spring Data Geode 1.0.0.APACHE-GEODE-INCUBATING-M2
Apache Geode 1.0.0-incubating.M2
2016-07 ?Spring Data Geode 1.0.0(1.0.0.APACHE-GEODE-
INCUBATING-M3)Apache Geode
1.0.0-incubating.M3
SDG forks April 27, 2015SGF-398 – Support for Apache Geode
apache-geode GitHub branch
SDG with Apache Geode supportReleased June 12th, 2015
Announcement on spring.io/blog
SDG for Apache Geode name/version changeSpring Data Geode/1.0.0
Announcement on spring.io/blogArtifact in Maven Central
Spring Data GemFire
Spring Data Geode
9© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire / Geode Maven Artifacts
Spring Data GemFire<dependency> <groupId>org.springframework.data </groupId> <artifactId>spring-data-gemfire</artifactId> <version>1.8.2.RELEASE</version></dependency>
Spring Data Geode<dependency> <groupId>org.springframework.data </groupId> <artifactId>spring-data-geode</artifactId> <version>1.0.0.APACHE-GEODE-INCUBATING-M2</version></dependency>
Pivotal GemFire
http://search.maven.org/#artifactdetails%7Corg.springframework.data%7Cspring-data-gemfire%7C1.8.2.RELEASE%7Cjar
http://search.maven.org/#artifactdetails%7Corg.springframework.data%7Cspring-data-geode%7C1.0.0.APACHE-GEODE-INCUBATING-M2%7Cjar
10© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFireSpring Data Release Train
Dijkstra
Evans
Fowler
Gosling
Hopper
Ingalls
Spring Data Release Planning Page
SDG 1.4 SDG 1.5 SDG 1.6 SDG 1.7 SDG 1.8 SDG 1.9
M1
RC1
RELEASE (GA)
SR1
SR2
…
SR-N
✧ M – Milestone✧ RC – Release Candidate✧ SR – Service Release
11© 2014 Pivotal Software, Inc. All rights reserved.
Release TimelineSpring Data Geode
✧ Spring Data Geode is not part of the Spring Data Release Train.
✧ Spring Data Geode releases correspond to Apache Geode releases.✧ Release Management Wiki Page
12© 2014 Pivotal Software, Inc. All rights reserved.
Version SupportSpring Data GemFire
SDG Version Latest Version Spring Framework Spring Boot GemFire
1.3.x 1.3.4.RELEASE 3.0.x -- 7.0.1
1.4.x (Dijkstra)
1.4.6.RELASE 3.1.x 1.1.x 7.0.2
1.5.x (Evans)
1.5.4.RELEASE 3.2.x (3.2.17.RELEASE)
1.2.x (1.2.8.RELEASE)
7.0.2
1.6.x (Fowler)
1.6.3.RELEASE 4.0.x -- 8.0.0
1.7.x (Gosling)
1.7.4.RELEASE 4.1.x 1.3.x (1.3.6.RELEASE)
8.1.0
1.8.x (Hopper)
1.8.2.RELEASE 4.2.x (4.2.7.RELEASE)
1.4.0.RC1 8.2.0
1.9.x (Ingalls)
1.9.0.BUILD-SNAPSHOT 4.2.x (4.2.7.RELEASE)
-- 8.2.1
https://github.com/spring-projects/spring-data-gemfire/wiki/Spring-Data-GemFire-to-GemFire-Version-Compatibility
13© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data SupportSpring Boot
1.2(1.2.8.RELEASE)
1.3(1.3.6.RELEASE)
1.4(1.4.0.RC1)
Spring Data EvansSDG 1.5.4.RELEASE
Spring Data GoslingSDG 1.7.4.RELEASE
Spring Data HopperSDG 1.8.2.RELEASE
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-gemfire</artifactId> <version>1.4.0.RC1</version></dependency>`
14© 2014 Pivotal Software, Inc. All rights reserved.
“Simple things should be simple; complex things should be possible”
– Alan Kay
15© 2014 Pivotal Software, Inc. All rights reserved.
Intent & PurposeSpring Data GemFire / Geode
1. Focus on integrating the core Spring Framework’s powerful, non-invasive programming model & concepts to simplify the configuration and development of highly-scalable, distributed Spring applications using either Pivotal GemFire or Apache Geode.
2. Integration with the Spring portfolio…
16© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire / Geode Spring Framework
+ +
Using Pivotal GemFire or Apache Geode With Spring’s Transaction Management and Spring Data GemFire/Geode
To support both Local & Global (JTA) Transactions
|
17© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire / Geode Spring Framework
+ +
Using Pivotal GemFire or Apache Geode With Spring’s Cache Abstraction and Spring Data GemFire/Geode
To serve as a JCache (JSR-107) caching provider
|
18© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire / Geode Spring Data Commons
+
Using Pivotal GemFire or Apache Geode With SD Commons Repository Infrastructure and SD GemFire/Geode To rapidly build Data Access Objects (CRUD + Mapping + Querying)
|
19© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire / Geode Spring Data REST + Spring HATEAOS
+
Using Pivotal GemFire or Apache Geode With SDC Repositories, Spring Data REST and Spring HATEAOSTo easily create mature, hypermedia-driven REST web services
| +
20© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire Spring Integration
+
Using Pivotal GemFire with Spring Integration For Inbound (Cache Events & CQ) and Outbound Channel Adapters,
Message Store, Lock Registry, Metadata Store
21© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire Spring Session
+
Using Pivotal GemFire with Spring Session (Data GemFire)To simplify (HTTP) Session State Management
+
22© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire Spring XD
+
Using Pivotal GemFire with Spring XD (CQ, source & sink) To simplify Big Data applications
Performing Ingest, Analytics, Batch Jobs and Data Export
23© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire Spring Boot
+
Using Pivotal GemFire with Spring BootTo get up and running as quickly as possible
+
24© 2014 Pivotal Software, Inc. All rights reserved.
Pivotal GemFire & Spring Cloud
+
Use Spring Cloud (Connectors)To build Cloud Native Applications and Microservices
Using Pivotal GemFire
25© 2014 Pivotal Software, Inc. All rights reserved.
RecommendationsSpring Data GemFire
• Use Spring Boot
• Do not mix Spring (Java/XML) config with cache.xml or GemFire’s Cluster Config
• Prefer Java-based container configuration over XML
• Prefer the GemFireTemplate, Cache Abstraction and Repositories over direct use of GemFire’s API
• Do not use GemFire’s JTA Transaction Manager implementation; use Atomikos or another (OSS) JTA provider
• Know the difference between client/server and embedded peer cache Spring applications
26© 2014 Pivotal Software, Inc. All rights reserved.
Recommendations continued…Spring Data GemFire
• Learn GemFire forward (doc) and backwards (wiki), inside (source) and out (API)
• Make sure you really understand Spring’s core concepts and the programming model– DI, AOP, Templates, Data Access, Integration, MVC, Testing, etc…
27© 2014 Pivotal Software, Inc. All rights reserved.
Repository Query (Method) Extensions via Annotations (1.7)Improvement
interface CustomerRepository extends GemfireRepository<Customer, Long> {
@Trace @Limit(25) @Import(“org.example.app.domain.Customer”) @Hint({ “CustomerIdIdx”, “CustomerLastNameIdx” }) List<Customer> findByLastName(String lastName);
}
http://docs.spring.io/spring-data-gemfire/docs/current/reference/html/#gemfire-repositories.oql-extension
SGF-392 – Add support for OQL Query statement extensions in Repository Query methods via Annotations
28© 2014 Pivotal Software, Inc. All rights reserved.
Custom Expiration Annotation Support (1.7)Improvement
@TimeToLiveExpiration(timeout=“@expirationSettings[‘spel-defined-timeout’]” , action=“DESTROY”)@IdleTimeout(timeout=“300”, action=“${property.placeholder.defined.action}” )@Region(“Example”)class ApplicationDomainObject { .. }
http://docs.spring.io/spring-data-gemfire/docs/current/reference/html/#bootstrap:region:expiration:annotation
SGF-404 – Enable Expiration settings and policies to be specified per application domain object using…
29© 2014 Pivotal Software, Inc. All rights reserved.
Custom Expiration Annotation Support (Java config)Improvement
@Bean(name = “Example”)public PartitionedRegionFactoryBean exampleRegion(GemFireCache gemfireCache @Qualifier(“exampleRegionAttributes”) RegionAttributes<?,?> exampleRegionAttributes) {
PartitionedRegionFactoryBean exampleRegion = new PartitionedRegionFactoryBean();
exampleRegion.setCache(gemfireCache); exampleRegion.setAttributes(exampleRegionAttributes);
return exampleRegion;}
@Beanpublic RegionAttributesFactoryBean exampleRegionAttributes() { RegionAttributesFactoryBean exampleRegionAttributes = new RegionAttributesFactoryBean();
exampleRegionAttributes.setCustomEntryIdleTimeout(AnnotationBasedExpiration.forIdleTimeout());
return exampleRegionAttributes;}
30© 2014 Pivotal Software, Inc. All rights reserved.
Custom Expiration Annotation Support (XML)Improvement
<bean id="ttlExpiration" class="org.springframework.data.gemfire.support.AnnotationBasedExpiration" factory-method="forTimeToLive"/>
<gfe:partitioned-region id="Example" persistent="false"> <gfe:custom-entry-ttl ref="ttlExpiration"/></gfe:partitioned-region>
31© 2014 Pivotal Software, Inc. All rights reserved.
Data Snapshot Import/Export Support (1.7)Improvement
<gfe:partitioned-region id=“Users” persistent=“true” … /><gfe:partitioned-region id=“GuestUsers” persistent=“false” … />
<gfe-data:snapshot-service id=“cacheSnapshotService”> <gfe-data:snapshot-import location=“/path/to/users.zip”/> <gfe-data:snapshot-export location=“/path/to/snapshot/directory”/></gfe-data:snapshot-service/>
<gfe-data:snapshot-service id=“guestUsersSnapshotService” region-ref=“GuestUsers”> <gfe-data:snapshot-import location=“/path/to/users.snapshot”> <bean class=“example.GuestUsersSnapshotFilter”/> </gfe-data:snapshot-import> <gfe-data:snapshot-export location=“/path/to/activeUsers.snapshot” filter-ref=“activeUsersFilter”/></gfe-data:snapshot-service>
http://docs.spring.io/spring-data-gemfire/docs/current/reference/html/#bootstrap:snapshot
SGF-408 – Provide support in the SDG XML namespace to load pre-defined data set…
32© 2014 Pivotal Software, Inc. All rights reserved.
Other Notables (1.8)Improvements
• SGF-469 – Support for CDI
• SGF-504 – Support Repositories with multiple Spring Data modules on the CLASSPATH
• Follow the link for a list of all SDG 1.7 & 1.8 Bug Fixes, Improvements and New Features. – 96 in total
33© 2014 Pivotal Software, Inc. All rights reserved.
Improve Java-based Configuration SupportNext
@ClientCacheApplication(..)class ExampleClientCacheApplication {
}
@PeerCacheApplication(..)class ExamplePeerCacheApplication {
}
@CacheServerApplication(..)class ExampleCacheServerApplication {
}
SGF-492 – Improve GemFire Java-based configuration support
34© 2014 Pivotal Software, Inc. All rights reserved.
Annotation Support for GemFire Callbacks, CQs, IndexesNext
@Componentpublic class ExampleApplicationCallbacks {
@CacheListener(region = “Example”) public void afterCreate(EntryEvent<K, V> entryEvent) { .. }
@CacheListener(region = “AnotherExample”) public void afterUpdate(EntryEvent<K, V> entryEvent) { .. }}
SGF-453 – Add annotation support for GemFire callbacks
SGF-110 – Add annotation support for CQ Listeners
SGF-106 – Add annotation support for creating Indexes
35© 2014 Pivotal Software, Inc. All rights reserved.
Other Notables…Next
• SGF-301 – Refactor SDG Examples to use Spring Boot– Move to Spring Data Examples project
• SGF-377 – Implement Reactive Streams API for GemFire’s CQs
• SGF-451 – Support Function context aware Repositories
• SGF-452 – Support Function Executions on Repositories
• Follow the link for a complete list of all open Spring Data GemFire JIRA tickets.
• Design/Development on spring-data-gemfire-extensions.
• But wait, there is more…
36© 2014 Pivotal Software, Inc. All rights reserved.
PR #6224 – Auto-configuration support for SDG RepositoriesSpring Boot
interface CustomerRepository extends Repository<Customer, Long> {}
@Region(“Customers”)class Customer {}
compile “org.springframework.boot:spring-boot-starter-data-gemfire:1.4.0.RC1”
@SpringBootApplication@EnableGemfireRepositoriesclass ExampleSpringBootApplication {}
No longer necessary…
37© 2014 Pivotal Software, Inc. All rights reserved.
PR #5445 – Spring Boot Starter Data GeodeSpring Boot
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-geode</artifactId> <version>???</version></dependency>`
38© 2014 Pivotal Software, Inc. All rights reserved.
PR #366 – Spring Session Data GeodeSpring Session
<dependency> <groupId>org.springframework.session</groupId> <artifactId>spring-session-data-geode</artifactId> <version>???</version></dependency>`
39© 2014 Pivotal Software, Inc. All rights reserved.
References✧ Spring Data GemFire (SDG) project page
✧ SDG GitHub source code
✧ SDG Reference Guide
✧ SDG API
✧ SDG Wiki page
✧ SDG Examples
✧ SDG JIRA Issue Tracking
✧ SDG StackOverflow spring-data-gemfire tag
✧ spring-data Pivotal Slack Channel
✧ spring-data Gitter IM Channel
40© 2014 Pivotal Software, Inc. All rights reserved.
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/
Spring Data and In-Memory Data Management in Action
August 1 – 4, 2016, Aria, Las Vegas, NV
By John Blum, Luke Shannon@john_blum, @lukewshannon
41© 2014 Pivotal Software, Inc. All rights reserved. 41© 2014 Pivotal Software, Inc. All rights reserved.
QuestionsAnswers
42© 2014 Pivotal Software, Inc. All rights reserved. 42© 2014 Pivotal Software, Inc. All rights reserved.
Thank you