SlideShare a Scribd company logo
5 Agile Steps to building
Elastic and Cloud-ready apps
Ondro Mihályi, Payara, http://www.payara.fish
@OMIHALYI
@OMIHALYI
What is cloud ready?
●
Spring, Java EE / Jakarta EE,
MicroProfile or Lagom
●
AWS, Azure or Openshift
●
SQL or NoSQL
●
REST or EJB
@OMIHALYI
Is it really about technology?
@OMIHALYI
Even cool tech can be painful
Cloud ready requirements
●
Pluggable persistence
●
Scalable according to
the load
●
Low coupling
There are even more according to the 12 factor applications manifesto
●
External configuration
●
Failure recovery
●
Security
●
Monitoring
@OMIHALYI
Solution?
@OMIHALYI
Solution: agile evolution
●
Simple API abstractions
●
Flexible implementations
●
Application logic first, against a solid platform
●
Abstract the technology, prepare for refactoring
●
Choose final technology later
@OMIHALYI
Cloud-ready architecture
@OMIHALYI
1. JCACHE
@OMIHALYI
JCache
@OMIHALYI
JCache
●
Temporary cache → optimize reads
●
Cache data-retrieval method calls
●
Temporary key-value store, extensible to
permanent with a read/write-through policy
●
More than 10 implementations (also in
Payara Micro and Spring)
●
Distributed caches allow scalable storage
@OMIHALYI
JCache API
@CacheResult
User getUserForName(String name) { /*do if not cached*/ }
@Inject
Cache<String, User> users;
users.put(user.getName(), user);
User user = users.get(name);
StreamSupport.stream(users.spliterator(), false)
.filter( e -> e.getValue().getAge() > 50)
.count()
@OMIHALYI
JCache in your app container
●
JCache widely available (in Payara Micro,
Open Liberty, Spring Boot, …)
●
In Java EE containers integrated with CDI
●
Often powered by Hazelcast
– Distributed, auto-discovery of nodes
– Data replication, even data distribution
– Lite nodes possible without data
– More features via Hazelcast extensions
@OMIHALYI
2. SCALABLE RUNTIME
…
@OMIHALYI
JCache
@OMIHALYI
What is Payara Micro?
●
Executable JAR (~70MB disk size, ~30 MB RAM)
●
Runs WAR and EAR from command line
– Also Uber JAR, embeddable (run from your app)
●
Forms dynamically scalable cluster
●
Web Profile "plus", MicroProfile
●
Opensource, Maven dep, release each 3 months
@OMIHALYI
●
Run multiple instances with the same command
java -jar payara-micro.jar application.war
--autoBindHttp
●
Package as a single executable Uber JAR
java -jar payara-micro.jar application.war
--outputUberJar application.jar
●
Run embedded: PayaraMicro.getInstance().bootStrap()
●
Run using Maven plugin: mvn payara-micro:start
Scale dynamically
@OMIHALYI
What is MicroProfile?
●
Project at Eclipse Foundation
●
Common API, multiple implementations
●
Extends Java EE
●
Modern patterns:
– Microservices, Reactive, …
●
http://microprofile.io - open for everybody
@OMIHALYI
@OMIHALYI
3. RESTFUL
@OMIHALYI
JCache
RESTAPI
@OMIHALYI
REST services API (server)
●
JAX-RS endpoint
@GET
@Path("/{id}")
@Produces(MediaType.APPLICATION_JSON)
public User getUser(@PathParam("id")
Integer id) {
return userById(id);
}
@OMIHALYI
REST services API (client)
●
JAX-RS client
User user = client.target(url)
.path("all")
.request().get(User.class)
●
MicroProfile client (much better abstraction)
User admin = userService.getUser("admin")
@OMIHALYI
JSON binding
@JsonbNillable
public class User implements Serializable {
private String name;
@JsonbTransient
private String description;
@JsonbProperty("userId")
private long id;
}
- new in Java EE 8 and
MicroProfile 2.0
More about JSON-B:
http://json-b.net
@OMIHALYI
4. MESSAGING
@OMIHALYI
CDI events, really?
●
Part of Java EE API already
●
Easy to send and observe messages
●
Is it enough? What about:
– Sending events to other services
– Message broker to decouple services
– Transactions
@OMIHALYI
CDI events, really?
What about:
●
Sending events to other services
– Nothing else is important in initial dev stage
●
Message broker for reliable delivery
●
Transactions
@OMIHALYI
Payara CDI event bus
●
Out of the box in Payara Micro
●
Uses embedded Hazelcast
●
No config needed, events dispatched to all
matching services
@Inject @Outbound
Event<Payload> event;
void onMessage(
@Observes @Inbound
Payload event)
@OMIHALYI
Events as an abstraction
●
Transfer events to other services in an event
handler
– Using distributed queues
– Using any message broker
●
Distribute incoming messages as events
●
Start simple, extend to robust
@OMIHALYI
One more option… JCA connector
●
Message-driven beans, does it ring the bell?
– Not only for JMS but for any messaging infrastructure
●
Connetors on Github for AWS, Azure, Kafka, MQTT
@MessageDriven(activationConfig = { … })
public class KafkaMDB implements KafkaListener {
@OnRecord( topics={"my-topic"} )
public void onMsg(ConsumerRecord record) {
…
@OMIHALYI
JCache
RESTAPI
CDI eventsJCA connector
@OMIHALYI
JCache
RESTAPI
CDI eventsJCA connector
@OMIHALYI
Or evolution to avoid
refactoring
event observer
JCA
connection
observer
MDB
event
@OMIHALYI
Evolutionary architecture
„An evolutionary architecture supports
continual and incremental change as a first
principle along multiple dimensions.“
„Microservices meet this definition.“
Neal Ford, Rebecca Parsons
http://evolutionaryarchitecture.com/
@OMIHALYI
5. CONFIGURATION FACADE
@OMIHALYI
JCache
RESTAPI
JCA connector
Microprofile
Configuration
@OMIHALYI
●
Standard config sources
– Env. variables
– System properties
●
Pluggable sources
– Database?, secrets?
●
More sources in Payara Micro
– Cluster-wide
– Directory, secrets
– Scoped (server, app, module)
Microprofile Configuration
@Inject
@ConfigProperty(name =
"myservice.url")
URL myService;
URL myService =
ConfigProvider.getConfig()
.getValue("myservice.url",
URL.class);
@OMIHALYI
DEMO
@OMIHALYI
BONUS: MONITORING
@OMIHALYI
Is there a free lunch?
Microprofile provides a lot out of the box
●
Metrics – monitoring data, statistics
●
Health – problem detection and autorecovery
●
Opentracing – connects related requests
JCache JAX-RS
JCA connector
Microprofile
Configuration
Microprofile Metrics,
Health, Tracing
Microprofile JWT
Future?
Microprofile
FaultTolerance
@OMIHALYI
Thank you!
●
https://microprofile.io/
●
https://www.payara.fish/
●
http://evolutionaryarchitecture.com/
●
https://github.com/payara/Cloud-Connectors
●
https://www.microprofile-ext.org/
●
https://github.com/OndrejM-demonstrations/elastic-cloud-ready-apps

More Related Content

PDF
Effective cloud-ready apps with MicroProfile
PPTX
Microservices Architecture and Containers.
PDF
Introduction to event based microservices
PDF
Next.js with drupal, the good parts
PDF
Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014
PDF
Lagom : Reactive microservice framework
PPTX
Micro Front-End & Microservices - Plansoft
PDF
Introduction to the Nancy Framework
Effective cloud-ready apps with MicroProfile
Microservices Architecture and Containers.
Introduction to event based microservices
Next.js with drupal, the good parts
Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014
Lagom : Reactive microservice framework
Micro Front-End & Microservices - Plansoft
Introduction to the Nancy Framework

What's hot (20)

PDF
Front-end for Java developers Devoxx France 2018
PDF
Secure JAX-RS
PDF
Micronaut Deep Dive - Codeone 2019
PDF
Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture
PDF
Gradual migration to MicroProfile
PPTX
R2DBC - Good Enough for Production?
PPTX
Dnc2015 azure-microservizi-vforusso
PDF
Introduction to Micronaut - JBCNConf 2019
PDF
JavaCro'15 - Secure Web Services Development - Askar Akhmerov
PDF
Micronaut Deep Dive - Devoxx Belgium 2019
PDF
Demo on JavaFX
PDF
Microservices with Spring Boot
PPTX
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
PPTX
linkerd: The Cloud Native Service Mesh
PDF
Micro Frontends
PDF
MicroProfile Panel - Sept 2016
PDF
Dual write strategies for microservices
PDF
Microservices in Scala - theory & practice
PDF
MongoDB .local London 2019: The Tech Behind Connected Car
PDF
Javantura v4 - Spring Boot and JavaFX - can they play together - Josip Kovaček
Front-end for Java developers Devoxx France 2018
Secure JAX-RS
Micronaut Deep Dive - Codeone 2019
Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture
Gradual migration to MicroProfile
R2DBC - Good Enough for Production?
Dnc2015 azure-microservizi-vforusso
Introduction to Micronaut - JBCNConf 2019
JavaCro'15 - Secure Web Services Development - Askar Akhmerov
Micronaut Deep Dive - Devoxx Belgium 2019
Demo on JavaFX
Microservices with Spring Boot
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
linkerd: The Cloud Native Service Mesh
Micro Frontends
MicroProfile Panel - Sept 2016
Dual write strategies for microservices
Microservices in Scala - theory & practice
MongoDB .local London 2019: The Tech Behind Connected Car
Javantura v4 - Spring Boot and JavaFX - can they play together - Josip Kovaček
Ad

Similar to Java2 days 5_agile_steps_to_cloud-ready_apps (20)

PDF
Microservices and modularity with java
PDF
Rapid app building with loopback framework
PPTX
How to move from Monolith to Microservice
PDF
Node.js scaling in highload
PDF
introduction to micro services
PDF
Next Generation Automation in Ruckus Wireless
PDF
Modular Java applications with OSGi on Apache Karaf
PPTX
Instant developer onboarding with self contained repositories
PDF
Easy Microservices with JHipster - Devoxx BE 2017
PDF
Devoxx Belgium 2017 - easy microservices with JHipster
PDF
Top Node.JS Frameworks to Look at in 2020
PDF
[API World ] - Managing Asynchronous APIs
PDF
PPTX
RedisConf17 - Dynomite - Making Non-distributed Databases Distributed
PDF
Web App Prototypes with Google App Engine
PDF
CNCF Singapore - Introduction to Envoy
PDF
Spark Workflow Management
PDF
How to sell drupal 8
PDF
OTN Developer Days - GlassFish
PDF
NodeJS
Microservices and modularity with java
Rapid app building with loopback framework
How to move from Monolith to Microservice
Node.js scaling in highload
introduction to micro services
Next Generation Automation in Ruckus Wireless
Modular Java applications with OSGi on Apache Karaf
Instant developer onboarding with self contained repositories
Easy Microservices with JHipster - Devoxx BE 2017
Devoxx Belgium 2017 - easy microservices with JHipster
Top Node.JS Frameworks to Look at in 2020
[API World ] - Managing Asynchronous APIs
RedisConf17 - Dynomite - Making Non-distributed Databases Distributed
Web App Prototypes with Google App Engine
CNCF Singapore - Introduction to Envoy
Spark Workflow Management
How to sell drupal 8
OTN Developer Days - GlassFish
NodeJS
Ad

More from Payara (20)

PPTX
Easy Java Integration Testing with Testcontainers​
PPTX
Payara Cloud - Cloud Native Jakarta EE.pptx
PPTX
Jakarta Concurrency: Present and Future
PPTX
GlassFish Migration Webinar 2022 Current version.pptx
PPTX
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
PDF
Securing Microservices with MicroProfile and Auth0v2
PDF
Reactive features of MicroProfile you need to learn
PDF
A step-by-step guide from traditional Java EE to reactive microservice design
PDF
Transactions in Microservices
PPTX
Fun with Kubernetes and Payara Micro 5
PDF
What's new in Jakarta EE and Eclipse GlassFish (May 2019)
PDF
Previewing Payara Platform 5.192
PDF
Gradual Migration to MicroProfile
PDF
Monitor Microservices with MicroProfile Metrics
PDF
Java2 days -_be_reactive_and_micro_with_a_microprofile_stack
PDF
Rapid development tools for java ee 8 and micro profile [GIDS]
PDF
Ondrej mihalyi be reactive and micro with a micro profile stack
PDF
Bed con Quest for JavaEE
PPTX
Payara Micro from Raspberry Pi to Cloud
PPTX
Microprofile and EE4J update
Easy Java Integration Testing with Testcontainers​
Payara Cloud - Cloud Native Jakarta EE.pptx
Jakarta Concurrency: Present and Future
GlassFish Migration Webinar 2022 Current version.pptx
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
Securing Microservices with MicroProfile and Auth0v2
Reactive features of MicroProfile you need to learn
A step-by-step guide from traditional Java EE to reactive microservice design
Transactions in Microservices
Fun with Kubernetes and Payara Micro 5
What's new in Jakarta EE and Eclipse GlassFish (May 2019)
Previewing Payara Platform 5.192
Gradual Migration to MicroProfile
Monitor Microservices with MicroProfile Metrics
Java2 days -_be_reactive_and_micro_with_a_microprofile_stack
Rapid development tools for java ee 8 and micro profile [GIDS]
Ondrej mihalyi be reactive and micro with a micro profile stack
Bed con Quest for JavaEE
Payara Micro from Raspberry Pi to Cloud
Microprofile and EE4J update

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Cloud computing and distributed systems.
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Approach and Philosophy of On baking technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPT
Teaching material agriculture food technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Empathic Computing: Creating Shared Understanding
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Understanding_Digital_Forensics_Presentation.pptx
Cloud computing and distributed systems.
NewMind AI Monthly Chronicles - July 2025
Reach Out and Touch Someone: Haptics and Empathic Computing
Approach and Philosophy of On baking technology
Review of recent advances in non-invasive hemoglobin estimation
Teaching material agriculture food technology
Dropbox Q2 2025 Financial Results & Investor Presentation
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Empathic Computing: Creating Shared Understanding
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Spectral efficient network and resource selection model in 5G networks
NewMind AI Weekly Chronicles - August'25 Week I
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Big Data Technologies - Introduction.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
20250228 LYD VKU AI Blended-Learning.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Java2 days 5_agile_steps_to_cloud-ready_apps