1
votes

I want to be able to answer the question, "Do you use microservices?" I have no clue what 'microservices' means in concrete terms. Essentially everything I've read on "What are microservices?" is either a useless pile of terms like 'loosely coupled', 'fine-grained', and 'lightweight', or sounds like it was written by management consultants for business executives and has no real content.

My current understanding is:

  • A monolithic application is one where everything (except the database) is integrated into a single code base. For example, I wrote a ASP.NET MVC application, with models, views, and controllers. It was a single codebase that ran on top of IIS and connected to MSSQL.
  • An API-driven application is one where the business logic is separated from application logic; an API defines/implements the business logic, and an application interacts with users and executes the business logic by calling the API. For example, I converted my ASP.NET MVC application into A) an API that ran in one container and B) a single-page application (SPA) that ran in a separate container and executed API calls client-side.

At a later point, when I started writing additional applications, each with their own SPA and API, I decided to factor out authentication and authorization into its own API. And then later, I decided to factor out some business logic that was common to each API, but not related to authn/authz, into yet another API. So now each SPA is communicating independently with (at least) three APIs. (Each API is a separate container, and each SPA is a separate container.)

Are these microservices? What are microservices? Each application has a single API, and in most cases I could break these into multiple smaller APIs. So are these monolithic APIs or microservices?

1

1 Answers

1
votes

I agree with you that there seems to be no well-established method to actually measure objectives such as "small", "loosely coupled" etc. It is probably hard to give an exact definition, because it depends on the context and on the way an application works.

However, there are some criteria regarding the development and deployment process for a microservices architecture:

  • You should be able to deliver and deploy the services independently of each other.
  • A development team should be able to implement a service independently of the other services.

Now the interesting question is really how to find appropriate boundaries for the services. I liked the article How to break a Monolith into Microservices, which has the nice statement:

Finding the domain boundaries in a legacy monolith is both an art and science.

It sounds like you have already gone through a lot of thinking about what to separate in single services, so you are obviously at least well on the way towards using microservices.