Micro-services and DRY (Don't repeat yourself)

Micro-services and DRY (Don't repeat yourself)

DRY is one of the basic principles of software which not only programmers but the DBA, technical writers and everyone who is involved in the software building should be aware of. It's proven that when same code is duplicated over various places then it becomes a nightmare to fix all the places where it was duplicated.

DRY can be applied at various places starting from code to database schemas, documentation and more. In this can be even applied to the libraries which are included in the projects, using BOM to avoid not only version collisions but to keep track of all the dependencies at one place.

This was easy when applications were monolithic and changes done in one library was not starting chain of builds and releases. With Micro-service architecture where project is built using various small services and are independent of each other. But what if some code is ported as a library and is included in all the services? A small change in this library will now start the builds and will create release for all the services.

In some organizations this can be a problem if the micro-services are,

  1. Not covered with Unit test cases and Integration test cases.
  2. Not deployed using Blue-green or similar deployment

So it's very important to using TDD/BDD approach to make sure that code is well covered with the test cases and deployment allows you to push updates easily without taking any down time.

This can be a major problem as well if Micro-services are using BOM type architecture where all the services are dependent on a core module which defines the libraries those can be used in the project. Now the question is why would someone do this? well, someone can say to avoid mess of libraries and versions used in different micro-services!

Micro service architecture example

But important thing to remember here is that Micro-services are meant to be independent of each other and if these type of restrictions are added on them, you are not leaving the monolithic way of working.


要查看或添加评论,请登录

Sachin Gorade的更多文章

  • Common misunderstandings of Software Developers

    Common misunderstandings of Software Developers

    Software development is a complicated subject. There are many things we have to learn almost every day and it is…

    1 条评论
  • Integration tests vs Unit tests

    Integration tests vs Unit tests

    There are various types of testing which happens in the software development process. Unit testing, Integration…

    3 条评论
  • Why Interfaces are recommend by Spring?

    Why Interfaces are recommend by Spring?

    Spring framework has become the central part of every Java based micro-service application. Spring beans work with…

    4 条评论
  • What makes REST API really usable?

    What makes REST API really usable?

    REST APIs are the most critical part of every application today, be it a blog or an application which is running on…

    8 条评论
  • Why features fail?

    Why features fail?

    Unclear requirements Each product company follows a different path for adding new features. Some follow…

    6 条评论
  • Add real value, don't be workaholic!

    Add real value, don't be workaholic!

    Friday night, 10 pm and keyboard typing sound can be heard on the floor. The one who is creating that noise in the…

社区洞察

其他会员也浏览了