I am a noob, learning things on my own. So lately I have been trying to understand how one should go about designing the architecture a non-trivial and fairly large web app and I came across the word micro-services. I tried googling, but that just made me more confused on what the term is. So some examples and explanation would be really helpful.
Mobile so just blurting this out...<p>typically you build apps as single 'monolithic' apps where all your code is in one place.<p>or<p>You split your code by criteria... say 'function'. So maybe seperating UI (front-end) from server/API (backend).<p>Reason is if you wanted to change part of your app its easier if there are clear boundaries between each part rather than mangled solo entities as with monolithic.<p>Microservices is an extreme version or seperation of concerns/function whereby you create 'black boxes' that handle one thing (auth, orders, stats, images) - each of those 'services' provides a mechanism for intra-communication... typically via an API (REST). sounds great in theory and makes large apps easier to distribute across tech stacks, geo and developer teams without worrying about other services... but... ensuring all services are secure, share information, self heal (recreate themselves when crashes occur), auto find each other across the interweb (discover) etc etc is a massive P.I.T.A.<p>Search 'Netflix microservices' on YouTube... reality is never as nice and clean as theory.<p>Also Orielly and other have books on M.S...<p>I would say build the monolith first (or simply seperate client from server/API), then split if need... rinse and repeat. Its gonna be real hard going if you're building a multi tenant app for most things and trying to start with M.S<p>When you need to scale... iterate. if M.S makes sense, split out a function and carry on.<p>Also check out Docker... sorta encourages M.S approach. Quickly create/destroy and deploy new 'service containers' etc...<p>Github has some examples too<p><a href="https://github.com/cer/microservices-examples" rel="nofollow">https://github.com/cer/microservices-examples</a>
etc etc<p>Good luck
I would recommend becoming familiar with the 12 factor app methodology (<a href="https://12factor.net" rel="nofollow">https://12factor.net</a>) and reading the following books:<p><a href="https://www.amazon.com/Building-Microservices-Designing-Fine-Grained-Systems/dp/1491950358" rel="nofollow">https://www.amazon.com/Building-Microservices-Designing-Fine...</a><p><a href="https://www.amazon.com/Production-Ready-Microservices-Standardized-Engineering-Organization/dp/1491965975" rel="nofollow">https://www.amazon.com/Production-Ready-Microservices-Standa...</a><p><a href="https://www.amazon.com/Microservice-Architecture-Aligning-Principles-Practices/dp/1491956259" rel="nofollow">https://www.amazon.com/Microservice-Architecture-Aligning-Pr...</a>
Start here <a href="https://martinfowler.com/articles/microservices.html" rel="nofollow">https://martinfowler.com/articles/microservices.html</a><p>Then look here for patterns <a href="http://microservices.io/patterns/microservices.html" rel="nofollow">http://microservices.io/patterns/microservices.html</a><p>This guide is great <a href="https://www.nginx.com/blog/introduction-to-microservices/" rel="nofollow">https://www.nginx.com/blog/introduction-to-microservices/</a><p>Finally plugging my own tooling <a href="https://micro.mu/" rel="nofollow">https://micro.mu/</a><p>Join <a href="http://slack.micro.mu" rel="nofollow">http://slack.micro.mu</a> if you want to discuss microservices
I would recommend this book, <a href="http://toptalkedbooks.com/books/xyiEMg/RESTful-Web-Services-Cookbook-Solutions-for-Improving-Scalability-and-Simplicity" rel="nofollow">http://toptalkedbooks.com/books/xyiEMg/RESTful-Web-Services-...</a>
I would suggest starting with the short introductory articles written by Chris Richardson: <a href="http://microservices.io/articles/index.html" rel="nofollow">http://microservices.io/articles/index.html</a><p>A lot of useful articles can be found inside archives section of the Microservices Weekly newsletter: <a href="http://microservicesweekly.com/archives" rel="nofollow">http://microservicesweekly.com/archives</a>
Check out <a href="https://www.datawire.io/guide" rel="nofollow">https://www.datawire.io/guide</a> it breaks down how to think about microservices architectures in terms of development, infrastructure, deployment, and traffic.