Slide 1

Slide 1 text

Microservice Architecture with Spring Cloud KongKow IT Medan Meetup #7

Slide 2

Slide 2 text

The Speaker • Maikel Chandika, S.Kom, OCA • ICT Manager at Waruna-Group • Java Ecosystem Enthusiast • [email protected] • Github: @mkdika • LinkedIn: @maikelchandika Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 2

Slide 3

Slide 3 text

The Rundown • 2.00 pm - 2.40 pm Microservice & Spring Cloud Stack • 2.40 pm - 3.00 pm Demo To-do Apps • 3.00 pm - 3.15 pm Break & Networking • 3.15 pm - 4.00 pm Features Demo & Live Code • 4.00 pm - 4.20 pm Q & A • 4.20 pm Networking & Documentation Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 3

Slide 4

Slide 4 text

Meetup URLs • Q & A http://sli.do Code: 2250 • Meetup Feedback https://goo.gl/kagtmg Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 4

Slide 5

Slide 5 text

Microservice Architecture Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 5

Slide 6

Slide 6 text

What is Microservice Architecture? Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 6 "The microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies. “ (Martin Fowler)

Slide 7

Slide 7 text

Microservice Catalyst • Business Demand • Enterprises find new ways to quickly penetrate the market • No longer interested developing consolidated & managing end-to-end business functions. • To be more agility, speed of delivery, and scale to compete market. • Technology • Emergence of HTML5, CSS3, Client-side JavaScript framework, mobile platform & apps. • Revolutionized space of the database, NoSQL. • Infrastructure Management, PaaS, Container revolution & orchestration. Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 7

Slide 8

Slide 8 text

Popularized By Agility Speed of Delivery Scale Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 8 And many others… To achieve higher degree of

Slide 9

Slide 9 text

Microservices The Honey Comb Analogy “ In the real world, bees build a honeycomb by aligning hexagonal wax cells. They start small, using different materials to build the cells. Construction is based on what is available at the time of building. Repetitive cells form a pattern, and result in a strong fabric structure. Each cell in the honeycomb is independent, but also integrated with other cells. By adding new cells, the honeycomb grows organically to a big, solid structure. The content inside the cell is abstracted and is not visible outside. Damage to one cell does not damage other cells, and bees can reconstruct those cells without impacting the overall honeycomb. “ Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 9

Slide 10

Slide 10 text

Monolith & N-Tier Microservice Architecture Architecture Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 10

Slide 11

Slide 11 text

Principle of Microservices 1. Single Responsibility per Service (SOLID Principle) 2. Self Contained & Autonomous Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 11

Slide 12

Slide 12 text

Cloud Native Application Methodology • 12 Factor App Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 12 Ah…Uda Lah!

Slide 13

Slide 13 text

Spring Framework != Spring MVC != Spring Boot && Spring Cloud != Spring Cloud Foundry… ;) Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 13

Slide 14

Slide 14 text

Spring Cloud Stack • Spring Boot Simplify Bootstrapping, automate configuration and reduce boilerplate code. • Spring Config Server Externalize Configuration • Netflix Eureka Service Discovery/ Dynamic Service Registration, mid-tier load balancing & failover. • Netflix Zuul Service Proxy/ Gateway API. • Netflix Hystrix Circuit Breaker / Self Healing • Netflix Ribbon Inter Process Communication (remote procedure calls) library with built in load balancers. • Feign Declarative HTTP Client Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 14 And many more….

Slide 15

Slide 15 text

Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 15 At the mean time… ;)

Slide 16

Slide 16 text

Spring Cloud To-do App Demo Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 16

Slide 17

Slide 17 text

Spring Cloud To-do Application • Spring Cloud To-do App is limited to: • Cross-Cutting Concern (Security, Logging, etc.) • Event-Driven Architecture & Reactive Programming (some part only) Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 17

Slide 18

Slide 18 text

To-do App Microservices • Overhead Domain • Config Service • Discovery Service • Business Domain • To-do Service • Audit Trail Service • Integration Domain • Message Service • Front End • Vue.Js Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 18

Slide 19

Slide 19 text

Should we break? Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 19

Slide 20

Slide 20 text

Service Diagram & Tech Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 20

Slide 21

Slide 21 text

App Features Demo • Spring Cloud • Eureka Frontpage • Externalized Config • Git Repository • Local File • Config Changes • Manual Refresh • Automatic Refresh/ Dynamic • Feign Client • API Gateway • Hystrix Fallback • Ribbon Failed-over • Hystrix Dashboard • Turbine Dashboard • Event/ Message Driven with Spring Cloud Stream Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 21

Slide 22

Slide 22 text

App Features Demo • Spring Boot • Production Ready End-points • Swagger & Web UI • H2 Web Console • HATEOAS • WebTools • Project Starter • Web (http://start.spring.io) • IntelliJ IDEA • And many more… Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 22

Slide 23

Slide 23 text

Common Dependencies Reference Config Service Discovery Service Gateway Service Monitoring Config Server Eureka Server Zuul Config Client Eureka Discovery Config Client Config Client Eureka Discovery Actuator Actuator Eureka Discovery Actuator Actuator Hystrix Dashboard Turbine Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 23

Slide 24

Slide 24 text

Common Dependencies Reference REST API Web Interface Config Client Config Client Eureka Discovery Eureka Discovery Actuator Actuator Hystrix Hystrix Feign Feign Web Web HATEOAS HATEOAS JPA JPA Lombok Lombok Devtools Devtools Thymeleaf Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 24

Slide 25

Slide 25 text

Microservice Architecture Drawbacks • Overhead cost, increasing of resource usage. • Developing distributed system can be complex (request & latency) • Deploying microservice can be complex (coordination). • Testing of application are harder. Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 25

Slide 26

Slide 26 text

To Go Further Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 26 Spring 5.0 Microservices 2nd Ed Mastering Spring 5.0 Spring Microservices in Action

Slide 27

Slide 27 text

To Go Futher “ A working code tells more than hundred blog “ (Anonymous) App Demo Repository: https://github.com/KongkowITMedan/spring-cloud-todo Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 27

Slide 28

Slide 28 text

What Next? • Development and scaling scenario • Add cross-cutting concern (Security, Auth, Logging, etc). • Add more tech Integration (Elastic Search/ NoSQL). • Refactor to Event-driven/Message-driven Architecture. • Add CI/CD & Container base deployment to Cloud. • Develop small Market Place project. • And many more… Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 28

Slide 29

Slide 29 text

Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 29

Slide 30

Slide 30 text

THANK YOU Microservice Architecture with Spring Cloud (Maikel Chandika, 2018) 30