Tuesday, 15 December 2015

Week 5 [14-20.12.2015] Miroservices

Lately I have been working on a migration of a huge system that is designed by three-tier applications architecture, into architecture which is based on microservices. We can call a monolithic web application a huge system which is designed by three-tier architecture. Let me tell you more about what the 3-tier architecture really is.  The three tier stands for:
  1.   Presentation tier. This is the topmost level of the application. The presentation tier displays information related to such services as browsing merchandise, purchasing and shopping cart contents. It communicates with other tiers by which it puts out the results to the browser/client tier and all other tiers in the network. (In simple terms it is a layer which users can access directly such as a web page, or an operating systems GUI)
  2.   Logic tier. The logical tier is pulled out from the presentation tier and, as its own layer, it controls an application’s functionality by performing detailed processing.
  3.  Data tier. The data tier includes the data persistence mechanisms (database servers, file shares, etc.) and the data access layer that encapsulates the persistence mechanisms and exposes the data. The data access layer should provide an API to the application tier that exposes methods of managing the stored data without exposing or creating dependencies on the data storage mechanisms. Avoiding dependencies on the storage mechanisms allows for updates or changes without the application tier clients being affected by or even aware of the change. As with the separation of any tier, there are costs for implementation and often costs to performance in exchange for improved scalability and maintainability.


Such architecture is very common for most of the web applications across the internet. But as they grow up, the continuous integrations processes are being harder to maintain (there are also some other problems).  The solution for that problem is to split our system into many small services, we call them Microservices.

Please read this article to get more information about the topic: http://martinfowler.com/articles/microservices.html
Please tell me what is your opinion about microservices?
Can you imagine what are the difficulties providing such architecture into nowadays web application?
What are the advanteges and disadvanteges of microservices/ monoliths?

23 comments:

  1. To be honest I am still learning about SOA architecture and I can wrongly interpret Microservices like a light version of SOA. I only rise one issue: can Microservices compete with many Java n-tier technologies? Well I hope that this technology would be easier to implement that hard Java projects. However there is plenty of the MSE companies who are ready to implement Microservices architecture for their sites.

    ReplyDelete
  2. I don't understand what do you mean about 'light version of SOA'. For me you can interpret the microservices as something like a SOLID principles on SOA: one responsibility - one service, new functionality in the system - new pack of services, easy way to switch versions of the services on stage/production environment. There is no problem that the service can be a n-tier Java system/web application, but it shouldn’t be too big. Here is also one good thing – there is no boundaries on technology, so you can take any the technology which solves your current problem in the finest way – you can take JEE, NET, NodeJS (and others) technologies and compose whole system using them. Another great advantage here is that you can apply all continous integration processes for one microservice, so all the processes like building, testing, deploying the database, deploying the service, running the automated tests can be done in much quicker and safer way. The development of such service is also simply - the goal here is that the service contains only a few hundred lines of code.

    ReplyDelete

  3. Microservices architecture is one extreme of software architecture whereas multi tier silos the other. I think that the most beneficial style lies somewhere in between. With microservices tend to duplicate some repeatable functionalities or logic, for example managing data persistence. Also having many teams, each developing some number of microservices does not ease code reusability. I work in Scrum, which look like a perfect methodology for developing microservices, and honestly sometimes our team solve the same problems different way, which results in discrepancies in validation between services or a bit different looking screens.
    Personally I prefer standard 3 tier architecture with DRY (Don't Repeat Yourself) and Convention over Configuration paradigms.
    I think that both styles struggle with running tests (specially managing test data), integration ( I suppose there is a common data model across microservices, or maybe there isn't?), maintenance and impact management. I don't really believe that microservices architecture is a cure for these problems.

    ReplyDelete
  4. My opinion on Microservices?
    Very good architecture approach for certain applications, very bad idea for others.
    In computer engineering everything depends. If you need to build heavy-duty, low response time and high availability system that will face heavy loads, then microservices might be an answer. Provided that the system is complex enough. If it is not complex enough, than the overhead on microservices deployment will kill all the advantages they give you.
    As always: use the right tool for the job. Microservices and n-tier architectures are not universal answers to all system design problems. There's simply no silver bullet, that is there is no universal answer for every problem is unique.

    ReplyDelete
  5. Hi,

    In my opinion the microservices is it very good architecture but for specific problems. I have the same opinon as Paweł Dyda, if you need to build a high availabity system you can use microservices.I think this architecture have advantages and disadvantage . For example for advantage is :
    We can use diffrent languages for project, it is easy to replace .
    For example disadvantage is testing and deployment are more complicated
    I never use this architecture but I would like to do this.

    ReplyDelete
  6. There are many advantages and disadvantages with microservices. Micro services are a reaction to the big monolithic applications. The biggest disadvantages of monolithic application are the following: Library bloat, Memory/CPU, Initialization time, Deploy Time, Testing. The microservices were developed as the answer (Of course for each mentioned issue there are other solutions than microservices . )
    One of the biggest advantage that are pushed with the microservices is the option to totally rewrite a service if the requirements have changed since each service is fairly small, and if a functionality need to be remove the service can just be discarded.
    Another big advantage is the language barrier. With micro services you can write each service in any language and with any team. Since all interfaces to the app are via message queue or rest, and language can be used.
    Here are my list of microservices advantages:
    • Small, easy to understand code base.
    • Easy to scale.
    • Easy to throw away.
    • Easy to Deploy.
    • Ability to use a different technology stack.
    • System resilience

    Do you see any other advantages that I missed?

    ReplyDelete
  7. I have very similar feelings as everyone above. The biggest disadvantages of monolithic application is scalability and if you want to replace some existing functionality it's really pain in the ass. After development stage there is testing stage that sometimes it's really difficult for all people involved in project. I am not a big fan about Microservices not because there is something bad with it but because everybody talks about it.
    I see some progress in very monolithic companies, they starting to realise that there are better solution for some problems.

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. For me Microservices is just next step in SOA. Same paradigms, yet more lightweight approach without the WS-* bloat. This is definitely a way to go if you're designing a large scale system.

    Still, I fell that most people, who didn't have a chance to work with Microservices, underestimate the complexity related to communication between services. It's really important to choose wisely the communication methods and patterns (Sync - REST, Async - AMQP, Pub Sub). It's far more complex than Monolith applications.

    If you're working on migration from Monolith app I highly recommend this article by Phil Calcado (Engineerring Director at Soundcloud):
    http://philcalcado.com/2015/09/08/how_we_ended_up_with_microservices.html
    It's a great write up on Soudcloud migration from Monolith app to Microservices architecture. If you haven't already seen it you should definitely read it.

    ReplyDelete
  10. Please tell me what is your opinion about microservices?
    Can you imagine what are the difficulties providing such architecture into nowadays web application?
    What are the advanteges and disadvanteges of microservices/ monoliths?

    It does not differ from SOA approach - it looks like a new buzz word rather.

    I have exactly the same opinion as Pawel D. You have to carefully evaluate and weigh pros and cons of every approach before applying it.

    Do you refer to web applications for commerce?
    It looks like these are simply straightforward to implement, as you don’t mention (or i’m just assuming it) any customer’s assets (purchases made) to run any eligibility or compatibility rules against content of the shopping cart. When you try to add this level of complexity, even full-blown SOA approach is having hard times..

    ReplyDelete
  11. Please tell me what is your opinion about microservices?
    They are supposed to help us build more flexible environment. Most of the time you need to spend more time and resources to implement them in comparision to the old style.
    Althought, in my opinion most of the time it's worth to do so. If you are racing against time you can't implement it in proper way, but still you can try.
    Can you imagine what are the difficulties providing such architecture into nowadays web application?
    You need more time to code and to test it. It's easier to kill your application with a bit of ddos. Your security is a bit lowered.
    What are the advanteges and disadvanteges of microservices/ monoliths?
    Talking about microservices is like talking about SOA, almost the same advantages and disadvantages.

    ReplyDelete
  12. Used microservices structure is what is the big advantage of scalability, both database and hardware. the use of microservices / monoliths depends on the type of application / venture, monolithic is ideal for small applications, it doesn't have to be so flexible and it is simpler to implement.

    ReplyDelete
  13. "We do not claim that the microservice style is novel or innovative, its roots go back at least to the design principles of Unix." - as author says, nothing new. World must be really tired with reinventing forgotten things, which is also sad becouse we're not finding new ideas very often. However this article tells the story that happens in business and production world. Business likes improvements not inventions because inventions causes new costs and results of the inventions aren't certain. Business likes certain situations and improvements which are giving better outcomes are the things that business is looking for. Better profit is the target of the business, in spite of science, which is targeting new ideas.

    ReplyDelete
  14. "We do not claim that the microservice style is novel or innovative, its roots go back at least to the design principles of Unix." - as author says, nothing new. World must be really tired with reinventing forgotten things, which is also sad becouse we're not finding new ideas very often. However this article tells the story that happens in business and production world. Business likes improvements not inventions because inventions causes new costs and results of the inventions aren't certain. Business likes certain situations and improvements which are giving better outcomes are the things that business is looking for. Better profit is the target of the business, in spite of science, which is targeting new ideas.

    ReplyDelete
  15. I do not feel competent person to speak on this issue, my knowledge on the subject is very limited. Generally speaking I agree with my colleagues above, unfortunately due to lack of relevant knowledge I am not able to quote any particular advantages or disadvantages of this solution.

    ReplyDelete
  16. Is Microservices to adopt? It seems so. Firstly, perfectly they fit into the idea of teams working in Agile spirits (and is now on top). Second, the tools have become available to support the process of "Continuous delivery", and the use of such a method of software is necessary to use Microservices .
    Finally, Microservices philosophy is consistent with the model, which Gartner called "the API economy" to be "must have" in the coming years for companies operating in the network (or virtually all).

    ReplyDelete
  17. Hey,

    Everything I had to say is already pointed out by our colleagues. The overall benefits for using microservices is that it provides an independent and easy deployment. You don't have to deploy the whole application/service, you can select only the ones you want.
    Of course they are scaling better, tests are easier to perform and if one of the services fail the whole won't crash. There are no ideals and I agree with the previous posts about the drawbacks.

    ReplyDelete
  18. Generally I am not a computer programmer and I know about programming methodology a little. When I program with my students we use only simple development environment as the Scratch or the Logo. In that case all is simple and friendly for children. No problems with tiers and services. In my opinion it depends on the main aim which kind of programming method programmer should use. I think some kind of applications need three-tier architecture other need microservices architecture. However in my opinion for programmers it is easier to use is microservices architecture because small programs are easy to check and upgrade. I think using monolith architecture is more complicated and dangerous.

    ReplyDelete
  19. Microservices are not a solution for every problem. Let us remember that in IT we are looking for the solution that will be the best for current problem. Microservices are not a treat for every problem.
    From my point of view increasing ammount of services by bigger seperation is often a big disadvantage if the solution is not planned properly.

    ReplyDelete
  20. I don't have strong opinion about microservices, as my experience with that technology is very limited. As one of colleagues already pointed - it is a good architecture approach for certain applications and very bad idea for others. Everything what I could tell about the topic is already written above, I don't see anything to add

    ReplyDelete
  21. I actually don't have experience with Microservices. It is one of the way of creating applications. It seems that it may work better for bigger solutions, but I am afraid that a design has to be prepared very carefully.

    ReplyDelete
  22. Microservices are no silver bullet for sure, but often times this is THE architecture to go for. Apart from obvious advantages like scalability (both horizontal and vertical), service reusability, eliminating single points of failure etc. it literally forces developers to modularize their code in ways traditional multi-tiered architectures don't. You're less likely to end up with tons of unmaintainable spaghetti.
    Being able to choose the best technology stack to solve each microservice's specific problem is also a huge plus and so is the ability to scale each service individually.

    ReplyDelete
  23. > Please tell me what is your opinion about microservices?

    Guess we are in the golden age for micro services.

    > Can you imagine what are the difficulties providing such architecture into nowadays web application?

    Actually, popular programming frameworks provide MVC solutions. Honestly, I don't see much trouble. For some, it's sometime hard to distinguish Model from View or Controller.

    > What are the advantages and disadvantages of micro services/ monoliths?

    Hard to develop but easy to maintain ?

    ReplyDelete