{"id":1074,"date":"2019-11-29T14:50:42","date_gmt":"2019-11-29T13:50:42","guid":{"rendered":"https:\/\/blog.besharp.it\/?p=1074"},"modified":"2021-03-24T17:21:20","modified_gmt":"2021-03-24T16:21:20","slug":"writing-microservices-the-right-way-2","status":"publish","type":"post","link":"https:\/\/blog.besharp.it\/writing-microservices-the-right-way-2\/","title":{"rendered":"Writing microservices, the right way."},"content":{"rendered":"

In this final article of our 3 part analysis (you can read here the first part<\/a> and the second part<\/a>) on how to break down a Monolithic application we will exploit some insights on how a microservice can be created from an existing one, what can we do to solve problems related to legacy code with high toxicity and in general what rules can be applied to decide when to migrate to microservices. <\/span><\/p>\n

Let\u2019s get started!<\/span><\/p>\n

HOW TO WRITE A MICROSERVICE<\/span><\/h2>\n

In practice when we want to create a microservice we have two development choices:\u00a0<\/span><\/p>\n

    \n
  1. Code porting<\/b><\/li>\n
  2. Writing new code<\/b>.<\/span><\/li>\n<\/ol>\n

    CODE PORTING<\/span><\/h3>\n

    At first Code porting may seems a logical solution, mainly because the Dev team has a <\/span>cognitive bias<\/b> towards its own code BUT it can conceal some critical aspects that have <\/span>high cost<\/b> and <\/span>low value<\/b>:<\/span><\/p>\n