Pushing Boundaries To The Edge

Rate this content

While the technology goes further and further, web development tries to get closer to the user. CDNs and web servers are evolving, and they now offer us the possibility to execute server-side logic without depending on a unique data center located in a specific place in the world. Let’s present the concept of The Edge. We will see how it works, and we’ll talk about Edge Functions. We’ll discuss why the main hosting providers are introducing this technology, and why different JavaScript frameworks are modeling their approaches based on Edge computing.

9 min
06 Jun, 2023

Video Summary and Transcription

The Talk discusses the concept of the Edge and its role in content delivery networks (CDNs). CDNs are designed to improve the delivery of static content but cannot distribute dynamically generated content. Edge computing is a distributed network architecture that processes data close to the source or users, enabling personalization, geolocation-based dynamic content, AV testing, and content authentication. Frameworks like NexGIS, Bercel, Netlify, AWS, and Remix offer edge computing capabilities through edge functions or middleware, allowing execution of server-side logic closer to end users.

Available in Español

1. Introduction to Edge and CDNs

Short description:

Hello, everyone. My name is Facundo, and today we will talk about the Edge. A content delivery network is a group of geographically distributed servers that speed up the delivery of web content by bringing it closer to the users. CDNs are improved to deliver static content, but they can't distribute dynamically generated content.

Hello, everyone. My name is Facundo, and today we will talk about the Edge.

First of all, I want to do a quick introduction. My name is Facundo Giuliani. I'm from Buenos Aires, Argentina. I'm a developer relations engineer at Storyblock. I'm also one of the organizers of React Buenos Aires, which is the biggest React community in Argentina, and I also organized NodeConf Argentina, a big conference we are expecting to do this year.

So before starting or before going to the actual Edge concept, I wanted to do a recap on how we browse the web. So when we have a device, let's say a mobile phone or a computer, we request a web page to a web server and the web server returns the content that we are requesting. This content can be generated in different ways depending on the rendering method that we are using, but basically the web server will generate this HTML page and will deliver that to us. That will be the original approach of the web to distribute the content.

But this approach has an issue. The issue is that if we are using one web server, that web server is located in one particular location in the world, and we have all the users and all the visitors sending the request to that same web server at the same time to that particular location, which brings certain issues. One issue is that if we are far from that web server, that request will take more time to go to the server and then to return back the HTML page or the content, and not only that, we may be overloading that web server if we have many people visiting the website at the same time.

So to overcome that issue, a new concept or a new idea appear with the years, which is the content delivery network. A content delivery network is a group of geographically distributed servers. The idea of this group is to speed up the delivery of web content by bringing that content closer to the users. So basically, what we have in this case is this central web server that we mentioned before, but we have the content replicated in different nodes, as they are called, which are servers in different locations in the world. And then this network, the users can access to the content through the edge that is closer to them. So we will have people from different countries visiting the closest node of the network. So they will receive the content from those nodes instead of having to send their request to the unique server. There's an origin server that is called in this CDN, which is the server that is going to actually generate the content dynamically, but that is the source server, and then we have the replicated nodes inside the CDN.

Cool. So that's nice. That approach was used for static site generation, which is a method where we generate content at build time, and we have that available as static pages for the users that are visiting our website. Why? Because the CDNs are improved to deliver static content. So here we can see the issue. What's the issue? The issue is that the content that the CDNs can deliver is static. So if we want to generate content on the flight by the server, we can't use a CDN, because we can only distribute HTML pages, images, videos, all type of static assets or static content. We can use client-side rendering with React for instance, but we would be generating the content on the client-side.

2. Edge Computing and Frameworks

Short description:

The edge is a distributed network architecture that processes data close to the source or users, minimizing bandwidth. It enables personalization, geolocation-based dynamic content, AV testing, and content authentication. Frameworks like NexGIS, Bercel, Netlify, AWS, and Remix offer edge computing capabilities through edge functions or middleware, allowing execution of server-side logic closer to end users.

And that's something that if we want the server to generate that content to have a better performance, we can't do that. So to overcome those two scenarios or doing a mix of those two scenarios, we have the edge, which is a new concept and the idea of the edge is to have a distributed network architecture that processes the data as close as the source or the users to minimize this bandwidth that we were mentioning before.

So the idea is to replicate the server-side rendering on this original approach that we have, but closer to the users using the same approach that we use for the CDNs and also the same distribution of the edges and the different servers across the world.

So in this case, this is an example image from one of the examples of this edge networks. This is from AWS, but we will have CDNs with these servers that are hosting the static content, but in the same networks, in the same regional networks, we will have also edge computing servers that will execute server logic closer to the users.

So in this case, we can use the edge for different scenarios like personalization in the case that we want to send custom content to the different users. We can use geolocation to identify where the users are visiting our website from and create dynamic content based on that. We can implement approaches of AV testing in the case that we want to test different approaches on our projects, we can do that based on this dynamic content that we can generate with the edge computing. And then we can add authentication or security to the content of our websites. So we can manage static content but also dynamic content using the same edge network that we generated.

I will mention some of the frameworks that allows you to work with edge computer and as we are in a React conference, I will mention React frameworks. The first example that I wanted to mention is NexGIS. NexGIS offers edge functions which are basically scripts and functions that can execute server-side rendering code, so they are small pieces of code that can execute these functions on the edge with server-side rendering, but using the same network, or the same approach that we use for CDNs. In order to execute these functions you will need your hosting provider to allow you to do that.

The main hosting providers offer different approaches, but they offer edge computing like Bercel, Netlify, AWS, etc. We can also use what is called the middleware. The middleware is an intermediate layer or tier that can execute custom logic before a request is processed. In the case that you are using Next.js for static site generation and static content, you can catch all the different requests before you deliver the static content to the users, and then you can execute custom server-side logic before actually returning the content. So you can add custom content or you can add dynamic content to what you are returning to the user based on that.

And another framework, another React framework that we can mention is Remix. Remix's approach is basically focused on the server-side rendering, and they use what they call the Next.js Generation edge. So the idea with Remix is that you can choose between a Node.js runtime or an edge-oriented runtime on a per-route basis. So depending on the routes that you are going to manage on your website, you can execute server-side logic using a Node.js runtime or an edge function, or a worker, or, well, again, the different names that the different hosting providers offer you for this edge computing logic. So the idea is that you can execute server-side logic as close as possible to the end users that are visiting your website.

So thank you very much. Let's keep in touch, and we can continue talking about the edge or any other topic.

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

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.
React Day Berlin 2022React Day Berlin 2022
22 min
Jotai Atoms Are Just Functions
Top Content
Jotai is a state management library. We have been developing it primarily for React, but it's conceptually not tied to React. It this talk, we will see how Jotai atoms work and learn about the mental model we should have. Atoms are framework-agnostic abstraction to represent states, and they are basically just functions. Understanding the atom abstraction will help designing and implementing states in your applications with Jotai
React Summit 2023React Summit 2023
24 min
Debugging JS
As developers, we spend much of our time debugging apps - often code we didn't even write. Sadly, few developers have ever been taught how to approach debugging - it's something most of us learn through painful experience.  The good news is you _can_ learn how to debug effectively, and there's several key techniques and tools you can use for debugging JS and React apps.
React Day Berlin 2022React Day Berlin 2022
29 min
Fighting Technical Debt With Continuous Refactoring
Top Content
Let’s face it: technical debt is inevitable and rewriting your code every 6 months is not an option. Refactoring is a complex topic that doesn't have a one-size-fits-all solution. Frontend applications are particularly sensitive because of frequent requirements and user flows changes. New abstractions, updated patterns and cleaning up those old functions - it all sounds great on paper, but it often fails in practice: todos accumulate, tickets end up rotting in the backlog and legacy code crops up in every corner of your codebase. So a process of continuous refactoring is the only weapon you have against tech debt. In the past three years, I’ve been exploring different strategies and processes for refactoring code. In this talk I will describe the key components of a framework for tackling refactoring and I will share some of the learnings accumulated along the way. Hopefully, this will help you in your quest of improving the code quality of your codebases.
React Summit Remote Edition 2020React Summit Remote Edition 2020
32 min
AHA Programming
Top Content
Are you the kind of programmer who prefers to never see the same code in two places, or do you make liberal use of copy/paste? Many developers swear the Don't Repeat Yourself (DRY) philosophy while others prefer to Write Everything Twice (WET). But which of these produces more maintainable codebases? I've seen both of these approaches lay waste to codebases and I have a new ideology I would like to propose to you: Avoid Hasty Abstractions (AHA). In this keynote, we'll talk about abstraction and how you can improve a codebase applying and creating abstractions more thoughtfully as well as how to get yourself out of a mess of over or under-abstraction.
React Summit US 2023React Summit US 2023
21 min
The Epic Stack
Modern web development is fantastic. There are so many great tools available! Modern web development is exhausting. There are so many great tools available! Each of these sentiments is true. What's great is that most of the time, it's hard to make a choice that is wrong. Seriously. The trade-offs of most of the frameworks and tools you could use to build your application fit within the constraints of the vast majority of apps. Despite this, engineers consistently struggle with analysis paralysis.Let's talk about this, and a solution I am working on for it.

Workshops on related topic

React Advanced Conference 2021React Advanced Conference 2021
174 min
React, TypeScript, and TDD
Top Content
Featured WorkshopFree
ReactJS is wildly popular and thus wildly supported. TypeScript is increasingly popular, and thus increasingly supported.

The two together? Not as much. Given that they both change quickly, it's hard to find accurate learning materials.

React+TypeScript, with JetBrains IDEs? That three-part combination is the topic of this series. We'll show a little about a lot. Meaning, the key steps to getting productive, in the IDE, for React projects using TypeScript. Along the way we'll show test-driven development and emphasize tips-and-tricks in the IDE.
React Advanced Conference 2021React Advanced Conference 2021
145 min
Web3 Workshop - Building Your First Dapp
Top Content
Featured WorkshopFree
In this workshop, you'll learn how to build your first full stack dapp on the Ethereum blockchain, reading and writing data to the network, and connecting a front end application to the contract you've deployed. By the end of the workshop, you'll understand how to set up a full stack development environment, run a local node, and interact with any smart contract using React, HardHat, and Ethers.js.
React Summit 2022React Summit 2022
136 min
Remix Fundamentals
Top Content
Featured WorkshopFree
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
Vue.js London Live 2021Vue.js London Live 2021
169 min
Vue3: Modern Frontend App Development
Top Content
Featured WorkshopFree
The Vue3 has been released in mid-2020. Besides many improvements and optimizations, the main feature of Vue3 brings is the Composition API – a new way to write and reuse reactive code. Let's learn more about how to use Composition API efficiently.

Besides core Vue3 features we'll explain examples of how to use popular libraries with Vue3.

Table of contents:
- Introduction to Vue3
- Composition API
- Core libraries
- Vue3 ecosystem

IDE of choice (Inellij or VSC) installed
Nodejs + NPM
JSNation 2023JSNation 2023
174 min
Developing Dynamic Blogs with SvelteKit & Storyblok: A Hands-on Workshop
Featured WorkshopFree
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.
React Summit 2023React Summit 2023
106 min
Back to the Roots With Remix
Featured Workshop
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)