Announcing the official GraphCMS integration for Vercel!
We've just rolled out our official GraphCMS - Vercel integration!
August 5, 2020
Microservice tech stacks are the current en vogue trend in software architectures as teams look to develop resilient applications quickly without sacrificing features. Instead of having a single backend application that was responsible for the entirety of the functionality, as was the case with monoliths, architectures should be broken down to best-of-breed services that were responsible for a singular piece of functionality. By connecting the frontend to a single API layer that interacts with the compartmentalized services such as a payment system, PIM, or CMS, development teams are able to use best-of-breed applications that have the best fit for their use case.
The challenges faced by monolithic systems include slow development times due to the interconnectedness of the functionalities, overly-complex code where it is hard to maintain a broad overview of its functionality, and small bugs bringing down the entire functionality of the architecture. Embraced by both industry heavyweights, such as Netflix and eBay, and up and coming players, like Peloton and Omio, microservice architectures are quickly becoming the industry standard. Microservice tech stacks allow you to leverage the most cutting-edge services such as Headless CMSs, Martech services, Chatbot services, Digital Asset Management Systems, and Content Delivery Networks.
Microservices offer scalability, faster development, and scalability when designed properly. They open the floodgates to best-of-breed services that suit the project’s use case and budget. However, microservice architectures are not without their own guidelines to consider. There are some best practices to consider when creating and maintaining a microservice system. If teams follow these principles, it will be much easier to avoid recreating a monolith system, a trap that some development teams do fall into from time to time. These are:
Each microservice should have a well-defined task and goal. They should not attempt to over-engineer a complicated architecture as a primary benefit of microservices is the ability to quickly build and modify components because they are independent of each other.
Design a service to be the single source of truth for that element in your system. For example, when you order something from an eCommerce site, an order ID is generated. This order ID can be used by other services to query an order service for complete information about the order. The data communicated between services should be the order ID, not the attributes/information of the order itself.
It is important to consider which microservices are stateless and which have states. They do not all need to be stateless; however, it is an important factor for development as aspects like backups need to be accounted for.
The services chosen should be able to handle errors or bugs without crashing the entire functionality of the application. This requires proper fault protection and monitoring but when done correctly can also be a big benefit of microservice architecture.
This is a critical tenet, as, without independent deployments, microservice architecture loses its appeal. It is important to be able to modify and update specific components of the architecture without requiring a new deployment to the entire system.
It is always best to avoid multiple services referencing the same databases. This will keep the code as clean as possible and enable the benefits of a microservice architecture to be realized.
Because there is never a silver bullet in architecture design, there are limitations to microservice-led tech stacks. The challenge that can cause the biggest headache is when the principles above are not followed and the development team accidentally recreates a monolith style system. This misstep can be difficult to recover from because it implies that the services have not remained independent from each other and thus slow down development, make independent deployments impossible and overall make the team less productive.
Larger teams should also ensure that they have the proper monitoring and communication procedures in place. While this will add to the complexity of the architecture, it will save some headaches should anything go awry. This is especially important when testing updates and features. If you are testing how a new feature interacts with the rest of the architecture but are unaware of upcoming changes to dependent services, it could be problematic when the feature is released.
Here at GraphCMS, one important aspect of microservice architecture is the idea of content as a service (CaaS). CaaS delivers centrally hosted, potentially globally distributed content on-demand through web services and APIs. The content is consolidated into a “content repository” where it is possible to make changes and organize content. CaaS is intended to be one aspect of the microservice web where other platforms can consume and render the content. Headless CMSs like GraphCMS can be used as CaaS systems which allow for greater personalization and omnichannel content delivery among other benefits. When considering how to deliver content most effectively, the CaaS model using a headless CMS can be a great option for many projects, from Apps to IoT to websites.
At GraphCMS, we have many examples of how different microservices fit together to create an MVP project. If you are hoping to build a quick eCommerce solution, you can check out the tutorial here.
When trying to build an app rapidly (specifically a fitness app), you can check out the starter along with its guide here.
If you have a suggestion for other microservice architectures you would like to see, let us know! We are always trying to build more examples that are helpful to our users.
This site uses cookies to provide you with a better user experience. For more information, refer to our Privacy Policy