Reader small image

You're reading from  Full Stack Web Development with Remix

Product typeBook
Published inNov 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781801075299
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Andre Landgraf
Andre Landgraf
author image
Andre Landgraf

Andre is a full stack developer from Germany. He graduated with an MS in Information Systems from the Technical University of Munich and was also awarded an MS in Computer Science from Sofia University in Palo Alto. Andre currently lives in Cupertino, California, and he works as a Software Engineer at LinkedIn. Andre loves learning, writing, and speaking about all things web. In his free time, he tutors aspiring developers and builds for the web.
Read more about Andre Landgraf

Right arrow

Developing for the Edge

Edge is a multifaceted term that can mean different things in different contexts. It might denote a location, a runtime, or a computing paradigm. You may recall from Chapter 3, Deployment Targets, Adapters, and Stacks, that Remix can be deployed to various server environments, including edge environments. In this chapter, we will dive deeper into developing for the edge and explore what it means to develop Remix applications that run on edge environments.

The chapter is split into two sections:

  • Living on the edge
  • Understanding the edge’s benefits and limitations

First, we will discuss edge computing and define related concepts. Next, we will consider the benefits and limitations of hosting Remix at the edge.

After reading this chapter, you will understand what it means to deploy to the edge and know what to consider when working with Remix in edge environments. Further, you will know about popular edge providers and be able to...

Living on the edge

Edge computing is a paradigm that has been around for many years but has picked up steam in association with the Internet of Things (IoT). The term also found a new meaning in web development when CDNs started offering new JavaScript runtimes to host web applications on the edge. In this section, we will define what it means to run websites on the edge and see what edge development with Remix looks like. First, let’s take a step back and understand the different meanings of the term “edge.”

Computing at the edge

Edge computing is a paradigm of computer science that contrasts cloud computing. It describes a system architecture where the compute is located as close as possible to its utilization. While cloud computing happens in offsite data centers, edge computing aims to locate computing at the edge of a given network. This is why we often use the term edge to describe a location that contrasts the massive data centers of the cloud.

...

Understanding the edge’s benefits and limitations

In the previous section, you learned that edge computing is about performance. By moving the compute closer to the user, we can reduce response times and, consequently, improve the user experience. Let’s dive deeper and learn more about the edge’s pros and cons.

Edge environments follow a serverless programming model. Each incoming request starts up a new edge function. The function runs the web application (our Remix app) to fulfill the request and shuts down afterward. The serverless programming model makes edge environments highly scalable but also increases the complexity of the associated system architecture as it limits what can be done within the web application.

Serverless execution avoids wasting computing power on idle applications. However, serverless also reduces the capabilities of web applications to short-lived functions that shut down after handling an incoming request. For example, serverless...

Summary

In this chapter, you learned about the edge as a computing paradigm, a location, and a runtime. You now understand that edge computing contrasts cloud computing and aims to move the compute as close as possible to the users to reduce response times.

You further learned that CDNs can serve as the edge of the internet. Running Remix on the edge moves the web server much closer to the user compared to the regionally centralized data centers of the cloud.

Remix offers adapters for several edge deployment targets, and you practiced deploying to the edge by using Remix’s create-remix script. You now understand how easy it is to set up a Remix application on the edge.

We discussed both the benefits and limitations of the edge as a deployment target. You now understand that the edge follows a serverless programming model, which makes it highly scalable but also introduces complexity. Edge runtimes use lightweight container technologies to optimize for geographical distribution...

Further reading

Review the Remix documentation for a list of official and community adapters: https://remix.run/docs/en/2/other-api/adapter.

You can find more information about Fastly’s Remix adapter here: https://www.fastly.com/blog/host-your-remix-app-on-fastly-compute-edge.

Refer to this article to learn how to deploy your Remix application to Netlify’s edge functions: https://www.netlify.com/blog/how-to-use-remix-framework-with-edge-functions/.

If you want to learn more about edge environments, have a look at Cloudflare’s learning resources: https://developers.cloudflare.com/workers/learning/how-workers-works/.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Full Stack Web Development with Remix
Published in: Nov 2023Publisher: PacktISBN-13: 9781801075299
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Andre Landgraf

Andre is a full stack developer from Germany. He graduated with an MS in Information Systems from the Technical University of Munich and was also awarded an MS in Computer Science from Sofia University in Palo Alto. Andre currently lives in Cupertino, California, and he works as a Software Engineer at LinkedIn. Andre loves learning, writing, and speaking about all things web. In his free time, he tutors aspiring developers and builds for the web.
Read more about Andre Landgraf