Decoupling in Practice

Rate this content
Bookmark

Deploying decoupled and microservice applications isn't just a problem to be solved on migration day. Moving forward with these architectures depends completely on what your team's workflow experience will look like day-to-day post-migration.


The hardest part of this can often be the number of vendors involved. Some targets are best suited for specific frontend frameworks, while others are more so for CMSs and custom APIs. Unfortunately their assumptions, workflows, APIs, and notions of security can be quite different. While there are certain advantages to relying on a strict contract between apps – where backend and frontend teams work is limited to a single vendor – this isn't always realistic. This could be because you're still experimenting, or simply the size of your organization doesn't allow for this kind of specialization just yet.


In this workshop, you'll have a chance to explore a different, single vendor approach to microservices using Strapi and Next.js as an example. You'll deploy each app individually, establishing a workflow from the start that simplifies customization, introducing new features, investigating performance issues, and even framework interchangeability from the start.


Structure:

- Getting started

- Overview of Strapi

- Overview of Platform.sh workflow

- Deploying the project

- Switching services

- Adding the frontend


Prerequisites:

- A Platform.sh trial account created

- The Platform.sh CLI installed

Chad Carlson
Chad Carlson
102 min
11 Apr, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Platform.SH is a platform as a service provider that supports various frameworks and runtimes. In this workshop, a two application project called food adviser is deployed using Next.js as the front end and Strapi as the back end. The process involves creating a Strapi application, managing content collections, building the Strapi API, setting up the database and admin panel, deploying the project to Platform.SH, integrating with GitHub, configuring routes, and deploying the backend. The workshop also covers deploying the frontend, configuring the frontend and backend, and additional topics such as email settings in Strapi.

Available in Español: Desacoplamiento en Práctica

1. Introduction to Platform.SH

Short description:

Hello, I'm Chad Carlson, the DevRel team manager at Platform.SH. We provide a platform as a service with support for various frameworks and runtimes.

Hello again, my name is Chad Carlson. I manage the DevRel team at Platform.SH. This is my second Node.Congress, second time doing a workshop. Previously, I did a version of this one as well.

My background is primarily in Python, but since working at Platform, I had been tasked a few years back to do a lot of the exploration on this decoupled topic on our platform. And a lot of the time, or certainly when I've come across it, and what many people do, is they will often have two separate targets for deploying a front end and back end of an architecture like this whether that's many, many microservices or just the back end CMS and your front end of framework of Next.JS or Gatsby, whatever it may be.

So what makes platform a little bit different is that, first of all, we're a platform as a service provider, and we don't have any restrictions on the types of frameworks that you can deploy on our platform. So that can be Next.js, Gatsby, Nuxt, Express, Remix, but it can also be Django, FastAPI, Drupal, Magento, all these different things that may fall into a number of different runtimes. So we have support for all of them.

2. Deploying Multi-App Projects on PaS

Short description:

Platform.SH is a platform as a service provider that supports various frameworks and runtimes. It allows you to deploy applications using different frameworks and runtimes, such as Next.js, Gatsby, Nuxt, Express, Remix, Django, FastAPI, Drupal, and Magento. Platform.SH also allows you to add resources to a singular environment and deploy copies of containers across each environment. This is especially helpful for security and data obfuscation, as well as making changes to both the front end and back end simultaneously. In this workshop, we will deploy a two application project called food adviser, with Next.js as the front end client and Strapi as the back end headless CMS. We will explore the logic of the back end, configure the platform, and deploy the project to production.

So what makes platform a little bit different is that, first of all, we're a platform as a service provider, and we don't have any restrictions on the types of frameworks that you can deploy on our platform. So that can be Next.js, Gatsby, Nuxt, Express, Remix, but it can also be Django, FastAPI, Drupal, Magento, all these different things that may fall into a number of different runtimes. So we have support for all of them. If you are interested at all, we'll probably be hopping back and forth between the documentation while we're doing things. Here is our public docs, and all of the runtimes, all the programming languages that come with built-in support on our platform.

So as we'll see in a little bit, if I want to define an application that uses Node18, I can do that while at the same time, say I'm pulling from a backend Drupal CMS, which many of you are probably familiar with, you have my content team in the back, I can deploy that with this same type key but using PHP 8.2 instead. And on top of that, instead of having sort of this language-agnostic support, we also allow you to continue to add resources to a singular environment, whether that's production, staging, or development so that you can deploy copies of these containers across each environment. So when I was talking about if I've got two different deployment targets for front and back end, separated workflows and separated teams as we're making changes to the front and back end. But on Platform, as we'll see, I can have in a single environment in what we'll call a project for our repository for a fully deployed set of applications that has the front and back end included in that single environment. And then as we make changes, I create a new branch, a new environment. I'm going to get exact copies of both of those app containers across each environment. And so it's not necessarily going to be the most important thing all the time for developing new features. But two reasons that I've come across, this becomes especially helpful. One is the security and PII, personally identifying information, angle. If we have a production website that users are logging into and we want to create development environments for any particular change. It's very easy within this model to sanitize the database to exclude obfuscate or totally fake that kind of production data in these environments. All becomes part of the same workflow. And then the second is if we're doing any kind of migrations of adding a different front end or adding a secondary front end for mobile or whatever the case may be, And we need to not just make changes to the front end or just to the back end, we're really dealing with changes to that contract in the middle of that API. So we may need to make changes to both apps simultaneously. So it becomes really helpful to have them in their own set aside environment in order to do that.

So that's a quick on the project, what are we going to be doing today. So our goal here is to deploy a two application project on our platform on platform SH, and the project that we're going to work on is called food adviser. So I'm sure many of you are familiar with next JS, that's going to be our front end client. And it's going to be consuming data from a back end headless CMS called strappy. If you haven't heard of it, it's it's simply provides a UI for defining collections, whether that's a blog post or in this case the thing we're deploying is a restaurant review website that includes blogs, users, reviews, restaurants, food, categories, things like this. Strapi makes it pretty easy for you to build those content types in the UI in the back end, to then put together this production API that can then be consumed by something like Next JS. And so even for Strapi, which they're, this is their main demo. And I claim no credit on developing the applications themselves, but we can take a look at a little bit of how they're put together to understand the logic of, especially the back end of Strapi. And then add the platform configuration around it to deploy it to deploy this thing to production. So that's where we'll be focused on today. So, I am going to share a link with all of you. So this is a repository that I've set up for us to go through this workshop, so I will add it both to discord and to the zoom chat. And so it's basically the starting point of, of how we're going to both build this demo and then deploy it piece by piece. So let's get rid of that for now. From this main repo that I just shared. Right, sorry. Let's do the users templates, and let's just create a new one in our namespace. And we're going to just do all that. So this is me. If you have any questions, I'm pretty much Chad W Carlson on everything. Chad Carlson has taken on pretty much everything. So we're going to go ahead and clone this repository locally. And so while that's going, the way that this is sort of structured is a brief description of the workshop is in the main read me license information for the upstream food advisor demos included in this front note, and then a. Excuse me, structure of what we're going to be going through is included here. So like I said goal here is to talk a little bit about this back end and how it's put together. Deploy it, connect to the front end. And then if we do have some time, start talking about what it would mean to start switching to production services and developing new features like adding email support. Most of the steps are going to be inside this help steps set of sub directories, and then client is the front end code which we'll we'll get to towards the end. Let's see is this done, yes. Alright, so let's open this in VS code.

Watch more workshops on topic

Decomposing Monolith NestJS API into GRPC Microservices
Node Congress 2023Node Congress 2023
119 min
Decomposing Monolith NestJS API into GRPC Microservices
Workshop
Alex Korzhikov
Alex Korzhikov
The workshop focuses on concepts, algorithms, and practices to decompose a monolithic application into GRPC microservices. It overviews architecture principles, design patterns, and technologies used to build microservices. It covers the theory of the GRPC framework and protocol buffers mechanism, as well as techniques and specifics of building isolated TypeScript services in the Node.js stack. The workshop includes a live use case demo of decomposing an API application into a set of microservices. It fits the best architects, tech leads, and developers who want to learn microservices patterns.
Level: AdvancedPatterns: DDD, MicroservicesTechnologies: GRPC, Protocol Buffers, Node.js, TypeScript, NestJS, Express.js, PostgreSQL, TurborepoExample structure: monorepo configuration, packages configuration, common utilities, demo servicePractical exercise: refactor monolith app
How to develop, build, and deploy Node.js microservices with Pulumi and Azure DevOps
DevOps.js Conf 2022DevOps.js Conf 2022
163 min
How to develop, build, and deploy Node.js microservices with Pulumi and Azure DevOps
Workshop
Alex Korzhikov
Andrew Reddikh
2 authors
The workshop gives a practical perspective of key principles needed to develop, build, and maintain a set of microservices in the Node.js stack. It covers specifics of creating isolated TypeScript services using the monorepo approach with lerna and yarn workspaces. The workshop includes an overview and a live exercise to create cloud environment with Pulumi framework and Azure services. The sessions fits the best developers who want to learn and practice build and deploy techniques using Azure stack and Pulumi for Node.js.
How to Convert Crypto Currencies With GRPC Microservices in Node.js
JSNation 2023JSNation 2023
117 min
How to Convert Crypto Currencies With GRPC Microservices in Node.js
Workshop
Alex Korzhikov
Andrew Reddikh
2 authors
The workshop overviews key architecture principles, design patterns, and technologies used to build microservices in the Node.js stack. It covers the theory of the GRPC framework and protocol buffers mechanism, as well as techniques and specifics of building isolated services using the monorepo approach with lerna and yarn workspaces, TypeScript. The workshop includes a live practical assignment to create a currency converter application that follows microservices paradigms. It fits the best developers who want to learn and practice GRPC microservices pattern with the Node.js platform.
Prerequistes:- Good understanding of JavaScript or TypeScript- Experience with Node.js and writing Backend applications- Preinstall Node.js, npm- Preinstall Protocol Buffer Compiler- We prefer to use VSCode for a better experience with JavaScript and TypeScript (other IDEs are also ok)
How to Convert Crypto Currencies with Microservices in Node.js and GRPC
Node Congress 2022Node Congress 2022
162 min
How to Convert Crypto Currencies with Microservices in Node.js and GRPC
Workshop
Alex Korzhikov
Andrew Reddikh
2 authors
The workshop overviews key architecture principles, design patterns, and technologies used to build microservices in the Node.js stack. It covers the theory of the GRPC framework and protocol buffers mechanism, as well as techniques and specifics of building isolated services using the monorepo approach with lerna and yarn workspaces, TypeScript. The workshop includes a live practical assignment to create a currency converter application that follows microservices paradigms. The "Microservices in Node.js with GRPC" workshop fits the best developers who want to learn and practice GRPC microservices pattern with the Node.js platform.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

How to Build CI/CD Pipelines for a Microservices Application
DevOps.js Conf 2021DevOps.js Conf 2021
33 min
How to Build CI/CD Pipelines for a Microservices Application
Top Content
Microservices present many advantages for running modern software, but they also bring new challenges for both Deployment and Operational tasks. This session will discuss advantages and challenges of microservices and review the best practices of developing a microservice-based architecture.We will discuss how container orchestration using Kubernetes or Red Hat OpenShift can help us and bring it all together with an example of Continuous Integration and Continuous Delivery (CI/CD) pipelines on top of OpenShift.
Micro-scopes – How to Build a Modular Modern App in a Bundled World
JSNation Live 2021JSNation Live 2021
21 min
Micro-scopes – How to Build a Modular Modern App in a Bundled World
In this talk we will explore the great benefits of breaking a big modern app to meaningful, independent pieces – each can be built, deployed and loaded separately. We will discuss best practices and gotchas when trying to apply this microservice-like pattern to the chaotic world of the browser, and we'll see how building the right pieces guarantees a brighter future for your apps. Let's dive into Neverendering story of modern front-end architecture.
Optimizing Microservice Architecture for High Performance and Resilience
Node Congress 2024Node Congress 2024
24 min
Optimizing Microservice Architecture for High Performance and Resilience
- Delve into the intricacies of optimizing microservice architecture for achieving high performance and resilience.- Explore the challenges related to performance bottlenecks and resilience in microservices-based systems.- Deep dive into the strategies for enhancing performance, such as efficient communication protocols, asynchronous messaging, and load balancing, while also discussing techniques for building resilience, including circuit breakers, fault tolerance, and chaos engineering.- Explore relevant tooling and technologies, such as service mesh and container orchestration, and offer insightful case studies and lessons learned from real-world implementations.- Emphasize the importance of continuous improvement and adaptation in microservices environments, alongside reflections on the future trajectory of microservices architecture.
Building and Operating a Modern Composable Monolith
DevOps.js Conf 2024DevOps.js Conf 2024
19 min
Building and Operating a Modern Composable Monolith
It all started with the monolith’s fission into microservices. This set logical and physical boundaries, fusing the infrastructure and software dimensions. While microservices simplified how teams develop independently, it added extra complexities around performance, correctness, general management, and ultimately a slower development cycle. In this talk, we will dive deep into how to architect and implement a Fastify-based composable monolith, cross-service network-less communication, and how to handle efficient development across teams while deploying a single artifact in Kubernetes. Does it sound like magic?Let's discover the trick together!