Background:
Micro services are a style of software architecture in which system is delivered using a small set of services which are granular, independent and collaborating services. It is a technique of applying single responsibility principle at architectural level.
Micro services are often integrated using REST over HTTP.
Layered Architecture of Micro services :
Resources handle incoming requests. They validate request format, delegate to services and package response. For RESTFUL services this includes deserialization of requests, authentication, serialization of response and mapping exceptions to HTTP status codes.
Services represents core business logic. They may collaborate with other services, adapters or repositories to retrieve required data to fulfill a request. Services only consumes and produces domain objects. They don't interact with DTOs from persistence layer and transport layer objects.
Adapters handles outgoing requests to external services. They are responsible to marshal requests, unmarshal responses, and map them to domain objects. Object mappers are widely used at this layer.
Repositories handles transactions with persistence layer.
A lightweight micro service may combine one or more of the above layer in a single component.
Performance Testing challenges:
- Whole application is not available from starting instead we have set of fully functional modules which later plug into end product.
- Use of different technologies in micro service development.
- Interaction among micro services is not readily available unless there is not single point of contact who has complete view of entire solution.
- Performance monitoring is a big challenge considering different technological aspect in micro services development ( Message Brokers, NOSQL, DataBase, N number of independent running JVMs etc).
- We need different benchmarks for capacity planning considering benchmarking activities specific to technologies (e.g Heap sizing needs different benchmarks for JVM based services and different for allied services like Node.js apps and .NET CLR will also needs its separate benchmarks)
Performance Testing of Micro Services - Approach
While designing performance testing approach for micro service based architecture, we should consider solutions to above mentioned challenges.
- Consider shortening your selection from lot of services bunch to have focus on those services which represent critical business activities model.
- Try to build a service interaction diagram for all of your performance scenarios.
- Always start with performance testing of services in isolation manner rather than replaying end to end business scenario in an integrated environment. Once you have separate performance benchmarks for each services in isolation then focus on integrated test / business scenarios.
- Performance monitoring is critical during testing activities , and use of commercial agent based monitoring solution can increase cost of testing to great extent. Although SaaS based monitoring solutions is also a solution but use of open source tools and in house developed API profiling solution will reduce testing cost to great extent.
Testing Phase Pyramid


Hi Rahul,
ReplyDeleteCould you talk more about how to do the performance monitor while doing the testing? Which tool do you use, and how to sync the perf indicator data for multiple micro services? And could you also let me know, what's the perf test strategy for the micro service arch?
Thanks very much,
Eileen
Hi Elieen,
DeleteApologies for late reply. As far as performance monitoring is concerned for a micro service based architecture, there are two solution for the same ( in my view ..) :
1. Construct your own API profiling framework and write your custom parser
2. Application Performance Management tools ( DynaTrace, New Relic, AppDynamics etc..) but this will cause huge cost since licenses are per JVM.