PROXY DESGIN PATTERN in Microservices.

Proxy Design pattern

Everyone has a basic understanding of what a proxy is, but many people have no idea of how a proxy is used. Let’s have a look at an example before discussing the proxy pattern. Let’s say you have a client that is ready to go from a monolithic application to a microservice architecture for his business. Due to its ongoing development over the course of its life, microservices are extremely beneficial when dealing with agile. Some services may need updates as a result of this ongoing work, such as changing functionalities and queries. A particular service update may have an impact on other services as well (the services which are connected ).The result will be system failure. We can utilize the proxy design pattern to resolve this.

The only difference between this and the aggression design pattern is that instead of aggregation, depending on the business need, a separate microservice may be invoked. The main goal of this paradigm, which can scale independently, is to avoid making each service accessible to users through an interface.

Let’s think about an example to help make things clearer and simpler. Imagine a mechanism for managing schools (the same example taken in our previous article). Additionally, it includes service to retrieve each student’s grades. You use your student’s complete name to receive the grades, but after some time, you release a new version of the service that is also utilized to get grades. Let’s say for the moment that the student’s I.D. is required in order to acquire their grades, in which case the mark service’s customers will experience problems. We can use the proxy pattern to find a solution. To get over this problem, we can build a proxy server for the specific service (the mark service). As a result, the proxy service will be used by all customers to communicate with the mark service. When the user enters the student’s full name, it will now connect with the initial or old version because the developers are no longer allowed to make any changes on the consumer side. The latest version will be communicated to the student as soon as the user gives them their number. By doing this, you can independently launch your service without upsetting your client. If your first or previous version of the service doesn’t receive any traffic after a while, you can decommission that specific version.

Semantic versioning

The semantic version has major, minor, and patch versions.

  • You increment the major version when the new version is incompatible with the previous or existing version.
  • You increment the minor version whenever you have new functionalities, but the previous or the initial service will work. If the user wants the new version, then the user is capable of updating, or else the user can go with the old functionalities.
  • The Patch version is not much relevant, and you are capable of updating it as you want.

Service Discovery Tool

When a service is created, it is much preferable to utilize a third party to find the service because when the infrastructure is modified, the hostname, IP address, etc. may also change. You might need to utilize a service discovery tool to prevent this. In order to determine the student version 1 or student version 2 based on the values of the provided parameters, the proxy will run this discovery tool. In comparison to hard coding the values, this technique is significantly superior. For the service discovery tool, you can use the ws02 governor’s register. Since your service is independent, a service discovery tool is essential.

Message queues:

The messages are stored in message queues, which then process them one at a time into the database. When the database takes a lengthy time to save the data, this is necessary (important when DB takes a lot of time to respond). To put it another way, it enables us to lessen the cascade impact. Message queues are useful for minimizing or eliminating cascading effects. When implementing message queues, you should also take other factors like faults, fault tolerance, and queue failures into account. It’s crucial to have a redundancy system.

Time out

This is an important factor you should consider when using a proxy service. Let’s assume your student version 1 is getting more and more deployed. If you haven’t implemented the time out, that block thread can also affect version 2.


[1]K. Dinesh,, 2022. [Online]. Available: [Accessed: 14- Jul- 2022].



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store