building microservices
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.)
Should I move to MicroServices?
What’s your traffic?
What’s your team size?
How complex is the system?
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
Aggregation
Do it closer to the user
UI Layers should have their own aggregation layer
Some duplication is okay
Testability
Automated tests is essential
Service level tests important
End-to-End tests?
Auto deploy with automated tests
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
Thanks!www.prashantparashar.com
https://twitter.com/sucoder