Serverless for React Developers

Rate this content
Bookmark

Intro to serverless

Prior Art: Docker, Containers, and Kubernetes

Activity: Build a Dockerized application and deploy it to a cloud provider

Analysis: What is good/bad about this approach?

Why Serverless is Needed/Better

Activity: Build the same application with serverless

Analysis: What is good/bad about this approach?

FAQ

Serverless computing refers to a cloud computing execution model where the cloud provider runs the server and dynamically manages the allocation of machine resources. The pricing is based on the actual amount of resources consumed by an application, rather than on pre-purchased units of capacity.

Zada is a serverless database that focuses on developer experience, offering a UI with TypeScript client, a playground, and a Visual Studio Code extension. It provides features like full search capabilities, branching for safe database changes, and a globally distributed network.

ISR allows you to update static content after the initial build step on a per-page basis. This means your static pages can be updated without needing to rebuild the whole site, providing faster performance and better SEO while still serving dynamic content.

The 'revalidate' option in ISR specifies the number of seconds after which a page re-generation can occur. Setting it to 'true' or '1' means the page will be revalidated after every request, ensuring users always receive the most up-to-date content.

Edge Functions are similar to traditional serverless functions but are executed closer to the user by running on a globally distributed network. This reduces latency because the functions are run on servers geographically nearer to the end user compared to centralized server locations.

Branching in Zada allows developers to make changes to a database in a safe, isolated environment. This feature lets you create, test, and merge changes without affecting the main database, ensuring that your production environment remains stable.

SSG offers improved load times and better SEO since the pages are pre-rendered at build time. However, it lacks real-time data fetching capabilities, which SSR provides by rendering pages on each request, allowing for dynamic content updates.

Tejas Kumar
Tejas Kumar
107 min
04 Jul, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

The Workshop focuses on building an open-source project using serverless technologies and React. It covers various topics such as choosing serverless approaches, debugging serverless code, working with databases, and creating a data model. The workshop also explores deploying React apps to a serverless setup, server-side rendering, and static site generation. It discusses the benefits of serverless, the use of Zada as a serverless database, and the concept of edge functions. Overall, the workshop provides a comprehensive overview of working with serverless and React for modern front-end development.

1. Introduction to Serverless and React

Short description:

The plan is to build an open source project in this workshop. Serverless is named as it is because, as a developer, you never touch a server. Instead, you interact with an API. React and serverless are both abstractions that simplify complexity. You can model servers without actually having to deal with them.

I would like to start with... so just an overview for you, the plan is to build a project, an open source project. This project is not going to benefit me or my company in any way. It's just to learn together. And it's a workshop.

By workshop, I mean we're working, but we're doing interactive shit. It's not like a three-hour-long talk where you turn off your video and fall asleep and then come back at the end to say, wow, great job. Meaning it's misnamed. It's a lie, is what Wikimedia says. And the presumption there is it's a lie because there's actually servers.

So it's not server-less. But really, serverless is named as it is because to you as a developer, it is serverless. You're not the one managing the servers. You're not maintaining the servers. You're not scaling the servers. You're not implementing strategies for failover for the servers. So for the developer, it is serverless in that you never touch a server. Instead, what do you touch? You touch an API. Literally an API, an application platform interface, an interface into someone else's server. That is it.

How does it connect to React? React is a level of abstraction on the imperative browser DOM, the document object model. Like React is just a bunch of functions that have state that map to elements in your browser. Serverless is similar because serverless is nothing more than abstraction. The servers and their complexity are abstracted away. You could put React as JSX in JavaScript to model the DOM. There's ways you can also model servers without actually having to deal with them.

2. Choosing Serverless Approach

Short description:

You can choose your own adventure in this workshop. There are two ways to approach serverless: looking at it under the hood and building servers, or using existing serverless solutions in a React app. The latter option focuses more on React and provides transferable skills for modern front-end development. Pick your choice by writing one or two in the chat.

Excellent. From what you wanted to learn, I received that, Matt. You mentioned you wanted to learn strategies and recipes and cookbooks on building with serverless. I think that's really helpful. Because I wanted to do this workshop in a way where you can choose your own adventure. And there's usually two ways this can go. I'm gonna need you to pay attention here. Because this will literally affect the entire workshop. You get a very different workshop if you fuck this up. It can either be... We look at serverless under the hood. So we build, maintain, provision, scale servers. And so we kind of understand serverless from that way by actually creating servers and doing the work that AWS would do. Or we use existing serverless solutions and compose them together in a React app. The latter is definitely more React-focused, less like backend infrastructure-focused. And will actually give you, I think, in my opinion, more transferable-slash-useful skills in the modern front-end React world. Because how people build apps today is, for example, if you're building a React app, you'd probably connect to Auth0 for authentication. You'd use some type of serverless database, like Zada. You'd compose different serverless providers. And then have your React app also server render or serverless render in its own way. So there's rendering strategies and things that React can talk about that would help you more meaningfully. The other one is more information that you learn about how things work. But you probably will never use professionally because there's people who work at AWS that's their full-time job, okay? So if that's clear, pick your own adventure by writing in the chat one for the serverless behind the scenes and two for composing serverless things in React.

QnA

Watch more workshops on topic

React, TypeScript, and TDD
React Advanced Conference 2021React Advanced Conference 2021
174 min
React, TypeScript, and TDD
Top Content
Featured WorkshopFree
Paul Everitt
Paul Everitt
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.
Web3 Workshop - Building Your First Dapp
React Advanced Conference 2021React Advanced Conference 2021
145 min
Web3 Workshop - Building Your First Dapp
Top Content
Featured WorkshopFree
Nader Dabit
Nader Dabit
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.
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.
Vue3: Modern Frontend App Development
Vue.js London Live 2021Vue.js London Live 2021
169 min
Vue3: Modern Frontend App Development
Top Content
Featured WorkshopFree
Mikhail Kuznetcov
Mikhail Kuznetcov
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

Prerequisites:
IDE of choice (Inellij or VSC) installed
Nodejs + NPM
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.

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

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.
Jotai Atoms Are Just Functions
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
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.
Debugging JS
React Summit 2023React Summit 2023
24 min
Debugging JS
Top Content
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.
Fighting Technical Debt With Continuous Refactoring
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.
The Epic Stack
React Summit US 2023React Summit US 2023
21 min
The Epic Stack
Top Content
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.