44
David Papp @pappdav Chief Architect @ghostmonitor

Microservices environment in production

Embed Size (px)

Citation preview

Page 1: Microservices environment in production

David Papp @pappdav

Chief Architect @ghostmonitor

Page 2: Microservices environment in production

Who we are?

• Established in May 2015• The team headcount: 11• Company profile: E-Commerce analytics

Page 3: Microservices environment in production

What technologies do we use?

Page 4: Microservices environment in production

Microservices environment in production

Page 5: Microservices environment in production

”…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.

- Martin Fowler

Page 6: Microservices environment in production

12factor application1. Codebase2. Dependencies3. Config4. Backing services5. Build release run6. Process

7. Port binding8. Concurrency9. Disposability10.Dev/Prod parity11.Logs12.Admin process

Page 7: Microservices environment in production

Build release run

Strictly separate build and run stages – 12factor.net

Page 8: Microservices environment in production

Concurrency

Scale out via the process model – 12factor.net

Page 9: Microservices environment in production

Disposability

Maximize robustness with fast startup and graceful shutdown – 12factor.net

Page 10: Microservices environment in production

Dev/Prod parity

Keep development, staging, and production as similar as possible – 12factor.net

Page 11: Microservices environment in production

Microservices patterns

Page 12: Microservices environment in production

Microservices patterns•Service communication HTTP/REST/AMQP

or asynchronous protocols

•API gateway

•Service discovery

•Multiple service instances per host

•Serverless deployment

•Database per Service

•Event-driven architecture

•Event sourcing

Page 13: Microservices environment in production

Database per Service

Page 14: Microservices environment in production

Service discovery

Page 15: Microservices environment in production

What is the difference?

Page 16: Microservices environment in production

The beginning

Page 17: Microservices environment in production

MVP – Minimum viable product

Page 18: Microservices environment in production

Refactoring! Why? Noo…

Page 19: Microservices environment in production

Refactoring - Benefits Benefits for Engineers

•Easily Maintained Code Base

•Consistent Code Standards

•No Need for Overtime

•Working Effectively Together

•Ease of Automated Testing

•Less Fragile, More Robust Code

Benefits for Business•Easier Feature Additions

•Incremental Delivery

•Ability to Change Requirements

•Faster Time to Market

•Easier Performance Improvement

•Easier Security Improvements

Page 20: Microservices environment in production

Why was this necessary? Because…

Page 21: Microservices environment in production

Finish! It’s works!

Page 22: Microservices environment in production

The new age

Page 23: Microservices environment in production

New age new problems…1. Framework

2. Local development

3. Testing

4. Build

5. Deploy

6. Infrastructure

7. Monitoring

8. Logging

Page 24: Microservices environment in production

Framework•Koa.jso gm-core-libo Moduleso SQSo Service Discoveryo Rediso API

Page 25: Microservices environment in production

Local development1. Docker2. Docker-compose3. Codeship jet4. Minikube5. Kube-Solo

Page 26: Microservices environment in production

Testing & Build•Unit test

•E2e test

•Integration test

Page 27: Microservices environment in production

codeship-services.yml

codeship-steps.yml

Page 28: Microservices environment in production

Deploy•Codeship2Kubernetes wrapper

•Written in Ruby

•Async• Worker

•Message queue for Redis

•Notification to Slack

•Rollback

•Template management• Resource control• Version control

Page 29: Microservices environment in production

Infra

stru

ctur

eInfrastructure

Page 30: Microservices environment in production

Monitoring •NewRelic

•Trace by Risingstack

•Apex.sh

•Pingdom

Page 31: Microservices environment in production

Logging•Airbrake/Errbit

•Logentries

•Trace by Risingstack

Page 32: Microservices environment in production

Production environment

Page 33: Microservices environment in production

Service types• API

•Service

•Mservice

•Worker

Page 34: Microservices environment in production

System statistics• 50+ different services

• 550+ containers

• 100+ different builds

Page 35: Microservices environment in production

Microservices cobweb

Page 36: Microservices environment in production

Microservices cobweb - Zoomed

Page 37: Microservices environment in production
Page 38: Microservices environment in production

Authentication & Authorization

Page 39: Microservices environment in production

Need more information… :)

Page 40: Microservices environment in production

Dashboard architecture

Page 41: Microservices environment in production

Dashboard all communications

Page 42: Microservices environment in production

Dashboard stat communications

Page 43: Microservices environment in production

Thanks

Page 44: Microservices environment in production

Questions?