Microservices- Design patterns for microservices–7

Proxy Pattern

Implementing proxy as a pattern is useful in situations where you deploy a microservice continuously. Proxy pattern allows us to create a separate proxy service that could be used to deploy the service depending on the parameters of the request. This is useful in situations where there are similar multiple services that run on different parameters due to its usability. Proxy Pattern allows the independent deployment of services without affecting the consumer. If a certain service isn’t used anymore due to all the consumers moving to the newer version of the service, the legacy service could be discontinued.

However, using semantic versioning is extremely important in managing such scenarios. One more thing to note is service discovery, which is the process of allowing external entity to discover the service for you. This helps with managing the host name and IP address changes that occur alongside infrastructural changes. This way, the proxy can call the service discovery tool to get to know the exact location of the services. Few such examples of service discovery tools are the WSO2s Governor’s Registry and CONSUL.

Things to keep in mind while implementing proxy pattern

  1. Use of multiple thread pools to reduce the possibility of requests being blocked in a queue, thus handling the situation without letting it affect the consumer.
  2. Use of thread handover mechanism which defines one thread to obtain the traffic from the consumer and lead where it requests, without letting it affect the consumer.

Thanks for reading. Until next time! 👋🏽

References

  1. https://www.youtube.com/watch?v=7mBvb7nKONg&list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&index=7
  2. https://www.oreilly.com/library/view/learning-python-design/9781785888038/graphics/B05180_05_01.jpg

--

--

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