Java Microservices in the cloud

Slides:



Advertisements
Similar presentations
Adding scalability to legacy PHP web applications Overview Mario A. Valdez-Ramirez.
Advertisements

Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
Chapter 19: Network Management Business Data Communications, 4e.
G O B E Y O N D C O N V E N T I O N WORF: Developing DB2 UDB based Web Services on a Websphere Application Server Kris Van Thillo, ABIS Training & Consulting.
EEC-681/781 Distributed Computing Systems Lecture 3 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
The Architecture of Transaction Processing Systems
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
Monitoring Latency Sensitive Enterprise Applications on the Cloud Shankar Narayanan Ashiwan Sivakumar.
Data Management Kelly Clynes Caitlin Minteer. Agenda Globus Toolkit Basic Data Management Systems Overview of Data Management Data Movement Grid FTP Reliable.
— Build your own enterprise-class PaaS platform. Master Cloudset Cloudset1 Cloudset Resource Pool cloud Dedicated resource can be assigned to a cloudset.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
J2EE Structure & Definitions Catie Welsh CSE 432
NA-MIC National Alliance for Medical Image Computing UCSD: Engineering Core 2 Portal and Grid Infrastructure.
Frameworks CompSci 230 S Software Construction.
© Donald F. Ferguson, All rights reserved. Some Essentials for Modern Solution Development WSO2Con 2015 US Dr. Donald F. Ferguson
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
Amazon Web Services. Amazon Web Services (AWS) - robust, scalable and affordable infrastructure for cloud computing. This session is about:
Deploying Elastic Java EE Microservices in the Cloud with Docker
Structured Container Delivery Oscar Renalias Accenture Container Lead (NOTE: PASTE IN PORTRAIT AND SEND BEHIND FOREGROUND GRAPHIC FOR CROP)
Architecting Enterprise Workloads on AWS Mike Pfeiffer.
Configuration & Registry Microservice Deep Dive
Cloud Native Applications using Spring Cloud Netflix
Agenda:- DevOps Tools Chef Jenkins Puppet Apache Ant Apache Maven Logstash Docker New Relic Gradle Git.
Chapter 19: Network Management
Containers as a Service with Docker to Extend an Open Platform
Physics validation database
Dockerize OpenEdge Srinivasa Rao Nalla.
Be Whisked Away with a Raspberry PI, Java, and OpenWhisk
OpenLegacy Training Day Four Introduction to Microservices
Google App Engine Mandeep Singh (37926)
Docker Birthday #3.
Gang of Four’s Design Patterns for Microservices
Open Source distributed document DB for an enterprise
StratusLab Final Periodic Review
StratusLab Final Periodic Review
Overall Architecture and Component Model
Modern Architectures in Cloud
Cloud Computing Platform as a Service
Introduction to Microservices Prepared for
Introduction to J2EE Architecture
Advanced Integration and Deployment Techniques
Lessons Learned from Microservices at Scale
Service Fabric Patterns & Best Practices
Event driven Microservices with VERT.X & Kubernetes
Replication Middleware for Cloud Based Storage Service
Build a 12 factor microservice in half an hour
Microsoft Build /8/2018 5:15 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Spring Cloud Netflix Sinisha Mihajlovski.
Inventory of Distributed Computing Concepts and Web services
Microservices on application container cloud service
Learn. Imagine. Build. .NET Conf
AWS Cloud Computing Masaki.
Next-generation cluster management architecture and software
LitwareHR v2: an S+S reference application
autodiscoverable microservices with vertx3
Chapter 7 –Implementation Issues
Component-based Applications
The 12 Factors to build Cloud Native Applications
Building Serverless Enterprise Applications
REST på Microsoft-stacken
Enterprise Java Beans.
Distributed System using Web Services
ESB Modernization Prepared by: OIT As of May 23, 2016.
Remedy Integration Strategy Leverage the power of the industry’s leading service management solution via open APIs February 2018.
Harrison Howell CSCE 824 Dr. Farkas
Your .NET App Won’t Scale
ONAP Architecture Principle Review
Containers on Azure Peter Lasne Sr. Software Development Engineer
Presentation transcript:

Java Microservices in the cloud Doug Harvey CapTech Consulting

“a crummy commercial?” CapTech is a national consulting firm with offices in Philadelphia, Washington, Richmond, Charlotte, Atlanta, Denver, Orlando… CapTech has a Java practice that goes back to 1998 CapTech specializes in System Integration and development

Fad or Trend? Applets Spring EJB’s REST Swing Google Glass Javascript Microservices?

Not a fad imho Synergy the design pattern itself open-source contributors containers cloud

Why Microservices?

Problems with the monolith Granular Tuning Regression Testing Developer Interaction Database dependencies

Advantages of the monolith Reporting Batch processing Transaction Management Logging

Microservices? Not the use of service objects, e.g. Domain-Driven Design One Operating System Process “Smart endpoints / dumb pipes” (therefore NOT ESB) Decentralized data management (purpose-specific persistence, usually per-component) Replaceable Component Architecture Change of mindset - services are the app

Characteristics of a Microservice

Persistence

Definitions Component - a self-contained, separately- deployable OS process Library - code that is shared among components (does not run on its own) API-gateway - a component whose main purpose is to orchestrate & aggregate by calling other components

Framework vs Component Framework – library (jar) Component – executable Choice is sometimes not so obvious Rules engine? I8N? Configuration?

Anatomy of a Microservice

The 12-Factor App I. Codebase - One codebase tracked in revision control, many deploys II. Dependencies - Explicitly declare and isolate dependencies III. Config - Store config in the environment IV. Backing Services -Treat backing services as attached resources V. Build, release, run - Strictly separate build and run stages VI. Processes - Execute the app as one or more stateless processes VII. Port binding - Export services via port binding VIII. Concurrency - Scale out via the process model IX. Disposability - Maximize robustness with fast startup and graceful shutdown X. Dev/prod parity - Keep development, staging, and production as similar as possible XI. Logs - Treat logs as event streams XII. Admin processes - Run admin/management tasks as one-off processes

Contracts Contracts are sacred Backward compatibility is paramount Different versions must be able to co-exist Contract testing separate from other testing Tools available: Pact, Pacto

Containers What is a container? Why use containers? Which containers to use? Docker, Rocket, Drawbridge, LXD, other

Why use containers? Isolation file system ports support software dependencies Scalability Developer productivity (run dependencies locally)

Caching Microservices = increased network traffic Caching avoids redundant calls Distributed caching Products: Redis, Hazlecast, etc. Building with Caching transparency

What about those monolith advantages? Reporting/Batch Processing - Elastic Search (or other shadow database) Logging - Logstash & Kibana Transactions…

Transactions What if a “transaction” spans service calls? This is not unique to micro services Design directions: Keep db transactions at individual service level Use alternate methods to restore consistency (CQRS, Event Sourcing, Eventual Consistency, Delayed Rollback )

What about security? Options: shared session (is he kidding?) client certs custom token (signed, self-contained) Oath2 (most likely - supports SSO)

What is needed? API Gateway Service Discovery Load balancing Integrated REST client Circuit Breaker

How do we do all this in Java? Roll-your-own? Container or container-less? Open-source frameworks? Spring? boot, cloud (netflix) Dropwizard? Vertx

Why Spring Boot? Momentum no more container dependencies less Mockito-style mocking provides robust, extensible monitoring memory is cheap Spring Cloud - powerful annotations

Netflix offers (via Spring Cloud) Eureka - service registry Ribbon - load balancer (client side) Feign - rest client via configuration Zuul - reverse proxy/ API gateway Hystrix - circuit-breaker

Eureka DNS for components Contributes to load-balancing Does proactive monitoring (health checks) Not java-specific Spring supports via annotations

Ribbon Client-side load balancing Integration with Eureka Circuit-breaker integration

Feign Abstracts calling to REST endpoints Uses Ribbon for load blanking Spring annotations Example:

Daring Code Demo

Zuul Allows for one “front door” for consumers Consumers don’t need to find services Allows for one authentication endpoint

Hystrix Implements circuit-breaker pattern: once failures for a component instance reach a threshold, breaker trips - preventing further calls to that instance Integrates with other tools to allow declarative fallback when services fail or are not available (Feign, Ribbon, RxJava) Includes monitoring dashboard for view of health of components

RxJava What is it? Java implementation of Reactive Pattern Use with other Netflix frameworks provides synergy Very useful in orchestrating several interdependent simultaneous or sequential REST service calls

Gradle vs Maven Gradle has some advantages in microservices world: Groovy-based DSL instead of XML Supports Convention over Configuration like Maven, but allows for procedural “tasks” Excellent with sub-projects (like “client”) leveragable in deployment as well as build/dependency management

Anatomy - Java Detail

What about testing? Less need for mocking Contract testing is important Component testing is important Unit testing need is still the same

What about the cloud? Most cloud providers now directly support Docker A Docker container with one spring boot microservice can be a deployable asset stored in a repository (like Artifactory)

Cloud Principle #1 Write no code that depends upon a particular cloud provider

Cloud Principle #2 Do take advantage of the monitoring and deployment facilities of your cloud provider

Example: Amazon EC2 Container Service (ECS) Cluster – logical group of containers Container instance – EC2 with ECS agent registered into a cluster Task Definitions – app description with one or more containers Task – an instantiation of a task definition running on a container instance Services – run and maintain a specified number of instances of a task definition simultaneously

ServiceDiscovery on ECS

Conclusion Think differently: “the services are the application” Leverage open-source containers are your friend