Top Banner
MICROSERVICES BREAKING APART THE MONOLITH www.iron.io
51
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Microservices: Breaking Apart the Monolith

MICROSERVICES

BREAKING APART THE MONOLITH

www.iron.io

Page 2: Microservices: Breaking Apart the Monolith

About the Presenter

Ivan Dwyer | Business Development

● Joined Iron.io in early 2014 to collaborate with cloud ecosystem● Founder of a Web 1.0 Startup in 1999● Helped build the first mobile app program at PalmSource● Spent 10 years in international business with ACCESS

@fortyfivan

Page 3: Microservices: Breaking Apart the Monolith

Agenda

⬢ The Rise of Microservices in the Modern Cloud

⬢ How to Decouple Processes Into Discrete Microservices

⬢ Best Way to Keep Microservices and Connected Devices in Touch

⬢ Best Practices Around Event-Driven Asynchronous Processing

⬢ The Role of the API Gateway

⬢ How to Deal With State

⬢ DevOps & The Continuous Deployment Cycle

⬢ Bringing it All Together With Monitoring & Analytics

Page 4: Microservices: Breaking Apart the Monolith

Evolution

Page 5: Microservices: Breaking Apart the Monolith

How We Got Here

Expensive to Scale

Difficult to Scale

Unnecessary Overhead

Complex Configurations

Granular Compute

Effective Separation

Monolith Multi-Tier / SOA Microservices

Page 6: Microservices: Breaking Apart the Monolith

The Modern Cloud

{ } Cloud-Native ProtocolsRESTful APIs that communicate over HTTP with JSON serialization

Agile OperationsConsistent environments for development and deployment

Elastic WorkloadsGranular workload-aware computing for effective scalability

Page 7: Microservices: Breaking Apart the Monolith

Microservices represents the convergence of the modern cloud and

modern application development.

Page 8: Microservices: Breaking Apart the Monolith

Microservices

Page 9: Microservices: Breaking Apart the Monolith

Common Characteristics

Single Responsibility

Independent

Loosely Coupled

Stateless

Asynchronous

Interchangeable

Page 10: Microservices: Breaking Apart the Monolith

Organizational Impact

Technology

Smaller services centered around specific capabilities

Independently developed and deployed functional components

Lightweight cloud-native communication and processing

Multiple language and data sources fit for the service

Business

Focused and flexible workgroups

Shorter release cycles

Cost-effective scalable systems

No vendor or framework lock-in

Page 11: Microservices: Breaking Apart the Monolith

Considerations

➔ Building and maintaining highly available distributed systems is complex

➔ More moving parts means more components to keep track of and configure properly

➔ Loosely coupled services means steps must be taken to keep data consistent

➔ Distributed asynchronous processes create network latency and more API traffic

➔ Testing and monitoring individual services is challenging

Page 12: Microservices: Breaking Apart the Monolith

Microservices are meant to make development and deployment better,

but not necessarily easier.

Page 13: Microservices: Breaking Apart the Monolith

Decoupling

Page 14: Microservices: Breaking Apart the Monolith

Where to Start

From Scratch Refactor New Features

Page 15: Microservices: Breaking Apart the Monolith

Identify Candidate Components

➔ Outside of user response loop

➔ 3rd party service API calls

➔ Long running processes

➔ Transaction Processing

➔ Scale-out / burst processing

➔ Scheduled jobs

Business Capability

Page 16: Microservices: Breaking Apart the Monolith

Loosely coupled microservices centered around specific business capabilities lead

to more flexible and agile workflows across your entire organization.

Page 17: Microservices: Breaking Apart the Monolith

Communication

Page 18: Microservices: Breaking Apart the Monolith

More Moving Parts

Page 19: Microservices: Breaking Apart the Monolith

Queue all the Things

➔ Acknowledge data delivery➔ Retry down endpoints➔ Act as delivery buffer➔ Keep data ordered properly

POST -> GET -> DELETE

Page 20: Microservices: Breaking Apart the Monolith

Problems with Dumb Pipes

Down endpoints

Overloaded endpoints

Page 21: Microservices: Breaking Apart the Monolith

Message Queueing for the Modern Cloud

Queue as a Service Cloud-Native Protocols

Reliable Data Persistence Advanced Feature Set

Detailed Monitoring Multiple Language Support

Page 22: Microservices: Breaking Apart the Monolith

Leveraging a message queue ensures reliable data transmission across services

and connected devices.

Page 23: Microservices: Breaking Apart the Monolith

Compute

Page 24: Microservices: Breaking Apart the Monolith

Event-Driven Asynchronous Patterns

WebhooksRespond to events from external services to initiate a process

Scheduled JobsCron-like processes that occur on a regular schedule.

StreamsReal-time activities through long running agent/daemon processes

Fan OutRespond to events and push to multiple process/data endpoints

Page 25: Microservices: Breaking Apart the Monolith

Compute Environment

Load Balancer

Traditional Hosting Model (Apps) Ephemeral Micro Computing (Tasks)

Page 26: Microservices: Breaking Apart the Monolith

Distribute the Load

A master service can orchestrate slave services to run concurrently to handle

spikes in traffic or bursts

Single responsibility microservices can scale more effectively and cut down total processing time

Ex: Send 4000 emails

1-1000 1001-2000 2001-3000 3001-4000

Page 27: Microservices: Breaking Apart the Monolith

Highly Scalable Asynchronous Task Processing

Containerized Environment Event-Driven

Flexible Scheduling Reliable and Secure

Detailed Monitoring Multiple Language Support

Page 28: Microservices: Breaking Apart the Monolith

This new pattern of event-driven asynchronous processing with the

container as the unit of scale leads to more efficient and cost-effective systems.

Page 29: Microservices: Breaking Apart the Monolith

API Gateway

Page 30: Microservices: Breaking Apart the Monolith

Request Handling / Routing

APIGateway

Auth

User Request REST

Page 31: Microservices: Breaking Apart the Monolith

Considerations

Keep it LightFocus on handling requests and

routing to appropriate microservices

Make it Highly AvailableMust be deployed in a fault-tolerant

distributed manner

Load BalancedMust be able to handle incoming traffic spikes elastically

Page 32: Microservices: Breaking Apart the Monolith

The API Gateway provides the foundation for your entire architecture.

Page 33: Microservices: Breaking Apart the Monolith

State

Page 34: Microservices: Breaking Apart the Monolith

Connections, Payloads & Caching

Deliver payload

Secure DB connection

In-process temp storage

Page 35: Microservices: Breaking Apart the Monolith

Polyglot Persistence

Key/ValueRapid access for reads/writes

SQLTransactional data

NoSQLHigh volume reads

FIleDistributed file system

Page 36: Microservices: Breaking Apart the Monolith

While preserving stateless microservices, choose the right data store and

connection for the process.

Page 37: Microservices: Breaking Apart the Monolith

Presentation

Page 38: Microservices: Breaking Apart the Monolith

Client Frameworks

Page 39: Microservices: Breaking Apart the Monolith

Considerations

➔ Route via the API gateway not directly from devices

➔ Fine-grained auth support may be needed in certain cases

➔ Balance inline processing vs out-of-process

➔ Pre-process for faster loading times

➔ Out-of-process for greater responsiveness

➔ Distribute processing but not necessarily core storage

Page 40: Microservices: Breaking Apart the Monolith

Always remember that your users see your application as one unit regardless of

architectural pattern.

Page 41: Microservices: Breaking Apart the Monolith

Operations

Page 42: Microservices: Breaking Apart the Monolith

Configuration

Environments Dependencies Deployment

Support for easier migration paths

Consistent runtime from development to production

Empowers independent teams and workflows

Choose the right language for the specific microservice

Limited scope of dependent services and libraries

Scoped environment variables and runtimes

Build, test, and deploy on a simpler scale

Smaller services and teams means faster iterations

Leverage a PaaS for automated deployment configuration

Page 43: Microservices: Breaking Apart the Monolith

Continuous Delivery

Code Test Deploy

Page 44: Microservices: Breaking Apart the Monolith

Monitoring & Analytics

Page 45: Microservices: Breaking Apart the Monolith

Responsibilities

Runtime Monitoring

Audit trails

Logging

Error Handling

Alerting

Performance Testing

Page 46: Microservices: Breaking Apart the Monolith

Keeping it Together

STDOUT

Errors

Runtime

Performance

Page 47: Microservices: Breaking Apart the Monolith

With microservices, monitoring and analytics must be done at both the

individual level and as part of the whole application.

Page 48: Microservices: Breaking Apart the Monolith

Conclusion

Page 49: Microservices: Breaking Apart the Monolith

Full Microservices Stack

API

Infrastructure

Compute Storage Networking

Message Queue Scheduler

Monitoring

Page 50: Microservices: Breaking Apart the Monolith

How We Can Help

Pair ProgrammingGet a hands-on walkthrough

of our platform

Architecture ReviewLet us share some best practices and advice

Start a Free TrialStart building with Iron.io

in minutes

Page 51: Microservices: Breaking Apart the Monolith

Iron.io

325 9th St

San Francisco, CA 94103

1-888-939-4623

www.iron.io

[email protected]

THANK YOU

QUESTIONS?