building microservices

23
Building Microservices Delhi Tech Meetup - 22/3/2017 {Prashant Parashar} (Presentation slides used for the talk on “building micro-services”. Slides alone not a comprehensive material on the topic.)

Upload: prashant-parashar

Post on 12-Apr-2017

159 views

Category:

Technology


0 download

TRANSCRIPT

Building MicroservicesDelhi Tech Meetup - 22/3/2017

{Prashant Parashar}

(Presentation slides used for the talk on “building micro-services”. Slides alone not a comprehensive material on the topic.)

Why, when ?

Two Pizza TeamsN(N-1)/2 is the number of conversation connections within a team.

Should I move to MicroServices?

What’s your traffic?

What’s your team size?

How complex is the system?

Why?

Scale Platform Scale

Team scale

Why?

Reuse Reusability

Replaceability

Focused Evolution

“Don’t build microservices in a 5-people-startup!”

Hows & whats of building

Independent systems vs micro-services

vs

Heterogeneous InterfacesFederated Standards

Homogeneous InterfacesCommon StandardsCommon design Language

Identification

Clear separation of concerns, Isolation

Not just CRUD

Self-sufficient

Management vision

Common design language

Interfaces, API language

Protocols

Security

Commons libraries

Other cross-cutting concerns

Clear architectural guidelines - Be pragmatic than ideal

Architectural Concerns - Security

Simplistic - manage at firewall

Intermediate - inter-service tokens

Advanced: Identity service, encryption etc [Avoid till you can]

Architectural Concerns - Protocols

Create common libs for protocol standards [HTTP, Headers, Marshaling protocols], connection pooling, failure handling, logging etc

JSON, XML, Protobuf, all?

Provision for protocol/serialization versions! Always.

Architectural Concerns - Context

Manage context across sync and async calls!

Context should contain:

❏ Unique source request Id❏ User/actor id❏ Caller service id❏ Specific server instances❏ Security/authorization info, if applicable

Service Mess...Mesh

Tip: Define upstream/downstream levels

Cross-cutting (even log, security etc)

User

Aggregation

Do it closer to the user

UI Layers should have their own aggregation layer

Some duplication is okay

Develop/Deploy/Test/Debug

Testability

Automated tests is essential

Service level tests important

End-to-End tests?

Auto deploy with automated tests

Debugging

Be verbose

Track call chain. Carry as much context as you can.

Runtime Performance

Prepare for performance degradation of others

Use circuit breakers. Timeouts won’t help.

Isolation of problem is important. Design such.

Design for failure. Have product flag/alternative setup

Idempotent APIs help

Sync vs Async services - design for best & worst case

one-size fits all