Remix Architecture Patterns

Rate this content
Bookmark

Remix provides amazing flexibility and can be deployed anywhere where JavaScript is running. But how does Remix fit into the bigger application landscape of an organization? Remix provides great utility, but how to best take advantage of it? What things should be handled inside of Remix, and what things are better off done elsewhere? Should we use the express adapter to add a WebSocket server or should that be a standalone microservice? How will enterprise organizations integrate Remix into their current stacks? Let’s talk architecture patterns! In this talk, I want to share my thoughts about how to best integrate Remix into a greater (enterprise) stack.

FAQ

Software architecture is the blueprint for an application, designed to fulfill specific requirements and solve particular problems. It involves choosing a tech stack to implement the designed architecture.

React has evolved from being just a library to also functioning as an architecture, which can be implemented by different meta frameworks according to Dan Abramov.

Remix architecture pattern involves using Remix as a hub handler running on top of a server environment, often leading to a PASPA (Progressive Enhanced Single-Page Application) that embraces the platform and enhances user interaction, even without JavaScript.

A common migration path to Remix involves moving from technologies like React Router, Next.js, Express.js, and others. Developers often start by integrating their React SPA code into Remix while maintaining a standalone API server, progressively enhancing features using Remix's capabilities.

Popular deployment variants for a Remix application include standalone Node.js environments using an ExpressJS adapter, edge environments for geographical proximity, and adding in-memory caches like Redis to improve performance and scalability.

Unlike traditional SPA architecture which separates the SPA and API server, Remix combines these elements, allowing for backend-for-frontend capabilities and seamless integration of server-side and client-side logic.

In Remix applications, GraphQL can be used to orchestrate and aggregate data from various sources, simplifying the management of APIs and enhancing the backend-for-frontend architecture.

Real-time capabilities in Remix can be implemented using WebSockets or Server-Sent Events (SSE). These technologies allow for live, dynamic user experiences by enabling continuous data flow between the server and the client.

The survey revealed that over 50% of participants use Remix professionally, with many migrating from other technologies. Despite Remix's recent release, it has gained significant traction in the professional community.

Andre Landgraf
Andre Landgraf
23 min
18 Nov, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

This Talk introduces the Remix architecture patterns for web applications, with over 50% of participants using Remix professionally. The migration from single page applications to Remix involves step-by-step refactoring and offers flexibility in deployment options. Scalability can be achieved by distributing the database layer and implementing application caching. The backend for frontend pattern simplifies data fetching, and Remix provides real-time capabilities for collaborative features through WebSocket servers and Server-SendEvents.

Available in Español: Patrones de Arquitectura Remix

1. Introduction to Software Architecture and Remix

Short description:

A software architecture is the blueprint for your application. React is now also an architecture that can be implemented by different meta frameworks. Today, I want to talk about Remix architecture patterns. Over 50% of the participants stated that they use Remix professionally. 50% of those who use Remix professionally migrated from React Router to Remix. Let's talk about architecture patterns.

Hey, everyone. What is a software architecture again? A software architecture is the blueprint for your application. You design an architecture to fulfill your requirements and fit to your use case and solve the problem you're having. And then you pick a text deck to implement the architecture that you just signed.

It turns out that React is now also an architecture. This is a really cool take by Dan Abramov, who was recently on Twitter reflecting about the state of React. He states that React is no longer just the library, but also an architecture that can be implemented by different meta frameworks. Really cool take, and I'm excited where this leads.

And today, I want to talk about Remix architecture patterns that is commonly used and implemented architectures with Remix. My name is Andrej. I'm a developer from Germany. I work at LinkedIn and currently live in Cupertino, California. In my free time, every Monday, I tutor aspiring developers on Meetup, and in general, I love building for the web. Before I moved to the United States, I wrote my master's thesis about API management patterns. I conducted interviews, and talked to software engineers and architects from different companies, and then identified patterns in how these companies manage their APIs. I then documented the results in a coherent and organized way. For that, I created a pattern language, and creating that pattern language was a lot of fun to me, and I learned a lot. So, I wanted to do it again, this time for Remix. I want to answer the question, how is Remix used? So, for this, I created a survey that I called The State of Remix, and I got 74 replies. Let's keep in mind that 74 replies is not enough to be statistically relevant, but it's certainly enough to analyze or identify common usage patterns. That said, I still want to showcase some of the numbers that I got out from the survey, just because they surprised me so much.

The first one here is that over 50% of the participants stated that they use Remix professionally. This blew my mind, considering that Remix version 1 has only been released a year ago, but it's really great to see that such a big part of the community already makes money with Remix. Of those who use Remix professionally right now, 50% stated that they migrated from React Router to Remix. I thought this number would be way higher, considering the clear migration path between React Router and Remix, and also obviously the connection between the two technologies. But it turns out folks really move from all different kinds of technologies to Remix. React Single Page Applications was still the biggest source or region where people moved from, but Next.js was mentioned a lot too, Express.js, LGS, Rails, Vue, but in general there are just so many different technologies to build for the web and folks really stated they move from all different kinds of backgrounds and technologies to Remix. I think this is really cool to see, but let's talk about architecture patterns. Before Remix, or in general, we can all agree this is a big part of the industry standard right now. You have the single page application architecture, we have an SPA running on the browser on the front end and you have a standalone API server that then communicates with the SPA.

2. Introduction to Remix Architecture

Short description:

Remix is a HUP handler that runs on top of a server environment. It creates a Progressive Enhanced Single-Page Application (PASPA) that works without JavaScript and embraces the platform. However, Remix is agnostic to the database layer, allowing us to choose our own or use one of the Remix stacks. This is the first architecture pattern for creating web applications with Remix.

So this is the industry standard right now. How does Remix compare to that? When you use MPX grade Remix to bootstrap on your Remix application and you just pick the basics, you end up with this. And this is a server environment, right? Remix is a HUP handler that runs on top of a server environment. And if you bootstrap a Remix application, it comes with a server environment, which is already kind of scaffolded for you. And on that server environment, you have a web server on which the HUP handler runs. That was a mouthful. And that kind of creates this PASPA application. And PASPA is this term that stands for Progressive Enhanced Single-Page Application, coined by Kenzie Dodds to kind of promote that the application that is created by Remix does so much more than an SPA. It even works without JavaScript. It uses the platform, embraces the platform, emulates the browser's default behaviors JavaScript if JavaScript is enabled, and does so many more things for you. So this is why we all love Remix. But if you compare it to the SPA architecture, we see that the database layer is still missing. And here, Remix is agnostic, so we have to just pick a database ourselves or we choose one of Remix stacks and it'll come for free for us. Obviously, this is also optional. You don't always need a database layer. You can also have a CMS instead. But then, either way, what we have here is our first architecture pattern. This is where we all get started with Remix and it's a system architecture that we can use to create for the web.

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

Building Better Websites with Remix
React Summit Remote Edition 2021React Summit Remote Edition 2021
33 min
Building Better Websites with Remix
Top Content
Remix is a new web framework from the creators of React Router that helps you build better, faster websites through a solid understanding of web fundamentals. Remix takes care of the heavy lifting like server rendering, code splitting, prefetching, and navigation and leaves you with the fun part: building something awesome!
Don't Solve Problems, Eliminate Them
React Advanced Conference 2021React Advanced Conference 2021
39 min
Don't Solve Problems, Eliminate Them
Top Content
Humans are natural problem solvers and we're good enough at it that we've survived over the centuries and become the dominant species of the planet. Because we're so good at it, we sometimes become problem seekers too–looking for problems we can solve. Those who most successfully accomplish their goals are the problem eliminators. Let's talk about the distinction between solving and eliminating problems with examples from inside and outside the coding world.
Scaling Up with Remix and Micro Frontends
Remix Conf Europe 2022Remix Conf Europe 2022
23 min
Scaling Up with Remix and Micro Frontends
Top Content
Do you have a large product built by many teams? Are you struggling to release often? Did your frontend turn into a massive unmaintainable monolith? If, like me, you’ve answered yes to any of those questions, this talk is for you! I’ll show you exactly how you can build a micro frontend architecture with Remix to solve those challenges.
Full Stack Components
Remix Conf Europe 2022Remix Conf Europe 2022
37 min
Full Stack Components
Top Content
Remix is a web framework that gives you the simple mental model of a Multi-Page App (MPA) but the power and capabilities of a Single-Page App (SPA). One of the big challenges of SPAs is network management resulting in a great deal of indirection and buggy code. This is especially noticeable in application state which Remix completely eliminates, but it's also an issue in individual components that communicate with a single-purpose backend endpoint (like a combobox search for example).
In this talk, Kent will demonstrate how Remix enables you to build complex UI components that are connected to a backend in the simplest and most powerful way you've ever seen. Leaving you time to chill with your family or whatever else you do for fun.
Understanding React’s Fiber Architecture
React Advanced Conference 2022React Advanced Conference 2022
29 min
Understanding React’s Fiber Architecture
Top Content
We've heard a lot about React's Fiber Architecture, but it feels like few of us understand it in depth (or have the time to). In this talk, Tejas will go over his best attempt at understanding Fiber (reviewed by other experts), and present it in an 'explain-like-I'm-five years old' way.
Making JavaScript on WebAssembly Fast
JSNation Live 2021JSNation Live 2021
29 min
Making JavaScript on WebAssembly Fast
Top Content
JavaScript in the browser runs many times faster than it did two decades ago. And that happened because the browser vendors spent that time working on intensive performance optimizations in their JavaScript engines.Because of this optimization work, JavaScript is now running in many places besides the browser. But there are still some environments where the JS engines can’t apply those optimizations in the right way to make things fast.We’re working to solve this, beginning a whole new wave of JavaScript optimization work. We’re improving JavaScript performance for entirely different environments, where different rules apply. And this is possible because of WebAssembly. In this talk, I'll explain how this all works and what's coming next.

Workshops on related topic

Remix Fundamentals
React Summit 2022React Summit 2022
136 min
Remix Fundamentals
Top Content
Featured WorkshopFree
Kent C. Dodds
Kent C. Dodds
Building modern web applications is riddled with complexity And that's only if you bother to deal with the problems
Tired of wiring up onSubmit to backend APIs and making sure your client-side cache stays up-to-date? Wouldn't it be cool to be able to use the global nature of CSS to your benefit, rather than find tools or conventions to avoid or work around it? And how would you like nested layouts with intelligent and performance optimized data management that just works™?
Remix solves some of these problems, and completely eliminates the rest. You don't even have to think about server cache management or global CSS namespace clashes. It's not that Remix has APIs to avoid these problems, they simply don't exist when you're using Remix. Oh, and you don't need that huge complex graphql client when you're using Remix. They've got you covered. Ready to build faster apps faster?
At the end of this workshop, you'll know how to:- Create Remix Routes- Style Remix applications- Load data in Remix loaders- Mutate data with forms and actions
AI on Demand: Serverless AI
DevOps.js Conf 2024DevOps.js Conf 2024
163 min
AI on Demand: Serverless AI
Top Content
Featured WorkshopFree
Nathan Disidore
Nathan Disidore
In this workshop, we discuss the merits of serverless architecture and how it can be applied to the AI space. We'll explore options around building serverless RAG applications for a more lambda-esque approach to AI. Next, we'll get hands on and build a sample CRUD app that allows you to store information and query it using an LLM with Workers AI, Vectorize, D1, and Cloudflare Workers.
Developing Dynamic Blogs with SvelteKit & Storyblok: A Hands-on Workshop
JSNation 2023JSNation 2023
174 min
Developing Dynamic Blogs with SvelteKit & Storyblok: A Hands-on Workshop
Top Content
Featured WorkshopFree
Alba Silvente Fuentes
Roberto Butti
2 authors
This SvelteKit workshop explores the integration of 3rd party services, such as Storyblok, in a SvelteKit project. Participants will learn how to create a SvelteKit project, leverage Svelte components, and connect to external APIs. The workshop covers important concepts including SSR, CSR, static site generation, and deploying the application using adapters. By the end of the workshop, attendees will have a solid understanding of building SvelteKit applications with API integrations and be prepared for deployment.
Back to the Roots With Remix
React Summit 2023React Summit 2023
106 min
Back to the Roots With Remix
Featured Workshop
Alex Korzhikov
Pavlik Kiselev
2 authors
The modern web would be different without rich client-side applications supported by powerful frameworks: React, Angular, Vue, Lit, and many others. These frameworks rely on client-side JavaScript, which is their core. However, there are other approaches to rendering. One of them (quite old, by the way) is server-side rendering entirely without JavaScript. Let's find out if this is a good idea and how Remix can help us with it?
Prerequisites- Good understanding of JavaScript or TypeScript- It would help to have experience with React, Redux, Node.js and writing FrontEnd and BackEnd applications- Preinstall Node.js, npm- We prefer to use VSCode, but also cloud IDEs such as codesandbox (other IDEs are also ok)
How to Solve Real-World Problems with Remix
Remix Conf Europe 2022Remix Conf Europe 2022
195 min
How to Solve Real-World Problems with Remix
Featured Workshop
Michael Carter
Michael Carter
- Errors? How to render and log your server and client errorsa - When to return errors vs throwb - Setup logging service like Sentry, LogRocket, and Bugsnag- Forms? How to validate and handle multi-page formsa - Use zod to validate form data in your actionb - Step through multi-page forms without losing data- Stuck? How to patch bugs or missing features in Remix so you can move ona - Use patch-package to quickly fix your Remix installb - Show tool for managing multiple patches and cherry-pick open PRs- Users? How to handle multi-tenant apps with Prismaa - Determine tenant by host or by userb - Multiple database or single database/multiple schemasc - Ensures tenant data always separate from others
Build and Launch a personal blog using Remix and Vercel
Remix Conf Europe 2022Remix Conf Europe 2022
156 min
Build and Launch a personal blog using Remix and Vercel
Featured Workshop
Robert Pop
Robert Pop
In this workshop we will learn how to build a personal blog from scratch using Remix, TailwindCSS. The blog will be hosted on Vercel and all the content will be dynamically served from a separate GitHub repository. We will be using HTTP Caching for the blog posts.
What we want to achieve at the end of the workshop is to have a list of our blog posts displayed on the deployed version of the website, the ability to filter them and to read them individually.
Table of contents: - Setup a Remix Project with a predefined stack- Install additional dependencies- Read content from GiHub- Display Content from GitHub- Parse the content and load it within our app using mdx-bundler- Create separate blog post page to have them displayed standalone- Add filters on the initial list of blog posts