Monolithic vs Microservice Architecture Debate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
if you're interested in web development you've probably already heard the monolithic verse microservice debate it's difficult to talk about web apps without this discussion arising well you can create beautiful functional applications with either option it's important to look closely at the two so you can pick out the one that is right for your needs before I give my opinion on them and which one to use I want to give a very basic definition for what a monolithic application is versus a microservice based one monolithic architecture is a set up used for traditional server-side systems the entire systems function is based on a single application this type of system comes with various advantages first it is faster to develop you can create an application with basic features and then scale it up over time monolithic apps can also be faster than micro service apps because they don't have to have the requirement of communicating via api's to give a visual on how a monolithic application works we have something like this you we pretend that this big circle is an application then we might have features like authentication or if it's a blogging a blogging application we might have a concept of posts and we'll have a database here and we'll have a permission structure right here we might have a workflow approval so we might have a workflow approval system for approving posts all of that right here and each one of these is in the same system they'll all communicate with the same database they'll be on the same server so they'll all be on the same machine and they'll also use the same file system so each one of these so your database files might be right their authentication everything right there if you're used to building Ruby on Rails applications this might look very familiar to you because it's the way a rails app is built by default where you have one set of files and they will communicate with each other when you want to build a new feature you run a generator or you create more files and that's a way that you build a monolithic application now this is fine but it's also only one way that applications can be built we also have the ability to create things called micro service applications what a micro service is is it is a architecture where every feature is its own application so instead you remember how we have the big circle and it was one app here we might have authentication just being its own app and then we have the idea of posts posts would be its own application and then if we have a authorization or a approval workflow just like we had before we have that approval workflow and then you have each one of these and they're all separate entities they each reside on their own server and then if you're wondering how exactly could all this connect they have api's that connect it to each other so the approval workflow may have to go and make a call to the authorization engine checking to see if user is authorized and then it may check for the posts and post may also communicate with the approval workflow app all of this happens usually using JSON API based applications that's kind of a definition of how they could work at a very high level and I've already gone into some of the benefits of my of monolithic applications but there are also some drawbacks maintaining monolithic applications can actually become very challenging if specially if they're not developed well this is mainly doing due to the fact that monolithic apps have a reputation for tightly coupling processes this means that making a single change can have a domino effect and cause a number of issues in different parts of the code base while monolithic architecture puts all of the functionality into a single process microservices break these up into different pieces so if you build a micro service the right way then you're not going to have that same level of coupling and items aren't or they shouldn't depend on each other the same way that a monolithic application does so you build all of these various services inside of an entire architecture and each one of these can be tested and developed individually and once the app is up and running the service simply run on separate servers and separate processes all connected to each other one of the biggest benefits to using micro services is the ability to scale up you can scale up individual components instead of having to scale up the application as a whole a good example of time where I use this was at a micro service based application and it was with the company that ran very large marketing programs and there were times where within a day they might get 50,000 signups and that might only be fit be fitting inside a few hours worth of time where this helped is I was able to scale up certain components like the front end and the authorization engine without even having to touch these other ones because they were just like lead generation kind of signups and they didn't have to touch each one of these other components so it actually the company a lot of money because I was able to scale down and scale up the important items are going to be related to the work that was going to be done so in addition to the scaling side it also is nice because you can test the various components and isolate any problems quickly and easier and this allows you to give a more prompt solution also if a component fails your entire system doesn't have to fail so if you create your system where each component can function without the other ones your system won't crash just because one system or one component does a great example of this would be let's say that we had a reporting engine as one of the micro service components if there was a bug in the reporting engine then and this was a monolithic application it would take the entire system down however if this part goes down and there's an issue with it all that should happen is when a post calls the report engine it should just get a not available or error message and then you can render something and give the user a little bit better feedback but you don't have to take down the entire system so this is a great way of being able to isolate and spread out applications especially ones that are incredibly large it's very rare that I'll use a micro service based application for a small system just because it's a it does take a lot longer to build and usually takes more resources and therefore cost the client more however in certain situations this can be one of the best approaches a really nice benefit to this as well is the fact that if you have a spread out team so you have a remote set of developers you can actually separate them out so I could say that Lucy is going to work on the application workflow application and John is going to work on the reporting engine and Keith is going to work on the post and each one of these can almost reside inside of their own world when I worked and did quite a bit work for Eventbrite this was the way that their system was set up I had one of the micro service applications that they hired me to build out and that was all that I was responsible for I just cared about what that one did and I had to work with incoming and create outgoing API connections and services then my component focused on the parts of the reservation system and so I didn't have to worry about everything else in the application I didn't have to worry about overwriting other users code or anything like that I was simply able to focus on the item I have the responsibility for so depending on in order to make your decision on which type of system to use it really comes down to what type of location you need to build what your timeline is what the budget is what your experience is if you're a brand new developer then this probably isn't the right fit for you because you have to know quite a bit about how API is work and how you can connect systems using various services however if you do have a little bit of experience under your belt you're comfortable using API is then doing something like this can be a great way of organizing a code base and making a system more scalable it's all up to you and the project that you need to build
Info
Channel: edutechional
Views: 80,914
Rating: 4.8957915 out of 5
Keywords: monolith vs microservice, microservice best practices, ruby on rails monoliths, are monoliths bad, should all rails apps be microservices, microservice tutorial rails
Id: RJkn9VHM7lc
Channel Id: undefined
Length: 10min 34sec (634 seconds)
Published: Mon Oct 24 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.