Then a Discord might be easier. So, what is today about? So, we're going to be building a Serverless GraphQL API using StepZen on top of your existing data sources, and you probably all have different reasons to join this workshop, and maybe if we have time later on, we can talk about your projects a bit as well, probably when I put you in your breakout rooms.
So, who's this talk for? And this workshop as well. So, what I often see happening, and I've built lots of GraphQL APIs in my time. I started with GraphQL in 2016 when it became a public library, and the first thing I always see when building GraphQL APIs, it's super easy to get started. If you want, you have a GraphQL API running with some things like Apollo or Prisma or any other GraphQL library out there, basically, within a couple of hours, you can attach your existing data sources, you can attach REST APIs, or GraphQL APIs, and it's super easy to build that first GraphQL API. But then once you start scaling things, I often find out, and I heard this all the time from different engineering teams as well, it's pretty hard to scale a GraphQL API if you don't have the whole knowledge about GraphQL, if you don't know how the graphs work, if you don't know how data is related to each other. So building a GraphQL API is probably easy, you build your schema, you build your first five resolvers. But after that, things get tricky because that's where you actually need the GraphQL in-depth knowledge, where you need to knowledge about databases, you need to knowledge about underlying systems. And so scalability for GraphQL APIs is always tricky. If you look on the internet, there's tons of benchmarks for existing GraphQL libraries, GraphQL server libraries, find out which one is the fastest. And those are basically up to the GraphQL engine of those systems. So how fast is their engine, how fast are they able to parse GraphQL query language, and how fast are they able to retrieve it from the underlying data sources. And so for a small GraphQL API, it's super easy. If it grows, it gets bigger, scalability really comes sneaking around the corner. So this talk we'll be talking about GraphQL servers, how to create them, and scalability. And then after this short talk of around 20 minutes, we'll start working, building some code.
So a little bit about myself. So my name is Roy, you can find me on Twitter with the handle at githackteam. If you're not on Twitter yet, it's super useful to share information with each other, especially in the tech world on Twitter. To me, at least, it taught me a lot using Twitter. There's a lot of bullshit on there, but there's also a lot of useful information. So if you don't have Twitter already, please create an account and start interacting with other tech people because it's super useful for you. I work with a company called StepZen and StepZen is the tool I'll be using today, and with this, you can create GraphQL API on top of existing data sources. You might also know me from my books, my other talks, about a year ago, I released a book, Full Stack GraphQL. So if after this talk you think StepZen is not the tool for me and you want to build a server completely, do it yourself from scratch and scale it to lots of users, then definitely ask me about the book later on today, because in there, you'll see how to build a server yourself explicitly from scratch, build all the results yourself, build the whole schema yourself, build middleware, build context, all these kinds of things, which can be quite complex. It's all explained in the book.
So if you're in this workshop, you probably also think why am I in this workshop? What I want to get out of this? Probably you want to build a GraphQL server. During this workshop, you want to know how you can take existing concepts, existing patterns and apply them your own project or maybe just interesting GraphQL, which is also perfectly fine. So there are a number of reasons to build a GraphQL server. Typically teams that start building GraphQL server have experience with other APIs such as REST or gRPC or SOAP, and they want to have a GraphQL server in order to optimize the client requests. So that's one of the most common use cases I see for GraphQL is people want to optimize the client request. So you have a client, maybe you have multiple clients, they have, they're of course sending network requests to your API, to your database, to whatever is exposing an API, and you want to optimize those requests because maybe there are lots of people using your clients, or maybe there are just lots of people sending requests, so you want to optimize these things. So GraphQL is perfectly fine for optimizing client requests. Another common use case is microservices, so imagine you maybe have 3, 4, 5, 6, maybe tens of microservices. They all have their own API, it can be REST, it can also be GraphQL, and you want to merge those things together into one data layer or API gateway. And that's something GraphQL is perfectly fine at. It's something StepZen can also do, there is a great, there's a great blog on our website about how you can do this with StepZen, how you can create a data layer or gateway for your microservices. This is something GraphQL is also useful for. And then of course you have legacy services, and this is not per se GraphQL specific, but it is something StepZen and other tools are doing very good, creating a layer around your existing legacy services so you don't have to worry about breaking things when changing things to a legacy service, because instead you'll be building a GraphQL API based on those legacy services, so you don't have to worry about changing the legacy code because you don't have to. Instead, you build a GraphQL API on top of it, which is fully performant and is helping you scale the existing legacy services, and then one by one migrate things out of there. So these are use cases. So it's either optimizing client requests, working with microservices or wrapping legacy services. So these are things GraphQL is perfectly good for. And If you want to build a GraphQL API, there are multiple ways to do so, and this is something I briefly touched in the introduction. There are multiple ways to create GraphQL servers. There are tons of libraries out there. You can build it from scratch yourself, maybe something like Prisma or Apollo or Fastify, or you can use something like StepZen in order to generate one for you based on top of your existing data services. And there are reasons to use all of these patterns. There are multiple ways to do so.
Comments