Anda di halaman 1dari 3

Demystifying the microservices landscape

Having led various transformation programs over the course of my career, I find the recent trend
around transforming the architecture landscape leveraging microservices and BigData has been
quite intriguing. I would like to share my experience in this area which I hope will be useful for those
of you who are embarking on a microservices transformation journey. I will try and stay away from
jargon and getting into specific technologies to make it useful as possible.

The concept of microservices is based on a pretty simple idea: it sometimes makes sense to develop
your applications as small interlocking pieces instead of one giant whole. These components are
developed and maintained separately from each other, so updates don’t require re-doing the entire
codebase

This definition sounds easy, but to make each service production grade requires a strong supporting
ecosystem. Before embarking on this journey it is important to consider what is required and
whether or not it is a viable for your situation. Things to keep in mind: Microservices offer a unique
kind of modularization; they make big solutions easier, increase productivity, offer flexibility in
choosing technologies and are great for distributed teams. However, it may be untenable for small
companies with limited IT resources. Sometimes, using different languages, frameworks and data
storage technologies can be paralyzing for organizations. Plus, not every team can handle the
autonomy and independence microservices offer.

If you think microservices are a good solution for you, here are my recommendations

Classify, Organize and Standardize


 Defining microservices boundary: This is key: if you go too granular, you will end up hosting a
swarm of services and quickly land into an orchestration chaos, if you go too coarse you will end
up having a monolithic application which is a nightmare to maintain. In my experience it is best
to break the landscape into discrete business capabilities. A business capability represents what
a business does in a particular domain to fulfil its objectives and responsibilities. Several business
capabilities can then orchestrate together to develop a meaningful product.
 Reorganize into accountable teams: The best path to clear accountability is to empower small
teams that own something end-to-end, which in this example is a service.
 Standardize the tech stack :This will make sure that all services leverage only a finite stack of
recommended technologies
 Logical Data Model (LDM): Define a rich canonical domain model for each business micro
service or Bounded Context. Business microservices, should exchange information with each
other using LDM constructs.
 Build a common services library :Ensure it can be leveraged by all services , these include
Reference data cache , centralized approval workflow management , scheduling , auditing ,
centralized logging aggregation , asynchronous error handling , distributed locking and
reconciliation

Provisioning and Setup


 Rapid provisioning: Ensure that a new server can be fired in a matter of hours. Naturally this fits
in with Cloud Computing, but it's also something that can be done without a full cloud service.
 Resilient Setup: Host multiple instance of microservices in each data centre. Host microservices
across multiple data centres.
 Host a Configuration server: That will act as a central place to manage external dependencies
like yaml and property files for all microservices, across all the environments/locations. It should
also provide the capability to push new configuration to every service without restarting the
services.
 Host a Service registry: Each service self-registers itself with the service registry and tells the
registry where it lives (host, port, and node name) and provides other service-specific metadata -
things that other services/clients can use to make informed decisions to accurately discover the
service in a cloud based environment where locations are assigned dynamically.
 Host an API gateway: To handle all incoming requests to edge services , it thus acts as a server
side load balancer ,central place for authenticating and authorizing external requests , request
throttling , facilitates static response handling and provides multi region resiliency

Functional and Non Functional capabilities


 Distributed tracing capabilities: As requests will often span multiple services it is necessary to
trace business transactions through multiple services. Best practice to generate a “trace key”
that is carried through across service hops that are involved in handling the request.
 Catering to Non-functional requirements: This includes ability to handle duplicate
messages, implement services that are idempotent and ability to manage transaction across
multiple databases.
 Profile support: Introduce profile (persona) concept in all core services so that we can customise
the microservices behaviour per tenant or by incoming data patterns or by product, if required.
 Classify your stores based on temperature :This is so that you can isolate transactional and
reporting queries
o Hot(real time) data – Used for rendering real time queries , queries are delivered out of
the microservices dB store itself
o Warm(near real time) data – Used for intraday reporting, create an interim store to
which we publish all the events asynchronously (can be an elastic store)
o Cold (historical data) – Warehoused data usually used for End of Day and historical
reporting.
 Having client side load balancer capability: This pushes load balancing to each client. In this
approach, load balancing is fully distributed, with each client directly responsible for routing
requests to an available micro service. Various load balancing algorithms like availability filtering,
weighted response times, and availability zone affinity will further enhance response times and
hence user experience.
 Omni channel support :
o Have an Enterprise Service Bus that runs across the microservices. Any notable events in
a micro service should be asynchronously published on to this bus as an LDM construct,
which can be then consumed by the subscribing services.
o Expose REST based request-response api’s for CRUD operations and query purpose.
 Unified Operational Workbench,: An unified UI interface ,which allows operation users to
centrally manage and configure microservices is a must
 Activity coordination service: A centralised workflow manager, which orchestrates a sequence
of activities across multiple services, proves useful if the interaction between services is getting
complex and point to point in nature.
Deployment Pipeline and Automated Testing
 Create a robust CI/CD deployment pipeline: This will help quickly build, integrate, test, scan and
deploy code to various environments in an automated fashion.
 Build a robust automated testing suite: At the very least these must include unit testing,
contract testing, integration, load testing and end to end testing in the very least.

Monitoring and Recovery


 Monitoring and Instrumentation: Performing health checks on all infra and business
components, latency measurements to predict outages and pin point malfunction, creating
phantom synthetic events , distributed tracing (specified above) and alerting in case of failures
should be a part of the monitoring offering .
 Ability to recover from failures: Automatic retry from transient failures, ability to reprocess
failed messages, ability to handle poison messages and automatically restart services upon
failures are capabilities that need to be present before GO-LIVE.
 Implement circuit breaker pattern: Every external call is wrapper into a circuit breaker object
which monitors for failures. Once the failures reach a certain threshold, the circuit breaker trips,
and all further calls to the circuit breaker return with an error and routes the request to an
alternate path, without the protected call being made at all. The circuit automatically is closed
once a successful call is made.

Conclusion
Microservices offer a unique kind of modularization, they make big solution easier, increase
productivity, offer flexibility and are great for distributed teams. If you have a large project, need
quick and autonomous delivery, plan to scale your solution or need to frequently update separate
parts of your system, microservices can be a good solution.

Author

Param Natarajan

Anda mungkin juga menyukai