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.

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

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

From GraphQL Zero to GraphQL Hero with RedwoodJS
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
From GraphQL Zero to GraphQL Hero with RedwoodJS
Top Content
We all love GraphQL, but it can be daunting to get a server up and running and keep your code organized, maintainable, and testable over the long term. No more! Come watch as I go from an empty directory to a fully fledged GraphQL API in minutes flat. Plus, see how easy it is to use and create directives to clean up your code even more. You're gonna love GraphQL even more once you make things Redwood Easy!
Local State and Server Cache: Finding a Balance
Vue.js London Live 2021Vue.js London Live 2021
24 min
Local State and Server Cache: Finding a Balance
Top Content
How many times did you implement the same flow in your application: check, if data is already fetched from the server, if yes - render the data, if not - fetch this data and then render it? I think I've done it more than ten times myself and I've seen the question about this flow more than fifty times. Unfortunately, our go-to state management library, Vuex, doesn't provide any solution for this.For GraphQL-based application, there was an alternative to use Apollo client that provided tools for working with the cache. But what if you use REST? Luckily, now we have a Vue alternative to a react-query library that provides a nice solution for working with server cache. In this talk, I will explain the distinction between local application state and local server cache and do some live coding to show how to work with the latter.
Batteries Included Reimagined - The Revival of GraphQL Yoga
GraphQL Galaxy 2021GraphQL Galaxy 2021
33 min
Batteries Included Reimagined - The Revival of GraphQL Yoga
The Guild has recently released Envelop - a new, modern GraphQL Server Framework and plugin system. In this talk I’ll share a brief overview of Envelop and why you should probably upgrade your existing GraphQL server to it.
Rock Solid React and GraphQL Apps for People in a Hurry
GraphQL Galaxy 2022GraphQL Galaxy 2022
29 min
Rock Solid React and GraphQL Apps for People in a Hurry
In this talk, we'll look at some of the modern options for building a full-stack React and GraphQL app with strong conventions and how this can be of enormous benefit to you and your team. We'll focus specifically on RedwoodJS, a full stack React framework that is often called 'Ruby on Rails for React'.
Step aside resolvers: a new approach to GraphQL execution
GraphQL Galaxy 2022GraphQL Galaxy 2022
16 min
Step aside resolvers: a new approach to GraphQL execution
Though GraphQL is declarative, resolvers operate field-by-field, layer-by-layer, often resulting in unnecessary work for your business logic even when using techniques such as DataLoader. In this talk, Benjie will introduce his vision for a new general-purpose GraphQL execution strategy whose holistic approach could lead to significant efficiency and scalability gains for all GraphQL APIs.

Workshops on related topic

Build with SvelteKit and GraphQL
GraphQL Galaxy 2021GraphQL Galaxy 2021
140 min
Build with SvelteKit and GraphQL
Top Content
Featured WorkshopFree
Scott Spence
Scott Spence
Have you ever thought about building something that doesn't require a lot of boilerplate with a tiny bundle size? In this workshop, Scott Spence will go from hello world to covering routing and using endpoints in SvelteKit. You'll set up a backend GraphQL API then use GraphQL queries with SvelteKit to display the GraphQL API data. You'll build a fast secure project that uses SvelteKit's features, then deploy it as a fully static site. This course is for the Svelte curious who haven't had extensive experience with SvelteKit and want a deeper understanding of how to use it in practical applications.

Table of contents:
- Kick-off and Svelte introduction
- Initialise frontend project
- Tour of the SvelteKit skeleton project
- Configure backend project
- Query Data with GraphQL
- Fetching data to the frontend with GraphQL
- Styling
- Svelte directives
- Routing in SvelteKit
- Endpoints in SvelteKit
- Deploying to Netlify
- Navigation
- Mutations in GraphCMS
- Sending GraphQL Mutations via SvelteKit
- Q&A
End-To-End Type Safety with React, GraphQL & Prisma
React Advanced Conference 2022React Advanced Conference 2022
95 min
End-To-End Type Safety with React, GraphQL & Prisma
Featured WorkshopFree
Sabin Adams
Sabin Adams
In this workshop, you will get a first-hand look at what end-to-end type safety is and why it is important. To accomplish this, you’ll be building a GraphQL API using modern, relevant tools which will be consumed by a React client.
Prerequisites: - Node.js installed on your machine (12.2.X / 14.X)- It is recommended (but not required) to use VS Code for the practical tasks- An IDE installed (VSCode recommended)- (Good to have)*A basic understanding of Node.js, React, and TypeScript
GraphQL for React Developers
GraphQL Galaxy 2022GraphQL Galaxy 2022
112 min
GraphQL for React Developers
Featured Workshop
Roy Derks
Roy Derks
There are many advantages to using GraphQL as a datasource for frontend development, compared to REST APIs. We developers in example need to write a lot of imperative code to retrieve data to display in our applications and handle state. With GraphQL you cannot only decrease the amount of code needed around data fetching and state-management you'll also get increased flexibility, better performance and most of all an improved developer experience. In this workshop you'll learn how GraphQL can improve your work as a frontend developer and how to handle GraphQL in your frontend React application.
Build a Headless WordPress App with Next.js and WPGraphQL
React Summit 2022React Summit 2022
173 min
Build a Headless WordPress App with Next.js and WPGraphQL
Top Content
WorkshopFree
Kellen Mace
Kellen Mace
In this workshop, you’ll learn how to build a Next.js app that uses Apollo Client to fetch data from a headless WordPress backend and use it to render the pages of your app. You’ll learn when you should consider a headless WordPress architecture, how to turn a WordPress backend into a GraphQL server, how to compose queries using the GraphiQL IDE, how to colocate GraphQL fragments with your components, and more.
Relational Database Modeling for GraphQL
GraphQL Galaxy 2020GraphQL Galaxy 2020
106 min
Relational Database Modeling for GraphQL
Top Content
WorkshopFree
Adron Hall
Adron Hall
In this workshop we'll dig deeper into data modeling. We'll start with a discussion about various database types and how they map to GraphQL. Once that groundwork is laid out, the focus will shift to specific types of databases and how to build data models that work best for GraphQL within various scenarios.
Table of contentsPart 1 - Hour 1      a. Relational Database Data Modeling      b. Comparing Relational and NoSQL Databases      c. GraphQL with the Database in mindPart 2 - Hour 2      a. Designing Relational Data Models      b. Relationship, Building MultijoinsTables      c. GraphQL & Relational Data Modeling Query Complexities
Prerequisites      a. Data modeling tool. The trainer will be using dbdiagram      b. Postgres, albeit no need to install this locally, as I'll be using a Postgres Dicker image, from Docker Hub for all examples      c. Hasura
Building GraphQL APIs on top of Ethereum with The Graph
GraphQL Galaxy 2021GraphQL Galaxy 2021
48 min
Building GraphQL APIs on top of Ethereum with The Graph
WorkshopFree
Nader Dabit
Nader Dabit
The Graph is an indexing protocol for querying networks like Ethereum, IPFS, and other blockchains. Anyone can build and publish open APIs, called subgraphs, making data easily accessible.

In this workshop you’ll learn how to build a subgraph that indexes NFT blockchain data from the Foundation smart contract. We’ll deploy the API, and learn how to perform queries to retrieve data using various types of data access patterns, implementing filters and sorting.

By the end of the workshop, you should understand how to build and deploy performant APIs to The Graph to index data from any smart contract deployed to Ethereum.