SlideShare a Scribd company logo
Building Effective Apache Geode Applications with Spring Data GemFire
2© 2014 Pivotal Software, Inc. All rights reserved. 2© 2014 Pivotal Software, Inc. All rights reserved.
Building Effective Apache Geode
Applications with Spring Data GemFire
John Blum - @john_blum
© 2015 - Pivotal Software, Inc.
3© 2014 Pivotal Software, Inc. All rights reserved.
Presenter
John Blum
Spring Data GemFire Project Lead
Apache Geode Committer
GemFire Engineer/Technical Lead
Responsibilities…
• Management & Monitoring (Gfsh)
• Management REST API
• Developer REST API
• Spring Data GemFire (v1.3.3 – current)
4© 2014 Pivotal Software, Inc. All rights reserved.
Agenda
 Quick Overview of Apache Geode
 Spring Data GemFire
– Configuration / Bootstrapping
– Data Access (DAO patterns)
– Function Execution
– Caching (JSR-107)
 Conclusion
 QA
5© 2014 Pivotal Software, Inc. All rights reserved.
Why Apache Geode?
Motivation…
1. Volume of Data (Big Data)
2. Rate of Data (Fast Data)
3. Verity of Data (Data Accuracy)
Enables new and existing Java applications to operate at cloud-scale in a
consistent, highly-available and predictable manner in order to transact and
analyze big, fast data in real-time thereby achieving meaningful and impactful
business results.
6© 2014 Pivotal Software, Inc. All rights reserved.
What is Apache Geode?
“A distributed, in-memory compute and
data management platform that
elastically scales to achieve high-
throughput, low-latency access to big,
fast data powering business critical,
analytical applications in real-time.”
– John Blum
Elastic capacity +/-
Nodes
Ops /
SecLinear scalability
Latency optimized
data distribution
7© 2014 Pivotal Software, Inc. All rights reserved.
How Apache Geode Works?
 Stores data In-Memory
– JVM Heap + Off-Heap
 Functions as a Distributed System, In-Memory Data Grid (IMDG)
– Pools system resources across multiple nodes in a cluster to manage both
application state and behavior
– Includes: Memory, CPU, Network & (optionally) Disk
8© 2014 Pivotal Software, Inc. All rights reserved.
Characteristics of Apache Geode
 Open Source
 In-Memory
 Distributed
 Scalable (scale-out)
 High Throughput & Low/Predictable Latency
 Highly Available
 Consistent
 Durable
 Fault Tolerant (resilient)
 Data-Aware / Parallel Compute
9© 2014 Pivotal Software, Inc. All rights reserved.
Apache Geode Use Cases
 Persistent, OLTP/OLAP Database (System of Record)
 JSR-107 Cache Provider (Key/Value Store)
 HTTP Session State Management
 Distributed L2 Caching for Hibernate
 Memcached Server (Gemcached)
 Glorified version of ConcurrentHashMap
 Message Bus with guaranteed message delivery
10© 2014 Pivotal Software, Inc. All rights reserved. 10© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire
For Apache Geode
http://projects.spring.io/spring-data-gemfire/
11© 2014 Pivotal Software, Inc. All rights reserved.
“Simple things should be simple;
complex things should be possible”
– Alan Kay
12© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire (SDG)
Applies Spring's powerful, non-invasive programming model in a consistent
fashion to simplify configuration and development of Apache Geode applications.
Spring Ecosystem Integration…
– Spring Cache Abstraction / Transaction Management
– Spring Data Commons + REST
– Spring Integration (Inbound/Outbound Channel Adapters)
– Spring Session (coming soon…)
– Spring XD (Sources & Sinks)
13© 2014 Pivotal Software, Inc. All rights reserved.
+ +
Apache Geode with Spring Data GemFire and Spring’s Cache
Abstraction is a JSR-107 (JCache) caching provider
14© 2014 Pivotal Software, Inc. All rights reserved.
GRAILS
Full-stack, Web
XD
Stream, Taps, Jobs
BOOT
Bootable, Minimal, Ops-Ready
Big,
Fast,
Flexible
Data Web,
Integration,
Batch
WEB
Controllers, REST,
WebSocket
INTEGRATION
Channels, Adapters,
Filters, Transformers
BATCH
Jobs, Steps,
Readers, Writers
BIG DATA
Ingestion, Export,
Orchestration, Hadoop
DATA
NON-RELATIONALRELATIONAL
CORE
GROOVYFRAMEWORK SECURITY REACTOR
15© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire Use Cases
 Configure & Bootstrap Apache Geode
– Replacement for cache.xml; Can be used with Cluster Configuration
 Build an Application Peer Cache (Cache)
– Embedded Cache
 Build an Application Cache Client (ClientCache)
– Client/Server
16© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire / Apache Geode Coordinates
<repository>
<id>spring-libs-snapshot</id>
<name>Spring Maven libs-snapshot Repository</name>
<url>https://repo.spring.io/libs-snapshot</url>
</repository>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-gemfire</artifactId>
<version>1.7.0.APACHE-GEODE-EA-SNAPSHOT</version>
</dependency>
17© 2014 Pivotal Software, Inc. All rights reserved.
Spring-based Configuration
XML Java-based Configuration
18© 2014 Pivotal Software, Inc. All rights reserved.
Bootstrapping Apache Geode with Spring
@SpringBootApplication
@ImportResource("/spring-gemfire-context.xml")
public class SpringGemFireApplication {
public static void main(String[] args) {
SpringApplication.run(SpringGemFireApplication.class, args);
}
}
gfsh>start server -–name=Example --spring-xml-location=
<classpath-to-spring-application-context.xml>
19© 2014 Pivotal Software, Inc. All rights reserved.
Example
20© 2014 Pivotal Software, Inc. All rights reserved.
Data Access with Spring
Basic (Region) Data Access Object (DAO)…
@Repository
public class GolferDao extends DaoSupport {
@Resource(name = “Golfers”)
private Region<Long, Golfer> golfers;
…
}
21© 2014 Pivotal Software, Inc. All rights reserved.
Data Access with SDG GemfireTemplate
Advantages
 Simple, Convenient Data Access API (CRUD, OQL, Function)
 Protects developer from GemFire/Geode API changes
 Exception Translation into Spring DAO Exception Hierarchy
 Transaction Management
<bean id=“golfersTemplate” class=“org.springframework.data.gemfire.GemfireTemplate”
p:region-ref=“Golfers”/>
22© 2014 Pivotal Software, Inc. All rights reserved.
Data Access with Spring Data Repositories
Advantages
 Simple, interface-based, Spring Data Repository definition (CRUD, Querying)
 Convention over Configuration (Querying)
 Portable
 Exception Translation & Transaction Management Support
public interface GolferRepository extends CrudRepository<Golfer, Long> {
List<Golfer> findByName(String name);
}
23© 2014 Pivotal Software, Inc. All rights reserved.
Example
24© 2014 Pivotal Software, Inc. All rights reserved.
Annotation-based Function Support
Spring Data GemFire introduces annotation support for Function implementation
and execution.
 Functions are implemented as POJO methods
 Functions are invoked using Object-Oriented method invocation.
SDG supports…
 @OnServer / @OnServers (from client only)
 @OnMember / @OnMembers (from peer only)
 @OnRegion (from either client or peer)
25© 2014 Pivotal Software, Inc. All rights reserved.
Annotation-based Function Implementation
package example.app.function;
@Component
class CustomerFunctions {
@GemfireFunction
public Customer update(Address address, PhoneNumber phoneNumber) { … }
@GemfireFunction(id = “MyFunction” HA=true)
public List<?> functionTwo(FunctionContext funcCtx, @Filter Set<?> keys, …) { … }
}
<gfe:annotation-driven/>
<!– optional when using <context:annotation-config> or <context:component-scan> -->
<bean class=“example.app.function.CustomerFunctions”/>
26© 2014 Pivotal Software, Inc. All rights reserved.
Annotation-based Function Execution
package example.app.function.executions;
@OnRegion(“Customers”)
interface CustomersFunctionExecution {
Customer update(Address address, PhoneNumber phoneNumber);
}
<gfe-data:function-executions base-package=“example.app.function.executions”/>
@Component
class ApplicationComponent {
@Autowired
private CustomersFunctionExecution customersFunction;
public Customer someMethod(Address address, PhoneNumber phoneNumber) {
return customersFunction.update(address, phoneNumber);
}
27© 2014 Pivotal Software, Inc. All rights reserved.
Example
28© 2014 Pivotal Software, Inc. All rights reserved.
Spring Cache Abstraction
Caching is useful in cases when an “expensive” operation (i.e. CPU, IO bound)
produces the same output given identical input; results can be reused.
Spring enables Declarative, Annotation-based Caching…
 @Cacheable – triggers cache population
 @CacheEvict – triggers cache eviction
 @CachePut – updates cache without interfering with method execution
 @Caching – groups multiple cache operations per method
 @CacheConfig – class-level cache-related settings
29© 2014 Pivotal Software, Inc. All rights reserved.
Spring Supports JSR-107 (JCache)
Spring JCache
@Cacheable @CacheResult
@CachePut @CachePut
@CacheEvict @CacheRemove
@CacheEvict(allEntries=true) @CacheRemoveAll
@CacheConfig @CacheDefaults
http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#cache-jsr-107
30© 2014 Pivotal Software, Inc. All rights reserved.
Apache Geode Caching Provider
@Configuration
@EnableCaching
@Import(GemFireConfiguration.class)
class ApplicationConfiguration {
@Bean
public CacheManager cacheManager(
Cache gemfireCache) {
GemfireCacheManager cacheManager =
new GemfireCacheManager();
cacheManager.setCache(gemfireCache);
return cacheManager;
}
}
<beans …
xmlns:cache=“http://www.springframework.org/schema/cach
e”…>
<gfe:cache properties-
ref="gemfireProperties"/>
<cache:annotation-driven/>
<bean id="cacheManager" class=
”o.s.data.gemfire.support.GemfireCacheManager"
p:cache-ref="gemfireCache"/>
31© 2014 Pivotal Software, Inc. All rights reserved.
Example
32© 2014 Pivotal Software, Inc. All rights reserved.
Conclusion
33© 2014 Pivotal Software, Inc. All rights reserved.
Apache Geode References
 Project Page - http://geode.incubator.apache.org/contribute/
 Contribute - http://geode.incubator.apache.org/contribute/
– Ideas - https://cwiki.apache.org/confluence/display/GEODE/How+to+Contribute
 Community Events - http://geode.incubator.apache.org/community/
 Documentation - http://geode.incubator.apache.org/docs/
– Docs Project - https://github.com/project-geode/docs
 Source Code - https://github.com/apache/incubator-geode
 JIRA - https://issues.apache.org/jira/browse/GEODE
 StackOverflow - http://stackoverflow.com/questions/tagged/gemfire+and+geode
34© 2014 Pivotal Software, Inc. All rights reserved.
Spring Data GemFire References
 Project Page - http://projects.spring.io/spring-data/
 Documentation –
– Reference Guide - http://docs.spring.io/spring-data-gemfire/docs/current/reference/html/
– API - http://docs.spring.io/spring-data-gemfire/docs/current/api/
– Spring IO Guides - http://spring.io/guides
– Spring GemFire Examples –
 Source Code - https://github.com/spring-projects/spring-data-gemfire
 Examples - https://github.com/spring-projects/spring-gemfire-examples
 JIRA – https://jira.spring.io/browse/SGF
 StackOverflow - http://stackoverflow.com/questions/tagged/spring-data-gemfire
35© 2014 Pivotal Software, Inc. All rights reserved. 3
Building High-Scalable Spring Applications with In-Memory Data Grids
September 15th, 2015 – 10:30 am – 12 pm
Learn More. Stay Connected.
@springcentral Spring.io/video
https://2015.event.springone2gx.com/schedule/sessions/building_highly_scalable_spring_applications_with_in_memory_distribute
d_data_grids.html
36© 2014 Pivotal Software, Inc. All rights reserved. 36© 2014 Pivotal Software, Inc. All rights reserved.
Q&A
Any questions…
37© 2014 Pivotal Software, Inc. All rights reserved. 37© 2014 Pivotal Software, Inc. All rights reserved.
Thank You
Building Effective Apache Geode Applications with Spring Data GemFire

More Related Content

What's hot (20)

PDF
Scale Out Your Big Data Apps: The Latest on Pivotal GemFire and GemFire XD
VMware Tanzu
 
PPTX
GemFire In Memory Data Grid
Dmitry Buzdin
 
PPTX
YARN Containerized Services: Fading The Lines Between On-Prem And Cloud
DataWorks Summit
 
PDF
SpringCamp 2016 - Apache Geode 와 Spring Data Gemfire
Jay Lee
 
PDF
Build your first Internet of Things app today with Open Source
Apache Geode
 
PPTX
Geode Meetup Apachecon
upthewaterspout
 
PDF
Apache Geode Meetup, Cork, Ireland at CIT
Apache Geode
 
PPTX
ApexMeetup Geode - Talk1 2016-03-17
Apache Apex Organizer
 
PPTX
Cloud Native PostgreSQL
EDB
 
PPTX
Hive LLAP: A High Performance, Cost-effective Alternative to Traditional MPP ...
DataWorks Summit
 
PDF
Building Apps with Distributed In-Memory Computing Using Apache Geode
PivotalOpenSourceHub
 
PDF
Apache Geode - The First Six Months
Anthony Baker
 
PDF
Hadoop {Submarine} Project: Running Deep Learning Workloads on YARN
DataWorks Summit
 
PPTX
Running Enterprise Workloads in the Cloud
DataWorks Summit
 
PPTX
Not all open source is the same
EDB
 
PPTX
Apache Geode (incubating) Introduction with Docker
William Markito Oliveira
 
PPTX
Next Generation Scheduling for YARN and K8s: For Hybrid Cloud/On-prem Environ...
DataWorks Summit
 
PDF
Apache Geode Meetup, London
Apache Geode
 
PPTX
How to Design for Database High Availability
EDB
 
PPTX
Deep Dive - Usage of on premises data gateway for hybrid integration scenarios
Sajith C P Nair
 
Scale Out Your Big Data Apps: The Latest on Pivotal GemFire and GemFire XD
VMware Tanzu
 
GemFire In Memory Data Grid
Dmitry Buzdin
 
YARN Containerized Services: Fading The Lines Between On-Prem And Cloud
DataWorks Summit
 
SpringCamp 2016 - Apache Geode 와 Spring Data Gemfire
Jay Lee
 
Build your first Internet of Things app today with Open Source
Apache Geode
 
Geode Meetup Apachecon
upthewaterspout
 
Apache Geode Meetup, Cork, Ireland at CIT
Apache Geode
 
ApexMeetup Geode - Talk1 2016-03-17
Apache Apex Organizer
 
Cloud Native PostgreSQL
EDB
 
Hive LLAP: A High Performance, Cost-effective Alternative to Traditional MPP ...
DataWorks Summit
 
Building Apps with Distributed In-Memory Computing Using Apache Geode
PivotalOpenSourceHub
 
Apache Geode - The First Six Months
Anthony Baker
 
Hadoop {Submarine} Project: Running Deep Learning Workloads on YARN
DataWorks Summit
 
Running Enterprise Workloads in the Cloud
DataWorks Summit
 
Not all open source is the same
EDB
 
Apache Geode (incubating) Introduction with Docker
William Markito Oliveira
 
Next Generation Scheduling for YARN and K8s: For Hybrid Cloud/On-prem Environ...
DataWorks Summit
 
Apache Geode Meetup, London
Apache Geode
 
How to Design for Database High Availability
EDB
 
Deep Dive - Usage of on premises data gateway for hybrid integration scenarios
Sajith C P Nair
 

Viewers also liked (11)

PDF
Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...
Christian Tzolov
 
PPTX
#GeodeSummit - Off-Heap Storage Current and Future Design
PivotalOpenSourceHub
 
PDF
#GeodeSummit - Redis to Geode Adaptor
PivotalOpenSourceHub
 
PDF
#GeodeSummit - Large Scale Fraud Detection using GemFire Integrated with Gree...
PivotalOpenSourceHub
 
PPTX
Open Sourcing GemFire - Apache Geode
Apache Geode
 
PDF
Introduction to Apache Calcite
Jordan Halterman
 
PDF
IoT Architecture - are traditional architectures good enough?
Guido Schmutz
 
PDF
Connections
Malik Vaughan
 
PPTX
La memoria
Karina Lopez
 
DOCX
cv..eg -
Muhammad sufian
 
PDF
Matthew Hartman cv.docx (1)
matthew hartman
 
Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...
Christian Tzolov
 
#GeodeSummit - Off-Heap Storage Current and Future Design
PivotalOpenSourceHub
 
#GeodeSummit - Redis to Geode Adaptor
PivotalOpenSourceHub
 
#GeodeSummit - Large Scale Fraud Detection using GemFire Integrated with Gree...
PivotalOpenSourceHub
 
Open Sourcing GemFire - Apache Geode
Apache Geode
 
Introduction to Apache Calcite
Jordan Halterman
 
IoT Architecture - are traditional architectures good enough?
Guido Schmutz
 
Connections
Malik Vaughan
 
La memoria
Karina Lopez
 
cv..eg -
Muhammad sufian
 
Matthew Hartman cv.docx (1)
matthew hartman
 
Ad

Similar to Building Effective Apache Geode Applications with Spring Data GemFire (20)

PPTX
#GeodeSummit - Spring Data GemFire API Current and Future
PivotalOpenSourceHub
 
PDF
Part 4: Custom Buildpacks and Data Services (Pivotal Cloud Platform Roadshow)
VMware Tanzu
 
PPTX
Building and managing applications fast for IBM i
Zend by Rogue Wave Software
 
PPTX
Custom Buildpacks and Data Services
Tom Kranz
 
PPTX
PaaS on Openstack
Open Stack
 
PPTX
Building microservice for api with helidon and cicd pipeline
DonghuKIM2
 
PPTX
Sst hackathon express
Aeshan Wijetunge
 
PPTX
SAP Inside Track Singapore 2014
mharkus
 
PPTX
Spring Data and In-Memory Data Management in Action
John Blum
 
PPTX
Micro services vs hadoop
Gergely Devenyi
 
PPTX
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
jeckels
 
PPTX
Apigee deploy grunt plugin.1.0
Diego Zuluaga
 
DOC
Ramji
Ram Ji Soni
 
PPTX
Timings API: Performance Assertion during the functional testing
PetrosPlakogiannis
 
PPTX
SAP Kapsel Plugins For Cordova
Chris Whealy
 
PDF
Next gen tech from QuickXpert Infotech
Narendra Jakhotia
 
DOCX
DavidWible_res
david wible
 
PDF
JAX-RS.next
Michal Gajdos
 
PDF
Java 9 New Features | Java Tutorial | What’s New in Java 9 | Java 9 Features ...
Edureka!
 
PDF
Google App Engine
Anil Saldanha
 
#GeodeSummit - Spring Data GemFire API Current and Future
PivotalOpenSourceHub
 
Part 4: Custom Buildpacks and Data Services (Pivotal Cloud Platform Roadshow)
VMware Tanzu
 
Building and managing applications fast for IBM i
Zend by Rogue Wave Software
 
Custom Buildpacks and Data Services
Tom Kranz
 
PaaS on Openstack
Open Stack
 
Building microservice for api with helidon and cicd pipeline
DonghuKIM2
 
Sst hackathon express
Aeshan Wijetunge
 
SAP Inside Track Singapore 2014
mharkus
 
Spring Data and In-Memory Data Management in Action
John Blum
 
Micro services vs hadoop
Gergely Devenyi
 
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
jeckels
 
Apigee deploy grunt plugin.1.0
Diego Zuluaga
 
Timings API: Performance Assertion during the functional testing
PetrosPlakogiannis
 
SAP Kapsel Plugins For Cordova
Chris Whealy
 
Next gen tech from QuickXpert Infotech
Narendra Jakhotia
 
DavidWible_res
david wible
 
JAX-RS.next
Michal Gajdos
 
Java 9 New Features | Java Tutorial | What’s New in Java 9 | Java 9 Features ...
Edureka!
 
Google App Engine
Anil Saldanha
 
Ad

Recently uploaded (20)

PDF
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
PPTX
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
PDF
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
PDF
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PDF
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
PPTX
Wondershare Filmora Crack Free Download 2025
josanj305
 
PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
PPTX
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
PDF
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
Kubernetes - Architecture & Components.pdf
geethak285
 
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
Wondershare Filmora Crack Free Download 2025
josanj305
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 

Building Effective Apache Geode Applications with Spring Data GemFire

  • 2. 2© 2014 Pivotal Software, Inc. All rights reserved. 2© 2014 Pivotal Software, Inc. All rights reserved. Building Effective Apache Geode Applications with Spring Data GemFire John Blum - @john_blum © 2015 - Pivotal Software, Inc.
  • 3. 3© 2014 Pivotal Software, Inc. All rights reserved. Presenter John Blum Spring Data GemFire Project Lead Apache Geode Committer GemFire Engineer/Technical Lead Responsibilities… • Management & Monitoring (Gfsh) • Management REST API • Developer REST API • Spring Data GemFire (v1.3.3 – current)
  • 4. 4© 2014 Pivotal Software, Inc. All rights reserved. Agenda  Quick Overview of Apache Geode  Spring Data GemFire – Configuration / Bootstrapping – Data Access (DAO patterns) – Function Execution – Caching (JSR-107)  Conclusion  QA
  • 5. 5© 2014 Pivotal Software, Inc. All rights reserved. Why Apache Geode? Motivation… 1. Volume of Data (Big Data) 2. Rate of Data (Fast Data) 3. Verity of Data (Data Accuracy) Enables new and existing Java applications to operate at cloud-scale in a consistent, highly-available and predictable manner in order to transact and analyze big, fast data in real-time thereby achieving meaningful and impactful business results.
  • 6. 6© 2014 Pivotal Software, Inc. All rights reserved. What is Apache Geode? “A distributed, in-memory compute and data management platform that elastically scales to achieve high- throughput, low-latency access to big, fast data powering business critical, analytical applications in real-time.” – John Blum Elastic capacity +/- Nodes Ops / SecLinear scalability Latency optimized data distribution
  • 7. 7© 2014 Pivotal Software, Inc. All rights reserved. How Apache Geode Works?  Stores data In-Memory – JVM Heap + Off-Heap  Functions as a Distributed System, In-Memory Data Grid (IMDG) – Pools system resources across multiple nodes in a cluster to manage both application state and behavior – Includes: Memory, CPU, Network & (optionally) Disk
  • 8. 8© 2014 Pivotal Software, Inc. All rights reserved. Characteristics of Apache Geode  Open Source  In-Memory  Distributed  Scalable (scale-out)  High Throughput & Low/Predictable Latency  Highly Available  Consistent  Durable  Fault Tolerant (resilient)  Data-Aware / Parallel Compute
  • 9. 9© 2014 Pivotal Software, Inc. All rights reserved. Apache Geode Use Cases  Persistent, OLTP/OLAP Database (System of Record)  JSR-107 Cache Provider (Key/Value Store)  HTTP Session State Management  Distributed L2 Caching for Hibernate  Memcached Server (Gemcached)  Glorified version of ConcurrentHashMap  Message Bus with guaranteed message delivery
  • 10. 10© 2014 Pivotal Software, Inc. All rights reserved. 10© 2014 Pivotal Software, Inc. All rights reserved. Spring Data GemFire For Apache Geode http://projects.spring.io/spring-data-gemfire/
  • 11. 11© 2014 Pivotal Software, Inc. All rights reserved. “Simple things should be simple; complex things should be possible” – Alan Kay
  • 12. 12© 2014 Pivotal Software, Inc. All rights reserved. Spring Data GemFire (SDG) Applies Spring's powerful, non-invasive programming model in a consistent fashion to simplify configuration and development of Apache Geode applications. Spring Ecosystem Integration… – Spring Cache Abstraction / Transaction Management – Spring Data Commons + REST – Spring Integration (Inbound/Outbound Channel Adapters) – Spring Session (coming soon…) – Spring XD (Sources & Sinks)
  • 13. 13© 2014 Pivotal Software, Inc. All rights reserved. + + Apache Geode with Spring Data GemFire and Spring’s Cache Abstraction is a JSR-107 (JCache) caching provider
  • 14. 14© 2014 Pivotal Software, Inc. All rights reserved. GRAILS Full-stack, Web XD Stream, Taps, Jobs BOOT Bootable, Minimal, Ops-Ready Big, Fast, Flexible Data Web, Integration, Batch WEB Controllers, REST, WebSocket INTEGRATION Channels, Adapters, Filters, Transformers BATCH Jobs, Steps, Readers, Writers BIG DATA Ingestion, Export, Orchestration, Hadoop DATA NON-RELATIONALRELATIONAL CORE GROOVYFRAMEWORK SECURITY REACTOR
  • 15. 15© 2014 Pivotal Software, Inc. All rights reserved. Spring Data GemFire Use Cases  Configure & Bootstrap Apache Geode – Replacement for cache.xml; Can be used with Cluster Configuration  Build an Application Peer Cache (Cache) – Embedded Cache  Build an Application Cache Client (ClientCache) – Client/Server
  • 16. 16© 2014 Pivotal Software, Inc. All rights reserved. Spring Data GemFire / Apache Geode Coordinates <repository> <id>spring-libs-snapshot</id> <name>Spring Maven libs-snapshot Repository</name> <url>https://repo.spring.io/libs-snapshot</url> </repository> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-gemfire</artifactId> <version>1.7.0.APACHE-GEODE-EA-SNAPSHOT</version> </dependency>
  • 17. 17© 2014 Pivotal Software, Inc. All rights reserved. Spring-based Configuration XML Java-based Configuration
  • 18. 18© 2014 Pivotal Software, Inc. All rights reserved. Bootstrapping Apache Geode with Spring @SpringBootApplication @ImportResource("/spring-gemfire-context.xml") public class SpringGemFireApplication { public static void main(String[] args) { SpringApplication.run(SpringGemFireApplication.class, args); } } gfsh>start server -–name=Example --spring-xml-location= <classpath-to-spring-application-context.xml>
  • 19. 19© 2014 Pivotal Software, Inc. All rights reserved. Example
  • 20. 20© 2014 Pivotal Software, Inc. All rights reserved. Data Access with Spring Basic (Region) Data Access Object (DAO)… @Repository public class GolferDao extends DaoSupport { @Resource(name = “Golfers”) private Region<Long, Golfer> golfers; … }
  • 21. 21© 2014 Pivotal Software, Inc. All rights reserved. Data Access with SDG GemfireTemplate Advantages  Simple, Convenient Data Access API (CRUD, OQL, Function)  Protects developer from GemFire/Geode API changes  Exception Translation into Spring DAO Exception Hierarchy  Transaction Management <bean id=“golfersTemplate” class=“org.springframework.data.gemfire.GemfireTemplate” p:region-ref=“Golfers”/>
  • 22. 22© 2014 Pivotal Software, Inc. All rights reserved. Data Access with Spring Data Repositories Advantages  Simple, interface-based, Spring Data Repository definition (CRUD, Querying)  Convention over Configuration (Querying)  Portable  Exception Translation & Transaction Management Support public interface GolferRepository extends CrudRepository<Golfer, Long> { List<Golfer> findByName(String name); }
  • 23. 23© 2014 Pivotal Software, Inc. All rights reserved. Example
  • 24. 24© 2014 Pivotal Software, Inc. All rights reserved. Annotation-based Function Support Spring Data GemFire introduces annotation support for Function implementation and execution.  Functions are implemented as POJO methods  Functions are invoked using Object-Oriented method invocation. SDG supports…  @OnServer / @OnServers (from client only)  @OnMember / @OnMembers (from peer only)  @OnRegion (from either client or peer)
  • 25. 25© 2014 Pivotal Software, Inc. All rights reserved. Annotation-based Function Implementation package example.app.function; @Component class CustomerFunctions { @GemfireFunction public Customer update(Address address, PhoneNumber phoneNumber) { … } @GemfireFunction(id = “MyFunction” HA=true) public List<?> functionTwo(FunctionContext funcCtx, @Filter Set<?> keys, …) { … } } <gfe:annotation-driven/> <!– optional when using <context:annotation-config> or <context:component-scan> --> <bean class=“example.app.function.CustomerFunctions”/>
  • 26. 26© 2014 Pivotal Software, Inc. All rights reserved. Annotation-based Function Execution package example.app.function.executions; @OnRegion(“Customers”) interface CustomersFunctionExecution { Customer update(Address address, PhoneNumber phoneNumber); } <gfe-data:function-executions base-package=“example.app.function.executions”/> @Component class ApplicationComponent { @Autowired private CustomersFunctionExecution customersFunction; public Customer someMethod(Address address, PhoneNumber phoneNumber) { return customersFunction.update(address, phoneNumber); }
  • 27. 27© 2014 Pivotal Software, Inc. All rights reserved. Example
  • 28. 28© 2014 Pivotal Software, Inc. All rights reserved. Spring Cache Abstraction Caching is useful in cases when an “expensive” operation (i.e. CPU, IO bound) produces the same output given identical input; results can be reused. Spring enables Declarative, Annotation-based Caching…  @Cacheable – triggers cache population  @CacheEvict – triggers cache eviction  @CachePut – updates cache without interfering with method execution  @Caching – groups multiple cache operations per method  @CacheConfig – class-level cache-related settings
  • 29. 29© 2014 Pivotal Software, Inc. All rights reserved. Spring Supports JSR-107 (JCache) Spring JCache @Cacheable @CacheResult @CachePut @CachePut @CacheEvict @CacheRemove @CacheEvict(allEntries=true) @CacheRemoveAll @CacheConfig @CacheDefaults http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#cache-jsr-107
  • 30. 30© 2014 Pivotal Software, Inc. All rights reserved. Apache Geode Caching Provider @Configuration @EnableCaching @Import(GemFireConfiguration.class) class ApplicationConfiguration { @Bean public CacheManager cacheManager( Cache gemfireCache) { GemfireCacheManager cacheManager = new GemfireCacheManager(); cacheManager.setCache(gemfireCache); return cacheManager; } } <beans … xmlns:cache=“http://www.springframework.org/schema/cach e”…> <gfe:cache properties- ref="gemfireProperties"/> <cache:annotation-driven/> <bean id="cacheManager" class= ”o.s.data.gemfire.support.GemfireCacheManager" p:cache-ref="gemfireCache"/>
  • 31. 31© 2014 Pivotal Software, Inc. All rights reserved. Example
  • 32. 32© 2014 Pivotal Software, Inc. All rights reserved. Conclusion
  • 33. 33© 2014 Pivotal Software, Inc. All rights reserved. Apache Geode References  Project Page - http://geode.incubator.apache.org/contribute/  Contribute - http://geode.incubator.apache.org/contribute/ – Ideas - https://cwiki.apache.org/confluence/display/GEODE/How+to+Contribute  Community Events - http://geode.incubator.apache.org/community/  Documentation - http://geode.incubator.apache.org/docs/ – Docs Project - https://github.com/project-geode/docs  Source Code - https://github.com/apache/incubator-geode  JIRA - https://issues.apache.org/jira/browse/GEODE  StackOverflow - http://stackoverflow.com/questions/tagged/gemfire+and+geode
  • 34. 34© 2014 Pivotal Software, Inc. All rights reserved. Spring Data GemFire References  Project Page - http://projects.spring.io/spring-data/  Documentation – – Reference Guide - http://docs.spring.io/spring-data-gemfire/docs/current/reference/html/ – API - http://docs.spring.io/spring-data-gemfire/docs/current/api/ – Spring IO Guides - http://spring.io/guides – Spring GemFire Examples –  Source Code - https://github.com/spring-projects/spring-data-gemfire  Examples - https://github.com/spring-projects/spring-gemfire-examples  JIRA – https://jira.spring.io/browse/SGF  StackOverflow - http://stackoverflow.com/questions/tagged/spring-data-gemfire
  • 35. 35© 2014 Pivotal Software, Inc. All rights reserved. 3 Building High-Scalable Spring Applications with In-Memory Data Grids September 15th, 2015 – 10:30 am – 12 pm Learn More. Stay Connected. @springcentral Spring.io/video https://2015.event.springone2gx.com/schedule/sessions/building_highly_scalable_spring_applications_with_in_memory_distribute d_data_grids.html
  • 36. 36© 2014 Pivotal Software, Inc. All rights reserved. 36© 2014 Pivotal Software, Inc. All rights reserved. Q&A Any questions…
  • 37. 37© 2014 Pivotal Software, Inc. All rights reserved. 37© 2014 Pivotal Software, Inc. All rights reserved. Thank You

Editor's Notes

  • #6: Key is to manage large quantities of data under extreme load with accuracy and resilience reliably. Big Data == data lake (any and all data) Fast Data == processing streams of events in real-time All about… Data Access
  • #7: Scale Out rather than Scale Up Throughput (or number of operations) increases as more nodes are added to the cluster Data is stored in distributed, highly-concurrent, in-memory data structures to minimize context switching and contention Data is replicated & partitioned for fast, predictable read/write throughput
  • #8: In a nutshell… under-the-hood Apache Geode is implemented… Stores data in-memory with puts. Stores data to disk (synchronously (default) or asynchronously) on persistence and overflow Oplogs are append-only; compaction is necessary HDFS is new and Geode can feed Apache Spark processing streams.
  • #12: Misconceptions about Spring… Spring is a Web Application Framework Spring’s programming model is unique and Spring uses it’s own conventions Built on fundamental OO principles (POJO) Software Design Patterns (IoC/DI, AOP) and… Open Standards (OSS) Apache Geode is a complex technology… Too many configuration options and settings. Inconsistent behavior between XML configuration (i.e. cache.xml) and API.