SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
ONE MICROSERVICE
IS NO MICROSERVICE
THEY COME IN SYSTEMS
MARKUS EISELE
@MYFEAR
M@LIGHTBEND.COM
BLOG.EISELE.NET
! "
@Path("/orders/")
@Interceptors(CallAudit.class)
@Stateless public class OrderService {
@EJB BillingService billing;
@EJB DeliveryService delivery;
@EJB Warehouse warehouse;
@PUT
@Produces({"application/xml","application/json"})
@Consumes({"application/xml","application/json"})
public Order order(Order newOrder){
Order order = warehouse.checkout(newOrder);
billing.payForOrder(order);
delivery.deliver(order);
return order;
}
@GET
@Path("{orderid}/")
@Produces({"application/xml","application/json"})
public Order status(@PathParam("orderid") long orderId){
return delivery.status(orderId);
}
}
@Path("/orders/")
@Interceptors(CallAudit.class)
@Stateless public class OrderService {
private Client client;
private WebTarget tut;
// ...
@GET
@Path("{orderid}/")
@Produces({"application/xml","application/json"})
public Order status(@PathParam("orderid") long orderId){
// return delivery.status(orderId);
this.client = ClientBuilder.newClient();
this.tut = this.client.target("http://...");
Order order = this.client.target(location).request(MediaType.APPLICATION_XML).get(Order.class);
return order;
}
}
COMPLEX DEPLOYMENT
LARGE TEAMS
BREAKING UP MONOLITHS
ADDS COMPLEXITY
BUILDING ONE MICROSERVICE IS
GENERALLY EASY.
WHAT IS HARD IS BUILDING A SYSTEM OF
MICROSERVICES.
REST - MONOLITH TO MICROSERVICES
REST tends to be our go-to but…
> Don’t just do a 1:1 service/interface replacement
> Instead… Design for an asynchronous architecture
Pro-tip: Watch Ben Christensen’s “Don’t build a distributed
Monolith” talk from Microservices Practitioner Summit
2016
HOW SHOULD WE
BUILD
MICROSERVICE
SYSTEMS?
Traditional application
architectures
and platforms are obsolete.
— Gartner
Architecture
and software design principles
matter even more today.
— Eisele
ARCHITECTURE PRINCIPLES
> Single Responsible Principle
> Service Oriented Architecture
> Encapsulation
> Separation of Concern
> Loose Coupling
> Hexagonal Architecture
SOFTWARE DESIGN PATTERNS
> Domain-driven Design
> Bounded Contexts
> Event Sourcing
> CQRS
> Eventual Consistency
> Context Maps
We need to build systems for flexibility and resiliency, not
just efficiency and robustness.
> Responsive
> Resilient
> Elastic
> Message driven
SCALA, AKKA AND PLAY ARE GREAT FITS HERE
Have a steep learning curve
Still a lot to build out yourself
Not explicitly build for microservices
BUT LAGOM IS HERE TO HELP
> Developer experience first!
> No ad-hoc scripts to run your
services
> Takes you through to production
deployment
WHAT IS IN LAGOM?
> sbt build tool
> Scala 2.11 and JDK8
> Play 2.5
> Akka 2.4
> Cassandra
> Jackson
> Google Guice
HIGHLY OPPINIONATED
> Service API
> Persistence API
> Development environment
> Production environment
LAGOM SERVICE API
> IO and communication
> Streaming between services as a first-class concept
> Higher level of resilience and scalability with no
blocking
> Service is a Bounded Context in DDD
> Service Clients & Endpoints
LAGOM PERSISTENCE API
> Event sourced (deltas) with Cassandra backend by
default
> No object/relational impedance mismatch
> Can always replay to determine current state
> Allows you to learn more from your data later
> Persistent entity is an Aggregate Root in DDD
> Can be overridden for CRUD if you want
DEVELOPMENT ENVIRONMENT
$ cd my-first-system
$ activator
... (booting up)
> runAll
[info] Starting embedded Cassandra server
..........
[info] Cassandra server running at 127.0.0.1:4000
[info] Service locator is running at http://localhost:8000
[info] Service gateway is running at http://localhost:9000
[info] Service helloworld-impl listening for HTTP on 0:0:0:0:0:0:0:0:24266
[info] Service hellostream-impl listening for HTTP on 0:0:0:0:0:0:0:0:26230
(Services started, use Ctrl+D to stop and go back to the console...)
NEXT STEPS FOR LAGOM
> Scala API
> Swagger integration
> Maven support
> Support for more DBs
> Integration with other cluster orchestration tools
> … What is missing?
CONTRIBUTE TO LAGOM
Lagom on GitHub
Lagom Mailinglist
@Lagom
Chat Room
REACTIVE MICROSERVICES ARCHITECTURE
BIT.LY/REACTIVEMICROSERVICE
> explore a microservice architecture
> based on Reactive principles
> for building an isolated service
that’s
> scalable, resilient to failure,
> and combines with other services
> to form a cohesive whole
DEVELOPING REACTIVE MICROSERVICES
HTTP://BIT.LY/DEVELOPREACTIVEMICROSERVICE
> create base services, expose
endpoints, and then connect them
with a simple, web-based user
interface
> deal with persistence, state, and
clients
> Use integration technologies to
start a successful migration away
from legacy systems
NEXT STEPS
Project Site:
http://www.lightbend.com/lagom
GitHub Repo:
https://github.com/lagom
Documentation:
http://www.lagomframework.com/documentation/1.0.x/
Home.html
❕ ❓

Contenu connexe

Tendances

WebLogic Administration course outline
WebLogic Administration course outlineWebLogic Administration course outline
WebLogic Administration course outline
Vybhava Technologies
 
Tomcat and MySQL in Windows Azure
Tomcat and MySQL in Windows Azure Tomcat and MySQL in Windows Azure
Tomcat and MySQL in Windows Azure
Guada Casuso
 
Weblogic configuration & administration
Weblogic   configuration & administrationWeblogic   configuration & administration
Weblogic configuration & administration
Muhammad Mansoor
 

Tendances (20)

AWS RDS Oracle - What is missing for a fully managed service?
AWS RDS Oracle - What is missing for a fully managed service?AWS RDS Oracle - What is missing for a fully managed service?
AWS RDS Oracle - What is missing for a fully managed service?
 
WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!
 
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12c
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12cOracle WebLogic: Feature Timeline from WLS9 to WLS 12c
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12c
 
WebLogic Administration course outline
WebLogic Administration course outlineWebLogic Administration course outline
WebLogic Administration course outline
 
Learn Oracle WebLogic Server 12c Administration
Learn Oracle WebLogic Server 12c AdministrationLearn Oracle WebLogic Server 12c Administration
Learn Oracle WebLogic Server 12c Administration
 
WebLogic for DBAs
WebLogic for DBAsWebLogic for DBAs
WebLogic for DBAs
 
Building Highly Scalable Java Applications on Windows Azure - JavaOne S313978
Building Highly Scalable Java Applications on Windows Azure - JavaOne S313978Building Highly Scalable Java Applications on Windows Azure - JavaOne S313978
Building Highly Scalable Java Applications on Windows Azure - JavaOne S313978
 
Azure Websites
Azure WebsitesAzure Websites
Azure Websites
 
Weblogic 11g admin basic with screencast
Weblogic 11g admin basic with screencastWeblogic 11g admin basic with screencast
Weblogic 11g admin basic with screencast
 
Introduction to Windows Azure
Introduction to Windows AzureIntroduction to Windows Azure
Introduction to Windows Azure
 
Tomcat and MySQL in Windows Azure
Tomcat and MySQL in Windows Azure Tomcat and MySQL in Windows Azure
Tomcat and MySQL in Windows Azure
 
Elastic beanstalk
Elastic beanstalkElastic beanstalk
Elastic beanstalk
 
Coherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webCoherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-web
 
Introduction to Windows Azure AppFabric Applications
Introduction to Windows Azure AppFabric ApplicationsIntroduction to Windows Azure AppFabric Applications
Introduction to Windows Azure AppFabric Applications
 
Where did my day go?: Oracle Enterprise Manager 12c/13c Administration
Where did my day go?: Oracle Enterprise Manager 12c/13c AdministrationWhere did my day go?: Oracle Enterprise Manager 12c/13c Administration
Where did my day go?: Oracle Enterprise Manager 12c/13c Administration
 
Weblogic configuration & administration
Weblogic   configuration & administrationWeblogic   configuration & administration
Weblogic configuration & administration
 
Leveraging azure and cello for delivering highly scalable multi tenant
Leveraging azure and cello for delivering highly scalable multi tenantLeveraging azure and cello for delivering highly scalable multi tenant
Leveraging azure and cello for delivering highly scalable multi tenant
 
Weblogic security
Weblogic securityWeblogic security
Weblogic security
 
Introduction to cloudify - workshop 2013
Introduction to cloudify - workshop 2013Introduction to cloudify - workshop 2013
Introduction to cloudify - workshop 2013
 
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12cDeveloping Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
 

En vedette

Wild Flies and a Camel - Chicago JUG - 03/15
Wild Flies and a Camel - Chicago JUG - 03/15Wild Flies and a Camel - Chicago JUG - 03/15
Wild Flies and a Camel - Chicago JUG - 03/15
Markus Eisele
 
Nine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take youNine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take you
Markus Eisele
 
Security in practice with Java EE 6 and GlassFish
Security in practice with Java EE 6 and GlassFishSecurity in practice with Java EE 6 and GlassFish
Security in practice with Java EE 6 and GlassFish
Markus Eisele
 

En vedette (20)

Wild Flies and a Camel Java EE Integration Stories
Wild Flies and a Camel Java EE Integration StoriesWild Flies and a Camel Java EE Integration Stories
Wild Flies and a Camel Java EE Integration Stories
 
Wild Flies and a Camel - Chicago JUG - 03/15
Wild Flies and a Camel - Chicago JUG - 03/15Wild Flies and a Camel - Chicago JUG - 03/15
Wild Flies and a Camel - Chicago JUG - 03/15
 
How would ESBs look like, if they were done today.
How would ESBs look like, if they were done today.How would ESBs look like, if they were done today.
How would ESBs look like, if they were done today.
 
OpenShift for Java EE Developers
OpenShift for Java EE DevelopersOpenShift for Java EE Developers
OpenShift for Java EE Developers
 
THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS
 THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS
THEFT-PROOF JAVA EE - SECURING YOUR JAVA EE APPLICATIONS
 
Community and Java EE @ DevConf.CZ
Community and Java EE @ DevConf.CZCommunity and Java EE @ DevConf.CZ
Community and Java EE @ DevConf.CZ
 
ARCHITECTING LARGE ENTERPRISE JAVA PROJECTS - vJUG
ARCHITECTING LARGE ENTERPRISE JAVA PROJECTS - vJUGARCHITECTING LARGE ENTERPRISE JAVA PROJECTS - vJUG
ARCHITECTING LARGE ENTERPRISE JAVA PROJECTS - vJUG
 
Architecting Large Enterprise Projects @DevConf.CZ
Architecting Large Enterprise Projects @DevConf.CZArchitecting Large Enterprise Projects @DevConf.CZ
Architecting Large Enterprise Projects @DevConf.CZ
 
Modernizing Applications with Microservices
Modernizing Applications with MicroservicesModernizing Applications with Microservices
Modernizing Applications with Microservices
 
Java EE microservices architecture - evolving the monolith
Java EE microservices architecture - evolving the monolithJava EE microservices architecture - evolving the monolith
Java EE microservices architecture - evolving the monolith
 
Nine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take youNine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take you
 
Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?
 
Java cloud service - And introduction for Java EE Developers
Java cloud service - And introduction for Java EE DevelopersJava cloud service - And introduction for Java EE Developers
Java cloud service - And introduction for Java EE Developers
 
Java EE 7 - Into the Cloud
Java EE 7 - Into the CloudJava EE 7 - Into the Cloud
Java EE 7 - Into the Cloud
 
Architecting Large Enterprise Java Projects
Architecting Large Enterprise Java ProjectsArchitecting Large Enterprise Java Projects
Architecting Large Enterprise Java Projects
 
From XaaS to Java EE – Which damn cloud is right for me?
From XaaS to Java EE – Which damn cloud is right for me? From XaaS to Java EE – Which damn cloud is right for me?
From XaaS to Java EE – Which damn cloud is right for me?
 
Architecting Large Enterprise Java Projects
Architecting Large Enterprise Java ProjectsArchitecting Large Enterprise Java Projects
Architecting Large Enterprise Java Projects
 
JUG Darmstadt - Java EE 7 - Auf in die Wolken!
JUG Darmstadt - Java EE 7 - Auf in die Wolken!JUG Darmstadt - Java EE 7 - Auf in die Wolken!
JUG Darmstadt - Java EE 7 - Auf in die Wolken!
 
Java EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFishJava EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFish
 
Security in practice with Java EE 6 and GlassFish
Security in practice with Java EE 6 and GlassFishSecurity in practice with Java EE 6 and GlassFish
Security in practice with Java EE 6 and GlassFish
 

Similaire à Microservice Come in Systems

Solutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Solutions for bi-directional Integration between Oracle RDMBS & Apache KafkaSolutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Solutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Guido Schmutz
 
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
confluent
 
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
b_kathir
 

Similaire à Microservice Come in Systems (20)

Microservices Manchester: How Lagom Helps to Build Real World Microservice Sy...
Microservices Manchester: How Lagom Helps to Build Real World Microservice Sy...Microservices Manchester: How Lagom Helps to Build Real World Microservice Sy...
Microservices Manchester: How Lagom Helps to Build Real World Microservice Sy...
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSIT
 
apidays LIVE Australia 2020 - Building distributed systems on the shoulders o...
apidays LIVE Australia 2020 - Building distributed systems on the shoulders o...apidays LIVE Australia 2020 - Building distributed systems on the shoulders o...
apidays LIVE Australia 2020 - Building distributed systems on the shoulders o...
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMS
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
Introducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database ProfessionalsIntroducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database Professionals
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and OData
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web services
 
Federico Feroldi - Scala microservices
Federico Feroldi - Scala microservicesFederico Feroldi - Scala microservices
Federico Feroldi - Scala microservices
 
Is writing performant code too expensive?
Is writing performant code too expensive? Is writing performant code too expensive?
Is writing performant code too expensive?
 
A Blueprint for Scala Microservices
A Blueprint for Scala MicroservicesA Blueprint for Scala Microservices
A Blueprint for Scala Microservices
 
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
 
Programming proxies to do what we need so we don't have to talk to the networ...
Programming proxies to do what we need so we don't have to talk to the networ...Programming proxies to do what we need so we don't have to talk to the networ...
Programming proxies to do what we need so we don't have to talk to the networ...
 
Solutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Solutions for bi-directional Integration between Oracle RDMBS & Apache KafkaSolutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Solutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
 
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
 
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
 
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
 

Plus de Markus Eisele

Stay productive while slicing up the monolith
Stay productive while slicing up the monolith Stay productive while slicing up the monolith
Stay productive while slicing up the monolith
Markus Eisele
 

Plus de Markus Eisele (20)

Sustainable Software Architecture - Open Tour DACH '22
Sustainable Software Architecture - Open Tour DACH '22Sustainable Software Architecture - Open Tour DACH '22
Sustainable Software Architecture - Open Tour DACH '22
 
Going from java message service (jms) to eda
Going from java message service (jms) to eda Going from java message service (jms) to eda
Going from java message service (jms) to eda
 
Let's be real. Quarkus in the wild.
Let's be real. Quarkus in the wild.Let's be real. Quarkus in the wild.
Let's be real. Quarkus in the wild.
 
What happens when unicorns drink coffee
What happens when unicorns drink coffeeWhat happens when unicorns drink coffee
What happens when unicorns drink coffee
 
Stateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the CloudStateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the Cloud
 
Java in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MJava in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/M
 
Java in the Age of Containers and Serverless
Java in the Age of Containers and ServerlessJava in the Age of Containers and Serverless
Java in the Age of Containers and Serverless
 
Migrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systemsMigrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systems
 
Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19
 
Cloud wars - A LavaOne discussion in seven slides
Cloud wars - A LavaOne discussion in seven slidesCloud wars - A LavaOne discussion in seven slides
Cloud wars - A LavaOne discussion in seven slides
 
Streaming to a new Jakarta EE
Streaming to a new Jakarta EEStreaming to a new Jakarta EE
Streaming to a new Jakarta EE
 
Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained  Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolith Stay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
CQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java DevelopersCQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java Developers
 
Taking the friction out of microservice frameworks with Lagom
Taking the friction out of microservice frameworks with LagomTaking the friction out of microservice frameworks with Lagom
Taking the friction out of microservice frameworks with Lagom
 
10 Golden Social Media Rules for Developer Relations Manager
10 Golden Social Media Rules for Developer Relations Manager10 Golden Social Media Rules for Developer Relations Manager
10 Golden Social Media Rules for Developer Relations Manager
 
Hyperscale Computing, Enterprise Agility with Mesosphere
Hyperscale Computing, Enterprise Agility with MesosphereHyperscale Computing, Enterprise Agility with Mesosphere
Hyperscale Computing, Enterprise Agility with Mesosphere
 

Dernier

Dernier (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Microservice Come in Systems

  • 1. ONE MICROSERVICE IS NO MICROSERVICE THEY COME IN SYSTEMS
  • 3. @Path("/orders/") @Interceptors(CallAudit.class) @Stateless public class OrderService { @EJB BillingService billing; @EJB DeliveryService delivery; @EJB Warehouse warehouse; @PUT @Produces({"application/xml","application/json"}) @Consumes({"application/xml","application/json"}) public Order order(Order newOrder){ Order order = warehouse.checkout(newOrder); billing.payForOrder(order); delivery.deliver(order); return order; } @GET @Path("{orderid}/") @Produces({"application/xml","application/json"}) public Order status(@PathParam("orderid") long orderId){ return delivery.status(orderId); } }
  • 4.
  • 5. @Path("/orders/") @Interceptors(CallAudit.class) @Stateless public class OrderService { private Client client; private WebTarget tut; // ... @GET @Path("{orderid}/") @Produces({"application/xml","application/json"}) public Order status(@PathParam("orderid") long orderId){ // return delivery.status(orderId); this.client = ClientBuilder.newClient(); this.tut = this.client.target("http://..."); Order order = this.client.target(location).request(MediaType.APPLICATION_XML).get(Order.class); return order; } }
  • 9.
  • 10. BUILDING ONE MICROSERVICE IS GENERALLY EASY. WHAT IS HARD IS BUILDING A SYSTEM OF MICROSERVICES.
  • 11. REST - MONOLITH TO MICROSERVICES REST tends to be our go-to but… > Don’t just do a 1:1 service/interface replacement > Instead… Design for an asynchronous architecture Pro-tip: Watch Ben Christensen’s “Don’t build a distributed Monolith” talk from Microservices Practitioner Summit 2016
  • 14. Architecture and software design principles matter even more today. — Eisele
  • 15. ARCHITECTURE PRINCIPLES > Single Responsible Principle > Service Oriented Architecture > Encapsulation > Separation of Concern > Loose Coupling > Hexagonal Architecture
  • 16. SOFTWARE DESIGN PATTERNS > Domain-driven Design > Bounded Contexts > Event Sourcing > CQRS > Eventual Consistency > Context Maps
  • 17. We need to build systems for flexibility and resiliency, not just efficiency and robustness.
  • 18. > Responsive > Resilient > Elastic > Message driven
  • 19. SCALA, AKKA AND PLAY ARE GREAT FITS HERE Have a steep learning curve Still a lot to build out yourself Not explicitly build for microservices
  • 20. BUT LAGOM IS HERE TO HELP > Developer experience first! > No ad-hoc scripts to run your services > Takes you through to production deployment
  • 21. WHAT IS IN LAGOM? > sbt build tool > Scala 2.11 and JDK8 > Play 2.5 > Akka 2.4 > Cassandra > Jackson > Google Guice
  • 22. HIGHLY OPPINIONATED > Service API > Persistence API > Development environment > Production environment
  • 23. LAGOM SERVICE API > IO and communication > Streaming between services as a first-class concept > Higher level of resilience and scalability with no blocking > Service is a Bounded Context in DDD > Service Clients & Endpoints
  • 24. LAGOM PERSISTENCE API > Event sourced (deltas) with Cassandra backend by default > No object/relational impedance mismatch > Can always replay to determine current state > Allows you to learn more from your data later > Persistent entity is an Aggregate Root in DDD > Can be overridden for CRUD if you want
  • 25. DEVELOPMENT ENVIRONMENT $ cd my-first-system $ activator ... (booting up) > runAll [info] Starting embedded Cassandra server .......... [info] Cassandra server running at 127.0.0.1:4000 [info] Service locator is running at http://localhost:8000 [info] Service gateway is running at http://localhost:9000 [info] Service helloworld-impl listening for HTTP on 0:0:0:0:0:0:0:0:24266 [info] Service hellostream-impl listening for HTTP on 0:0:0:0:0:0:0:0:26230 (Services started, use Ctrl+D to stop and go back to the console...)
  • 26. NEXT STEPS FOR LAGOM > Scala API > Swagger integration > Maven support > Support for more DBs > Integration with other cluster orchestration tools > … What is missing?
  • 27. CONTRIBUTE TO LAGOM Lagom on GitHub Lagom Mailinglist @Lagom Chat Room
  • 28. REACTIVE MICROSERVICES ARCHITECTURE BIT.LY/REACTIVEMICROSERVICE > explore a microservice architecture > based on Reactive principles > for building an isolated service that’s > scalable, resilient to failure, > and combines with other services > to form a cohesive whole
  • 29. DEVELOPING REACTIVE MICROSERVICES HTTP://BIT.LY/DEVELOPREACTIVEMICROSERVICE > create base services, expose endpoints, and then connect them with a simple, web-based user interface > deal with persistence, state, and clients > Use integration technologies to start a successful migration away from legacy systems
  • 30. NEXT STEPS Project Site: http://www.lightbend.com/lagom GitHub Repo: https://github.com/lagom Documentation: http://www.lagomframework.com/documentation/1.0.x/ Home.html