Take a Rest From REST (And GraphQL)

Rate this content
Bookmark
Slides

There are amazing tools out there providing you with excellent type safety. But when you get to the client-side fetching, things go wild. Even if you have perfectly typed backed, you lose the type information during the client-side communication. Yes, you can use GraphQL or protobuf and generate types, but... what if I told you there's an easier way? A way that lets you develop your apps smoother than with REST or GraphQL? How? RPC! Say hi to maximum productivity with fantastic developer experience.

This talk has been presented at React Day Berlin 2022, check out the latest edition of this React Conference.

FAQ

Callstack is a team of React and React Native consultants and developers. They specialize in providing expert consultancy and development services in the React and React Native frameworks, with core contributors on board.

Brintem offers a JavaScript widget library that includes scheduling, Gantt chart, and datagrid components, helping the world stay on schedule with these UI tools.

Questions can be submitted during the live stream using Slido. By visiting Slido.do and entering the code 0212, viewers can ask questions that will be addressed live on stage.

Aleksandra is a full stack developer based in Wroclaw, Poland. She has expertise in Elixir, Golang, Python, and TypeScript. Aleksandra was the tech lead for the Hasura console and a lead maintainer of Blitz, focusing on API layers in full stack web development.

Aleksandra's talk focuses on building full stack React applications, specifically the API layer. She discusses the evolution and implementation of various API strategies, including RPC (Remote Procedure Call) and its relevance in modern web development.

RPC stands for Remote Procedure Call. It allows functions to be executed on a different server or processor via a network, acting as a bridge for communication in distributed systems. RPC is crucial for enabling seamless interactions between separate software entities, such as client and server, in web development.

Aleksandra traced the origins of RPC back to 1981 when Bruce J. Nelson coined the term. She explained its evolution, the problems it aimed to solve, and its resurgence in modern development frameworks such as Next.js, highlighting its fit for JavaScript ecosystems.

RPC is beneficial in full stack development due to its ability to facilitate direct function calls across a network, mimicking local function calls. This approach is enhanced by advancements in TypeScript and static typing, promoting end-to-end type safety and efficient data handling.

Aleksandra Sikora
Aleksandra Sikora
32 min
02 Dec, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

This Talk explores the evolution of RPC and its relevance in modern full stack development. It discusses the limitations of SOAP and REST and introduces GraphQL as a solution. The focus is on RPC frameworks like tRPC and BlitzRPC, which provide end-to-end type safety and improved developer experience. The Talk also highlights the advantages of RPC in the context of full stack development with frameworks like Next.js. Future improvements for RPC libraries are discussed, including enabling server APIs for multiple clients and creating a developer experience tool combining the best features of BlitzRPC and tRPC.
Available in Español: Descansa de REST (y GraphQL)

1. Introduction and Sponsor Acknowledgement

Short description:

Hello everyone, welcome back here in Berlin and welcome back on the live stream if you're watching from home. We are about to introduce our next speaker, Alexander. Thank you Callstack for sponsoring. Callstack is a team of React and React Native consultants and developers with core contributors on board. Thank you also to Brintem who helped the world stay on schedule with its JavaScript widget library. Now, without further ado, we're gonna invite Aleksandra on stage. Aleksandra is a software engineer and she's based in Wroclew in Poland. She's a full stack developer. She's worked on Elixir, Golang, Python, and TypeScript. Thank you very much. Let's give a big applause to Aleksandra Stikora. Welcome, everyone.

Hello everyone, welcome back here in Berlin and welcome back on the live stream if you're watching from home. We are about to introduce our next speaker, Alexander, in just a second, but before that, just say a couple of words about our wonderful sponsors.

Thank you Callstack for sponsoring. Callstack is a team of React and React Native consultants and developers with core contributors on board. I have personally worked with them, and they are wonderful people. Thank you also to Brintem who helped the world stay on schedule with its JavaScript widget library. The UI toolkit contains scheduling, Gantt chart, and datagrid components. Visit Brintem in their booth over here for a personal demo or if you're at home, go to Brintem.com.

Now, without further ado, we're gonna invite Aleksandra on stage. Do remember to ask questions on Slido. So if you go to Slido.do and you use the code 0212, you'll be able to ask questions that will then ask Aleksandra here on stage live. Aleksandra is a software engineer and she's based in Wroclew in Poland. She's done a lot of things. She's a full stack developer. She's worked on Elixir, Golang, Python, and TypeScript. She was previously tech lead for the Hasura console and very recently been working, being the lead maintainer of Blitz. Thank you very much. Let's give a big applause to Aleksandra Stikora. Welcome, everyone. Thank you for the introduction.

2. Exploring the API Layer and RPC

Short description:

Today, I will focus on building full stack React applications, specifically the API layer. APIs act as bridges for communication between client and server applications, solving problems such as boilerplate code, type safety, and error handling. Tools like TRPC and BlizRPC offer solutions to these challenges. To understand their approach, we'll explore the history of RPC, which is the foundation of web services. RPC, or Remote Procedure Call, was coined by Bruce J. Nelson in 1981. Let's dive in!

So my talk today is take a rest from rest. So you're probably wondering what happened here, yeah. What's this talk about? So I'm going to focus on building full stack React applications, but specifically I want to talk about the API layer because it's for me it's like super exciting what's going on in the full stack web development. We have new Next.js with React server side components. We have tRPC becoming super popular. We have Remix that is growing and it's been recently acquired by Shopify. So there's a lot going on around the API layer around building full stack applications.

So before I start, I want to explain. Yeah, there is a meme. I want to explain what an API is. So in a distributed programming world, when we have computers that have to communicate with each other, for example, we have client application, server application, or different servers that have to talk to each other, we need a bridge that allows that communication and an API is that bridge. So why are we talking about this? Because a common scenario for a full stack application is that you have a database and the client and the client has to access this database. But even if your database was publicly accessible, you can't call it from the client because that would expose all your database credentials. So usually we have servers that are responsible for communicating with the database. But whenever we have to make two separate entities talk to each other and understand each other, in this case client and server, we face a lot of problems. And some of them are tons of boilerplate, losing type safety, repetitive error handling. So can we do something about it? Luckily for us, yes, we can. We now see new tools, new projects that are ready to solve this problem. We have TRPC procedures. We have BlizRPC with query and mutation resolvers. We have Remix Data Loader, React Server Site Components, and probably many more that I didn't put on this slide. But with my talk today, I'm going to focus on the approach taken by the first two, by TRPC and BlizRPC.

So that means that we are going to talk about RPC. But in order to understand how we got here, how we got to have tools like TRPC and BlizRPC, I'm going to take you back to the 80s to see a little bit of history. Why are we starting here? We are starting here because RPC is the beginning of web services. And 1981 was a year when Bruce J. Nelson wrote a thesis and coined this term. So let's start by explaining what is RPC. It stands for Remote Procedure Call. So imagine you have a local procedure, Welcome.

QnA