What Is Edge Computing?
We’re hearing a lot about “the edge” lately — but what does that mean? In this episode, Sunil Pai will teach us what it means to build modern web applications on the edge.
Links & Resources
Click to expand the full transcript
Captions provided by White Coat Captioning (https://whitecoatcaptioning.com/). Communication Access Realtime Translation (CART) is provided in order to facilitate communication accessibility and may not be a totally verbatim record of the proceedings.
JASON: Hello, everyone, and welcome to another episode of “Learn With Jason.” Today on the show, we’re bringing back one of my favorite thinkers about code, Sunil Pai. Sunil, how are you doing?
SUNIL: Doing fine, Jason, how are you doing?
JASON: What is this?
SUNIL: This is what the young kids yeah, let’s fucking go. I’m going from my couch, can I just go from couch. Just doing it from home. Yeah, this is my new thing, yeah, baby.
JASON: So, we got a lot of folks in the chat already. People are real talkative, which is really exciting. Hello, everyone. Thank you for joining us. Today’s episode is going to be a little bit different from the standard format, because to be completely honest, this is going to be more of like a discussion of the future of web dev rather than a strict demo. And I’m so excited about it. How often do we get a chance to just sit and really talk through what’s possible with the tech that’s coming through? And kind of what it’s going to unlock for us. But before we dive into that, for folks that aren’t familiar with your work, do you want to give us a little bit of a background?
SUNIL: Sure. My name is Sunil. I currently work as a tech lead for developer productivity on the workers team in CloudFlare. Some folks might know me, because I spent a year on the React team and flamed out. Previously to that, I did a bunch of CSS and JSS stuff. Open source things for a while. Oh, and people might know me from shit posting on Twitter, where I I think that’s mostly it. Folks know me from Twitter. Who the fuck is this guy?
JASON: That maybe is my favorite. Hello, I’m Sunil Pai. You may know me from shit posting on Twitter. I guess we’re going to have to put the explicit warning on this episode, but fuck it.
SUNIL: Exactly. Come on. We’re all adults here. And I’m not saying anything that their parents or their bosses don’t already say. It’s fine.
JASON: True enough, true enough. Okay. So, today I want to talk specifically about something that, you know, you’re at CloudFlare, I’m at Netlify. I think that our companies are kind of pushing forward a really big bet on the future of the Internet, which is this idea of edge compute. So, CloudFlare is in on this, Dino is another kind of avenue towards this, Netlify is building on top of Dino, Supabase is building on top of Dino. A lot of companies are realizing there might be something here, this might change things. And I’ll tell you what, when I started to get my head around what edge computing possibly unlocks, I haven’t been this excited about web development in a long time. So, maybe, what’s the elevator pitch? What is edge computing?
SUNIL: Okay, so, first thing, I guess, it’s an overloaded term. Some companies call it some things. Let’s talk about some of the common characteristics, right. The first thing is that servers are as close as possible to the users as they can physically be. Like, literally, physically they can be. And these providers of these servers are actually making deals with telecom networks and so on, so that they have incredibly low latency. But I think the common one is you have servers as close as possible to the users, and the way to do that is to blanket the planet with servers. As many deals as you can. Even if you start making an edge if you create make yourself an edge company today, you might start with tense cities, but the goal is not to be in 10,000 cities in the future, but to have a server behind your washing machine. Everyone should have one in your house. How physically close can you get to this, and start running code off it. I think that’s why they say edge, because it was like the edge of the network. That’s where the word edge came from, but what is the big one. Hey, what happens when we cover the planet with hardware and let people use it.
JASON: Yeah, so, that’s kind of like if we do a little bit of kind of historical, like evolutionary backtracking, so everybody buckle up, we’re going to do like what was that thing called, like the conjunction junction, what’s your function. Schoolhouse Rock. We’re going to do it on the history of delivering content over the Internet. So, back in the early, early days of the Internet, the only way that content would go on the Internet was if you had a physical computer in your house, and you would have that on and connect it to the Internet. Somebody would then enter the address of that computer, and you would be able to load a file from it. So, if you were on the other side of the planet, you were limited by the speed of light, speed of networks. Obviously, this was prohibitively difficult to enter, so we looked at hosting companies, all using GoDaddy, all these different companies. And they would run a room full of servers for you. But, again, this is usually one server in a building somewhere on the planet. Then we started seeing AWS, Google Cloud, Azure, IBM Cloud, all these companies started building multiple data centers, and we’ve got AWS U.S. East 1, U.S. East 2, European data centers, Australia, et cetera. Now you’ve got copies of the data, or you can choose to run your servers in different places. And then, at the same time, we started putting together CDNs, content delivery networks, where you could take assets, not necessarily code, but images, HTML documents, stuff like that. You could put those on lots and lots of different points of presence, pops, that there’s maybe dozens or hundreds or how many does CloudFlare have? Hundreds, right?
SUNIL: Upwards of 10,000 at some point. Shit ton.
JASON: Holy crap. 10,000 different places on the Internet. So, when you make a request to CloudFlare or something like that, your request is only going ten miles instead of 2,000 miles across the ocean. But the limitation of that, of course, these were for assets only. So, then we started looking at servers are a pain to maintain. Maybe we could do serverless functions, but they are limited to U.S. East 1, U.S. West 2, the big data centers. So, edge compute, edge functions, or CloudFlare Workers, are this idea of the edge computing layer. What if these CDN pods, these 10,000 locations around the world, could run a little bit of code? Now you have a server right next door, you don’t have to wait for these requests to happen. We’re seeing this move, CloudFlare is doing this, Netlify is doing this, Dino is doing this. Not just the host. CloudFlare will give you this distributed edge network, Netlify will give you this distributed edge network. But you still have to go back to U.S. East 1 for your database, so who cares. But now I don’t know, if you’re running Supabase, your request to Supabase and your request to the edge network are right next to each other. Everything is almost happening in your house, in your neighborhood at least. That’s incredible. Planet Scale now has portals, it’s distributed edge networks of read only to give you almost near instantaneous requests anywhere in the world. Sunil, how did I do, did I miss major points as I was trying to give that history?
JASON: Always, in businesses, you’ve got a majority of the companies, hey, let’s do the right thing. Everybody is like, yeah, we should. We don’t have time. What I love about competition is competition raises those needs to do the right thing. When the competition is built on this, on experience, on treating people right, that’s the type of capitalism I love, because it basically means, oh, all that tech debt about your API is awful to use, you got to fix that, or else you’re going to die as a company, because 15 other companies just shipped an amazing developer experience.
SUNIL: Right, exactly.
JASON: So, I love, as you said, it’s a really good forcing function for the way that companies make decisions when we move to this world where it’s not about proprietary locking, not about building an experience that only works on your platform. It’s about building an experience that’s so good that, yeah, I can ship whatever, next.js on CloudFlare, Netlify, whatever. But which one feels the best to use? And that’s kind of what else can I do when I want to get to this edge stuff, I want to do personalization. Am I using APIs that I like, if I want to add extra things, or I want to ship, I don’t know, maybe our marketing site is going to be in Astro or Quick, right. We’re all competing now on making developers’ lives easier, as opposed to, ha, ha, you’re stuck with us, because you paid for an enterprise contract, and you can’t go anywhere else.
SUNIL: That’s right. And we give you a certification, and that’s just it. When a company says you need a certification to use their technology cough AWS, that sucks. It’s a weird lock in, I wouldn’t call it a cult, but it’s weird you need a certification to do that. I want common code, I want to install libraries from npm I can use on these things. But there is a difference, right, companies do think to themselves, how can we differentiate. Netlify has a couple products what is
SUNIL: Beautiful, what a concept. Hey, we know you have all these integrations. Let us make that part simple for you, and it’s part of your experience with Netlify. CloudFlare goes this other way. Hey, we have this Sci fi thing called durable objects, what can you make with it? Holy shit, I don’t know, but it looks super exciting. Web socket y multiplayer stuff on that, which so, I think which is interesting to me also, because none of these ideas then are particularly proprietary in themselves, because, okay, fine, if somebody else wants to build it, they can build it. But it’s not a we got you to use one thing and now your entire application has to be on our stack.
JASON: Right. So, this is I don’t want to spend too much time on this, but I think both CloudFlare and Netlify, you talk about the jam stack as being an application architecture that makes a huge difference. And a lot of that is you have taken the web experience and made sure it’s not dictated by the business logic in your APIs, back ends, whatever it is. You’re just de coupling that UI experience from the APIs or microservices you’ve built, or third party systems that you rely on. That data and business logic is accessed through an API, which means you can ship the web experience anywhere. And that’s a huge productivity boon to companies, because then if they have some super proprietary back end that requires a lot of lock in, that could be potentially great for your back end, but it’s horrible for your users, because that back end is for the back end, not for delivering front end experiences. And, so, I think the de coupling that we’re getting out of this, this architectural shift, where we’re seeing companies move away from monolithic applications and to this idea of a de coupled web experience, means that, you know, we can, as front end teams, as web teams, we start looking at these experiences based on how do I get the best outcome for my use case. And we see this in research at Netlify. When we’re talking to developers, people don’t get locked into Netlify or CloudFlare. We almost always hear that developers have, oh, well, I deploy this site to Netlify, this to
JASON: We all have our strengths. Durable objects, I’m going to CloudFlare. Whatever it is, serverless functions experience, Netlify forms, we all have our strengths and weaknesses. So, to me, that’s really exciting, because, again, the incentive now is how do we make this feel better to use and be more useful, give people a faster onramp or better guidance or whatever it is, rather than how do I force all front end developers to put all of their websites on this, because if they don’t, it’s broken?
SUNIL: I fucking love that, by the way. And that’s also appealing to me as a user, because well, as a web developer, 9 out of 10 of your ideas are really just side projects that you spin up on the weekend. And any time you start okay, it’s Friday evening, Saturday morning. Friday evening I went out drinking. Saturday morning and I want to start up something. Is it easier for me to start well, what is the shortest path to getting the shit working? I appreciate boilerplates, framework boilerplates, but even those sometimes you have to learn the tech, how to do it right. That’s why remix is nice, because there is the whole standards thing, which is quite appealing.
JASON: That was the game. Yeah.
SUNIL: That’s it, you’re there. Then it became this whole thing, where, okay, fine, you got it working, now where are you going to deploy it? Shit, I need a credit card number, this, and that. And it started, and then React started feeling a little like you have to set up a whole thing before you get there, and that started feeling weird. But with the return of streaming APIs and the edge thing where people are building edge native frameworks, again, it’s starting to crunch where people can start focusing on this is the idea I want to execute. Another thing I was thinking of is the edge also works like you were mentioning, right, there’s a back end and API that might belong in a monolithic fashion, but you can bring other things here. Turns out there are ways to bridge that. This was such a good business idea. I don’t know if you know Max and Tim something called Graph CDN, and it’s a simplest idea executed so well. Hey, you have an API, which is expensive as hell to run. What we’ll do is we’ll you just install this one thing in your service and enable with Graph CDN, and we give you caching, replication across the world, and they are using Fastly, I think, which is another great service. And now your thing is 10x better as a service, instantly, you can do this in two hours. That’s a way without making code changes in your own code to suddenly reach the edge. I wish I’d come up with that idea. Such a good idea, shit.
JASON: And it’s interesting, too, because it really does point to, like, a lot of times the ideas that work are the simplest ideas. They are the things that it’s like nobody wants to go and set up a CDN, you know, nobody wants to go and wrangle a varnish cache. That’s not fun. That’s not a useful application of development hours. And to your point about boilerplate, no one wants to configure a domain name. No one wants to set up the domain routing so you have the proxies in place to have your API run from serverless functions, but under your main site’s domain. All that stuff should just disappear, and that’s the premise that on the Netlify side at least, that’s a premise we’re built on. You deploy your site code and a folder with serverless functions in it and edge functions in it, and we’ll wire those up under one domain name, so you can build. I want you to go from an empty folder, to building your idea, in five minutes. Looking at a running edge function in five minutes. From there you’re plugging ideas, instead of figuring out how to wire things together. So many of my side projects died on the vine, because I spent my entire weekend trying to get the stack right. Whatever.
SUNIL: I have a life. That’s it. Once you enter your 30s, you’re extremely conservative with how much time you spend on building a stack. I love that, by the way. Netlify’s folder of functions. Man, that’s just it. It’s an idea I fought against for years, but now I realize the tradeoffs are so worth it. Next.js does this, folder of React components
JASON: Routes, yeah.
SUNIL: You get routing for it. Netlify does this as functions. As a nerd, what if you want to do anything custom. No, fuck it. This is just superior way to do this thing. I don’t want to set up a router and wire up little slash, XYZ, bracket, slash ID. PHP, this is why PHP won. Everybody thought it sucked, but it still works. Shit.
JASON: Yeah, I think that’s actually one of the things that I love. And this is where I think remix got this really right, where they start with folder based routes, where you’ve got your app folder, throw a page in there, those are your routes, those will get rendered anyways. You can do the wild card routes if you want, or you can straight up pull in React router and do a full SPA as a subsection of your Remix app. If you do have a particularly aggressive thing that you want to build. I think that’s an interesting and powerful approach. You’re basically saying you’re inverting it, right. Instead of saying in order to do anything you have to know everything. By default, this is going to make your life easier. But you can go as far as you want. I’ve written about this before. I referred to it, what is it, the Nielsen Norman Group calls it progressive disclosure, so I wrote a post about progressive disclosure of complexity, talking about specifically this, right. Whoops, where is it? Progress disclosure of complexity.
SUNIL: I found it, yeah. >> But, you know, these are the kinds of concepts, where I want by default, if I take every shortcut, every default, I’m going to make something good, performant, good, easy to grow. As I hit the edges of the defaults, I can opt into more complexity. But that should be driven by business needs, not by, oh, yeah, you’ve got a pile of Webpack, Babel, and React, and now you’re bringing taste in, you’re setting up ES lint rules, Prettier config, and now every single project is functionality identical. You’re just putting React components on the Internet. But they are completely opaque to anybody who doesn’t work in that code base. And that’s not because anything functionally changes. Just because we spent four fucking weeks making this Webpack config so custom, and now nobody uses it but me.
SUNIL: What’s even more worse is it’s sinister, because it’s seductive. You feel like you’re doing real engineering. Oh, I installed the Webpack plug in, installed this, wired this. Tell me this, does the Netlify CLI work with an empty folder of functions? I suspect it would, right?
SUNIL: Does it tell you, hey, you have an empty folder, add a single file and it will start working?
JASON: We have a Netlify function create that will put hello world in for you.
SUNIL: That’s just so nice. Otherwise you’re thinking it’s nice to be able to run the CLI with no input. Then have the CLI tell you, oh, welcome to this, you can start doing things. That’s an idea I need to steal. So, edge compute. Back to edge compute.
JASON: Hold on, before we do that, I just realized we’re 30 minutes in. I want to do a quick shout. We have live captioning on this show. Let me switch over and actually show this to everyone. So, we have live captioning on the show. We’ve got Ashly with us today taking down all these words. Thank you so much, Ashly, for writing down our swears. And that is made possible through White Coat Captioning, and our sponsors, Netlify, Nx, and Backlight, all kicking in to make this show more accessible to more people. And we are talking to Sunil today, who is on Twitter, shit posting, as he said, as Three Point One, which is a joke that took me way too long to get.
SUNIL: Actually, it’s well, did they get it, did folks in chat get it?
JASON: Do you get it, chat, do you get it?
SUNIL: No? Come on, man! I have to do this
JASON: It’s because Sunil’s last name is Pai, and pi is 3. get it?
SUNIL: Sounded so clever years ago when I started using it, but if you ever have to spell out your email address on the phone, threepointone@Gmail.com, no numbers, no dots, it’s a fucking pain in the ass. I highly regret doing what I did.
JASON: This is the coaching I need in school. Don’t teach us about, I don’t know, all the silly stuff that we have to learn, like woodshop. Teach us how to pick a user name you can explain over the phone.
SUNIL: At least it’s not something like oh, God, no, I can’t be that shrewd either. It’s not something where I was in college and stoned, and something particularly rude that I have to use professionally after that.
JASON: Oh, my God. I definitely had a user name when I was 13 that just had 69 in it, you know, really ridiculous stuff like that. I had to burn down and restart my whole web presence when I was like 17 years old. I was like, oh, wait, I have to tell adults what this is.
SUNIL: Which is the tradeoff, by the way. But that’s the tradeoff that you’re explicit about, which are there are things potentially still happening on these servers that are very familiar and that you’re used to, and in the most common use case, you’re either adding power and functionality or you’re reducing your costs or maintenance costs on these servers. And if you’re not very clear about this tradeoff, people saying, oh, shit, you mean I do need to run AWS somewhere? That’s why Netlify’s model is nice, right, you actually provide both as a service. CloudFlare doesn’t right now. CloudFlare is like, yeah, you sort of have to bring your own. But also have you considered using Remix and hosting your whole app on this thing? And that is the tension right now, which is we’re actually in the middle of this transition phase of how far can we take it to the edge. That’s one of the things I like talking about. The other one is the state thing. Oh, man, the state thing, we could have a whole session just on that. Okay, so, the model that I have for edge/serverless/whatever is actually not that it’s 10,000 of servers on the planet. It’s that it’s actually the stretchy balloon like server on the planet. This is what I’ve been doing in meetings internally. Imagine a balloon stretched on earth, and you get to interact with the parts that are closest to you. The thing about data is that the cap theorem, cap phenomenon, cap theorem, is immutable. So, you’ll never have consistency, availability, and parturitionibility whatever, you’ll never have all three of them because of the speed of light. The idea is, either you have a central server somewhere, where if you write data to it, read data from it, you’ll always get the truth, but if it’s on the other side of the planet, you’re hosed, because it takes that long to talk to. Or you spread your data across the planet, which your write goes to one place, read to another place, and you’re reading all data. Then how do you have consensus? What happens when two people send rights to the same thing? Because they thought they had a lock on being able to write to it. So, who wins? How do you do consistency amongst these things? And this problem is completely exacerbated if you start spreading this is a general database problem, right.
SUNIL: The way a lot of people solve it, okay, fine, only one of the centers is where you send rights, and you’ll have re replicas across the planet. And that’s somehow we’ll make that work. Anyway, 99% of all applications are read heavy. Okay, fine, for the common use case, maybe that’s good. But there is this
JASON: Yeah, there’s definitely tension, and I suspect we’ll find new patterns that emerge. Because I think the thing that’s really interesting, too, is that you also generally have well, okay, things like Twitter notwithstanding, you generally have more readers than writers to a database.
SUNIL: Right, yes.
JASON: That could lead to you have a migrating write point based on who’s online, so that it’s faster for them, and people that are out of the typical timeline, they just go a little bit further. And I think the other thing, too, our expectations shift when we’re performing operations. I know that I, personally, I suspect a form submission to take longer than an URL load. There’s a little bit of built in leniency there. When talking about that tradeoff, you’re 100% right. I think that is a huge challenge for us. But the tradeoff is that, like, the reads and the writes are happening. So, when I start thinking about it like that, I think I’m okay with that. I think I’m okay with just faster reads. It’s a net positive for me. At least in every use case I’ve found. I’m not building social media, and I’m not doing massively multiplayer online gaming. So, I know I’m not hitting all the edge cases here, but for a document kind of thing, we’re updating a new dashboard together, something like that, it’s enough for me, I’m happy.
JASON: So, actually, I want to dig into that for a minute, because I’ve seen a couple things that feel like they are unlocking, or potentially net new capabilities as a result of edge compute. And, so, one example is I’m actually going to jump over and show this, because it’s easier to explain.
SUNIL: Oh, shit, does chrome DevTools now have a command chooser?
JASON: Command p does that now.
SUNIL: Oh, okay, that’s dope. Awesome, good, okay.
SUNIL: I think those are changed. Why is it showing the waterfall?
SUNIL: So, let me see if I understand this use case right, which is you have a node server or some server, which does some basically generates this list, but then you intercept it with an edge function and add all this dynamic shit. You’re using the edge, and it’s just so cheap. What would have otherwise been expensive and hard to integrate into this thing is now just a thing that the edge takes care of. Is that a way am I reading this right?
SUNIL: Beautiful, I love it. Really nice.
SUNIL: I had a 3310 in 2003. So, I don’t know. Sure they had flip phones. I don’t know if the Nokia had one. I don’t remember. What I also like about your code, of course, is at no point did you have to do all the other things that would have been associated with running a dynamic website, right, you didn’t have to provision any servers. You don’t have to look at server health. You didn’t have to write server.listen and so on and so forth. It’s very much a, hey, I assume you wrote a function that returns a response object. That took in one response object and started rewriting it and returned it back out.
JASON: Yeah. Here’s the whole config. I did a rewrite, so that my functions were at an API like URL. And then I did this I said the edge functions on the home page. That’s it. That’s the whole config. All the proxies, all the coordination, all the DNS, it just works. I don’t have to care or know about it. I just know it’s happening. And to me, that feels like, you know, this is what we’re talking about when we’re talking about companies competing on experience. Shit like this makes me want to build complicated things. Because I don’t have to figure out how to configure route 53 and the API gateway and AWS lambda, you know, whatever other CloudFront, S3, I don’t have to connect that shit together and figure out how it works. Okay, I have a folder full of logic, here’s my whole app, edge functions and functions, ship it. All right, I’m done. Right? I had an idea, shipped this, I think I spent maybe two hours on this.
SUNIL: So, there must be a metric that we can pull out of this. I know Supabase I just learned recently, one of their success metrics internally is what they call time to first query. As soon as a user signs up, how short is the time how long is the time from them signing up and making the first query. And a success metric is making it as small as possible. That’s just such a beautiful number I was thinking to myself. That’s a thing that means that the experience of using Supabase is simple, hopefully. So, what then is the success metric for a framework like this? So, what is your time to I want to say first render, but that doesn’t make sense, because you could cheat with a boilerplate. Really, I guess the question is, and I hate this phrase, because it sounds like it’s capitalism shitting all over it, which is your time to business logic. How long did it take you before you started writing the code that mattered and not the code that otherwise was needed?
SUNIL: That’s not a very good phrase, but you get what I’m saying. That’s the kind of thing stuff like this enables, which is in your scenario, for example, it literally was, hey, I had to make a project, and make that I assume you didn’t need that when you started up, and started using HTML Rewriter. Well, you had to know the API for that. I think that’s another thing sorry, go.
SUNIL: The big one, of course, is lambdas right now are heavy as shit. It’s using a run time, which is node, that was not designed for this use case. So, either last I checked, feel free to correct me, I think lambda’s startup time was 150 to 200 milliseconds when you make what we call a cold start. I think Amazon literally sells you a service called Concurrency that helps you keep them warm, so that they are effectively zero. But if you look at the new breed of run time, CloudFlare Workers, Bun hi, Jared, that guy is such a beast, Fastly, they literally run a js run time it’s kind of crazy, I love it. But those things are built for this use case, in which case the start up time is under 10 milliseconds, and in most cases it’s zero. They do a hack, while you’re starting to make the handshake, they already start warming up it, so it’s ready by the time the request comes. It’s cheap to run. It’s really quick to start up, which means you can use it as a this is a big deal. Imagine if I told you that every function that called 200 milliseconds to run, before it even started running. That wouldn’t be a good compute primitive. You’d always be thinking how can I badge this shit, et cetera. No, with these new run times, you can conceptually think of it as an architecture diagram with pipes with your code. You can tell yourself, this part I’m going to run on Netlify. And you will not fuck it, multi provider, these functions run on CloudFlare, and because the hardware is so close and the run time has been designed for this use case, it’s almost like it’s running locally, they are all running together. That’s the big deal here. They’ve been designed from scratch for this use case.
JASON: This is what I think that if you and I are right about this, the logical conclusion of how edge compute works is exactly what you said, where we’re literally able to ship little logical containers to every router in the world, because, honestly, that’s how things are going to work. You’ll just kind of slowly get these warm connections to services that you go to, and they’ll be smart enough, hey, I hit this website a lot. Let me pull all of their CDN stuff right into my router, so it just executes here. Boom, done.
JASON: And there’s so many interesting outgrowths of that. What does it mean, and if we start looking at this idea of decentralization, crypto notwithstanding, but just this idea of you can kind of do data ownership in this sort of way, where it’s distributed across the world. That doesn’t mean that you have to have a server in your house. I think this is kind of where that conversation breaks down for me. Own your data. Okay, well, what does owning your data means? Means you have to have a physical device your data is on. I’m never going to do that. Cool, this conversation is dead to me. But if I’m able to use services that duplicate the data, so I am the de facto owner of it in the sense of I’ve got all the copies and if one service goes down, who cares, it’s there. That’s distributed globally in a way that is really close to users. Now I’m kind of interested in this idea. Okay, let’s see how we can do this, get lower redundancy, figure out how to get data close to users and make sure it’s not centralized to one server cluster in one region. It really does kind of get my gears turning about how many things we can do.
SUNIL: That is the only value it takes now. You can expand to multiple countries. India, whoever, and we’ll expand that. But this data ownership thing, let’s say I can buy a stupid rack from CloudFlare and like I was mentioning, I’ll put it right behind my washing machine. Now jurisdiction is the ID of this server, boom. I kind of have data ownership locally on hardware that I own, and I can now write a little work around on top of it that lets you access it if you pass some odd and some values.
JASON: More practically, if we think about a lot of bigger companies, they are doing this stuff with local VPNs and firewalls. I want the jurisdiction to be my VPN.
SUNIL: On prem, this is your answer for on prem.
JASON: Yeah. I watched IBM tie itself into logical knots to explain the concept of hybrid cloud, where it was like half on prem, half on cloud, so they can convince companies they did in fact own all of their data. It ended up being a lot of stuff like that. It was really complicated firewall rules, VPN access control, blah, blah, blah. And this idea, again, if what companies are competing on is the experience of setting this stuff up, if I get to say my jurisdiction is my company, and, you know, EU gives me GDPR rules, my company gives me VPN firewall lockdown, and the only config I had to do is tell the company I’m an enterprise customer and these are, whatever, the IP ranges or something. Done, great. I will hand you my credit card gleefully. I will underhand shovel buckets of money at you if it means I never have to open up a next config myself.
SUNIL: That’s exactly right. In fact, is this that’s right, is this actually the run of late ’90s, 2000s web engineering, where you’ll have a box underneath your desk, so when demoing to your CEO, connecting directly to the machine, and you click one button and suddenly it deploys to the rest of the world.
SUNIL: I think that’s what we should do. Implement FTP on workers. That’s a product idea I should take back.
JASON: Yeah, you build that, because I want nothing to do with building it. But, no, this is what I find so exciting about this space. We’ve been talking about this for barely an hour, and the ideas just pour out, right. And I imagine chat, what about you? I imagine there’s unlimited use cases. What’s happening in your brains? What do you want to know about this? We have 30 minutes, you have Sunil Pai unlocked, he’s paying attention. What do you want to know? What are the things you’re curious about or excited about? What do you see being possible with this edge based world that kind of unlocks new innovation? And while we’re waiting for the chat to think, as we were doing like the ten minutes of prep before we went live, you said something that was so funny, but I was in the middle of explaining something else, so I didn’t get a chance to properly react to it. Where you were talking about the tradeoffs of, like, the server being you were talking about servers and sizes. So, I wanted to make sure we get a chance to talk about this, because it just made me happy.
SUNIL: That’s just it. It’s actually a pretty important architecture discussion to have. Which is, would you rather fight one horse sized server or 1,000 duck sized CPUs. That’s the architecture decision for edge compute.
JASON: And I love this so much, because it really does start to it changes the way that you think about things, because you might think, oh, well, I definitely don’t want 1,000 distributed CPUs, because that sounds like a nightmare to wrangle. But then I’m thinking, hold on, I remember I used to have the horse sized server, and the major problem that I had with the horse sized server was that I was always trying to find ways to get caches and distributing that to 1,000 duck sized CPUs.
JASON: So, a lot of my problems actually stemmed from okay, I have a server, this server does all the things in one place, and I love that, but if more than ten people at a time try to access it, the whole thing explodes and catches fire.
SUNIL: Pretty much, exactly.
JASON: How do I distribute this logic in a way that allows an unlimited number of people to access it at the same time without our whole website going down. It’s like, oh, well, we make new instances of the server. Oh, microservices. You know what I mean? You start naturally driving towards this idea of lots of distributed compute power.
SUNIL: This was a phenomenon go on, sorry, sorry, sorry.
JASON: The old model, we need to make copies of the big server and put that in a lot of places, but we’re basically saying, okay, you can have that benefit by doing lots and lots of CPU around the world, but the server itself doesn’t even need to exist. You can put little bits of logic instead of a big monolithic core buddy that does all the things in one place.
SUNIL: So, this was a phenomenon in the 2000s that used to be called getting slash dotted. And it was very interesting phenomenon, because slash dot what is the website? Just slash dot, anyways, which is another thing impossible to say on the phone. I think that’s why they chose the name. The idea is as a hacker you would build something interesting, and somebody would share it on slash dot, and you would get a shit ton of traffic and that would bring down your server. The similar thing happens nowadays if you get on to Hacker News or Reddit and don’t have good caching set up. The phenomenon was particularly interesting to me, because it meant the people who would suffer the most were the people who were most clever. The hacker mentality. Slash dot would bring a whole flood of traffic only if you were really good. Which sucked I think that was when part of the mythos of being able to scale among engineers. What happens if you get popular and things come your way? What happens what happens when you get 10,000 people who attend your sale? That’s also part of the that became part of the interview process. How do you do vertical scaling, when really that was a phenomenon of an architecture that couldn’t stand that kind of traffic. But now in the edge world, I don’t give a shit, bro. Take care of it. Why do I care?
JASON: I think about that a lot. I remember when I was younger, earlier in my career, standing up somebody’s site getting ready for Black Friday or something. We knew, a bunch of ads, a promo, everybody wants this 50% off deal. We’re expecting hundreds of thousands of concurrent viewers. So, I’m standing up simulation software that’s going to ramp up the number of concurrent connections. And now if I were to try to do that with my personal site, I’ve spent zero seconds thinking about how to scale, I would run out of memory on the simulation software before my site would go down. The architecture is so different now, the scale is not even a consideration.
SUNIL: Yep, exactly. So weird, because, sure, you might face this at an edge edge case thing, which is let’s say that I don’t know, man, John Lennon comes back to life and has a one night only concert in London, sure. That database is going to take a pounding, but even then you’ll do a Dependently thing and stop it after a while. Having to scale a server used to be such a fundamental part of degree a network developer, and now it’s like two days before you go live, have we set up our caches with our provider? Yeah, okay, cool, done. Tick item. I love it when technology gets commoditized like this. The young smart hackers can build things and servers won’t go down when they are popular. Okay, I have an idea to pitch to you. This is service as a platform. This is something fundamentally new that edge providers can provide us. So, internally, at CloudFlare we call it workers for platforms. I don’t think there’s anything fundamental about this, I suspect every provider will provide some version of this. Okay. So, there are a number of use cases of companies, organizations, products, that get a lot better if their users are able to upload code and these people can run it. So, the two big ones that come to mind are Shopify lets you upload code to make a shop. In fact, they just announced this thing two days ago. You can write React components for your shop, upload it, and Shopify runs it for you. Components for e commerce. I assume a checkout button, product perusers, stuff like that. The fact is, Shopify can run the code. Similarly, I don’t know if you know of course, I suppose you do know this, Discord doesn’t have a bot platform, because they don’t want to spend engineering time and ops and also expensive maintaining a shit ton of servers where potentially the worst kind of users are uploading crypto miners. That’s why they don’t have their own bot platform, which is why you use somebody else’s platform. First thing you do. So, that’s another use case. There are others that I can think of. So, for example, component AI is the one I think of. Right now, you can store HTML and CSS, but it sure would be nice to run MDX directly. What if your document that you store to your database was MDX, and that’s the thing. If you want to use MDX by the way, for folks that don’t know, MDX is like JS but looks like Markdown. If you want to do MDX for your blog right now, you have to own all the code, store it all in your git repo, and store your blog in the git repo. But if you want to use a service like Contentful or Sanity, I guess, I don’t know what other ones are out there. What are these services that you can only store JSON or data or strings. Can’t really store code there. But what if you could upload code to them, so every time you make a request, you get a response object. The use case I think of is a product company that shuts down between 10:00 p.m. and 6:00 a.m., so that and based on where you’re coming from, because it wants you to get eight hours of sleep. Sorry, we’re not selling you stuff right now, go back to sleep.
JASON: A very real example of this is BH Photo and Video is like an AV equipment store. They will not sell you anything on Shabbat. That’s a super real world example.
SUNIL: This is one I will build at. Auth0 is a multi gazillion company. If I had to build a competitor to it, what if the API, okay, I’ll do authentication for you. You can choose Google, Facebook, GitHub, whatever. But you take a user function as input and returns true or false. That’s it. That’s my whole fucking thing. You can make a call out to your active directory or hard code four user names, which are the people in your company as you’re starting your startup. This is a fundamentally new architecture. Hope you don’t mind I do a brain dump on you.
JASON: This is literally what I wanted. This is exactly what I wanted.
SUNIL: So, something called a Hollywood principle when it comes to computer science. That’s the way they tell you the difference between a library and a framework. In Hollywood, when starting out as a store, they say don’t call us, we’ll call you. React is a framework, because you provided your components, and it runs it whenever. It decides how to do the scheduling and when effects fire and so on. Something like Underscore is a library, because you take the function, and you call it. You actually call it. Pass it data and it does stuff.
JASON: That’s a good heuristic.
SUNIL: But the problem is it’s not complete. You do call a function when you use React. Secondly, when you do underscore.map, you do pass the call it calls. Okay. So, it’s a good thing, but still never perfect. There are clearly exceptions to this. All libraries take callbacks. Anyways, the reason I brought this up is the difference between libraries and frameworks is the same difference between services and platforms. So, platform is something like where you upload your code, Netlify, whatever, you upload your code and it runs it in response to the request responses. Should I say something like a database service, where you actually say, hey, give me this data right now and it gives it back to you. Now, what if for services you pass callbacks that it runs internally? As a user. If auth could provide you something. The reason I said all those use cases, the reason I started with Shopify and Discord, until now, about 2022, this has been the domain only of big companies with money to spend on setting this up and ops teams and figuring out how to run it efficiently.
JASON: If you think about just the spend on the team and baseline infrastructure, you need to have probably a million, minimum half a million ready to spend every year.
JASON: What I love about this, I’m picturing you in the executive pitch meeting, you’re in there, just to pull some quotes from our conversation. Will, all right, all right, everybody gather around. What do developers love? They fucking love features. Four API calls, bro! I could see you
SUNIL: That’s pretty much it. What I like about this, because it’s for API calls, it now means you and I for our side project on a Saturday morning, evening, can set up a platform. You know what, the use case, the one I’ve been thinking of recently is Natto.dev. Have a look. This is basically a live coding environment, one of those visual programming editors. You can make little blogs and connect them. See, you can connect them, there are variables. There are a number of like this, but it also runs client side. This is a project by a smart dude name Paul Shem. I assume he can’t be asked to set up a platform for other people to run code on his servers, but I am saying, you know what, you want to talk to CloudFlare, bro, we’ll run your shit serverside, it’s fine. You can do anything, you can have secrets there, that will just run, and then expand to other people to run as a function. You want to store sorry, go.
JASON: Anybody building a developer focused tool would have a moment where it would be really cool if our users could customize this with code. They are all developers. Let them customize it with code, and then you immediately say, no way. Setting up a sandbox environment is way out of our reach, so you walk away from that feature set. To me, that’s yeah, I’m excited. You have my attention.
SUNIL: As a startup, one of the big things is do fucking sales, and go up to sales, the client is like I wish it did this. Then you have to think to yourself how can you roll out this feature for one client but as part of your whole product offering. No, say the client is XYZ. Make a file called XYZ.js, run it to this platform, only for this user, done, that’s it, fucking done. This is what I mean, what are the patterns that the edge can enable? Sure, performance thing we were talking about, developer experience, and those are all incredibly valuable today. But what are the new novel architectures that we can enable for the builders of tomorrow? You know what, you want to set up your own you want to set up a cell for your friends, let’s say, for each of your Twitter followers. Some 65,000, something
JASON: 40 something like that.
SUNIL: I was counting in dollars. Anyways, you want to say, hey, I want to do a thing, but if you’re a follower of Jason Lengstorf, you get some 10mb of hosting and you can run whatever in edge function, et cetera. Also for 12 of your closest friends, you want to have some specific feature. Hell, or you want to customize these things. These are conversations that don’t end now with a, fuck, that sounds like a lot of work, I’ll do it in the future. You know what I mean?
JASON: Every idea, I’m not kidding, every idea that I have these days, especially now given my job is mostly meetings, I get an idea, I get really excited, then I look at an architecture diagram and draw the second box and go this is too fucking hard. I can’t do this.
SUNIL: I don’t want to do this anymore. This looks like too much work. Now we’re saying something that has been that has been the only big companies with a lot of money and time and effort can spend on suddenly has become commoditized. The word I use, I use service as a platform, where every service becomes a platform. CloudFlare calls it workers for platforms. Internally it was function as a service as a service. We used to say FSaaS in meetings, and it would derail the entire meeting when we say this. Sometimes I think of platform development. Point being that you now not only can you use the edge for compute, but you can now create curated experience for other hackers and builders very simply. Sure, those have their own tradeoffs. Not all your users are going to be programmers. Sure, you can offer it as an additional thing. You can click these options to set it up, or if you have something custom, here’s a text area for you to write a function. You want to use npm modules, go for it, whatever features you want. That’s the thing I’ve been thinking about for the last month, two months. Holy shit, this is way different than any builders. It’s a kind of tool that builders haven’t had access to cheaply for a while. And that’s what that’s my pitch to you.
JASON: If you think about the other thing that’s interesting about this, it’s not just cheaply. It’s free to start.
JASON: You can build this whole thing, and you don’t have to put a credit card in, and just see if people use it. If you scale, if you get adoption, you’ll have to pay, but the experimentation phase is 100% no credit card required, and that to me is a legit game changer. I actually saw a comment I love. I describe myself as front of the front end, and when I tell you edge has made me dangerous, right. The thing I find exciting, the whole reason I joined Netlify, get excited about edge functions, excited about serverless functions, is you have this ability to be a developer who would call yourself front of the front end. And the skill sets that you have, things you already know, make you a full stack dev, because the learning curve is flattened so much. And that’s the thing that I find the most exciting. If Stephanie’s feeling I’m front of the front end, but this edge function stuff feels approachable to me. I’m feeling like I came in front of the front end, was a designer before I was a developer. I feel I can reach into these edge functions or serverless functions and build cool stuff. I get how the fetch API works, I know how to make a call to a third party service, that makes sense, I know what a request looks like. The world really feels flat when you start looking at these technologies. And now it’s kind of limited by your imagination, not limited by your willingness to wade through all the boilerplate and config and connection and plumbing. Or your willingness to put down a credit card and say, hey, do I care about this side project enough to spend $9 a month on it to have a digital ocean server, whatever, a Render.com instance running, so I can build and hack on it. No, it’s free, it’s accessible, it’s super approachable for developers who have a front end skill set, and we can just, you know, we’re dangerous. I love that.
SUNIL: You used to have to be a Linux nerd to run a website. Don’t get me wrong, I like Linux, by the way, but holy shit, that’s the first thing that people would fail at. What do you mean I need to install an operating system to host a website? Go fuck yourself, right. Sorry.
JASON: How much damage did we do in that? I remember because I wasn’t a Linux nerd, I didn’t understand the implications of shared hosting, for example. I’m on GoDaddy shared hosting, $5 a month. Probably fine. I had my first few clients, shared hosting, big issue on shared hosting is wasted space. Oh, okay, I’ll go copy/paste this clean up script to get rid of unused images, and I whacked down a root, nuked the whole fucking server. Of course, I wasn’t paying for the backups. I’m just I’m a year into my career at this point. And I had to build three people a new website, because I nuked everything. Lost all their data. Fortunately, wasn’t very much data, but what a nightmare for me, what a nightmare for my clients, because I got thrown in way over my head managing a Linux server instead of just building the front end, which is the thing I understood.
JASON: So, the last time that you were on the show, I’m going to pull that up actually, because it was a great episode. We talked about build, and I’ll put it in the chat for anybody that wants to watch it. In this thing, you’re talking about it feels humdrum. Edge functions are a boring bet, but what I find exciting about boring bets is it’s a guaranteed win. This isn’t the thing where most of us do, where we get three years into our code base, tech debt is building up, getting frustrated, getting bored. You know what would be easier, let’s burn it down and build in a new framework. You know, and we’ve seen people do this. We all went from angular, to React, then we went from React to Next, and now from Next to Remix. All of those decisions are decisions that come with benefits, but the really sticky messy part typically doesn’t change with your front end framework. You end up with all of these, okay, we’ve got somebody who’s in India on a feature phone, they are not going to have a great time loading a Remix site. They are currently having a terrible site loading a site from U.S. East 1. How do we improve that materially? Edge compute. Framework doesn’t matter at that point. This is the thing that I think is really, really, really exciting. Yeah, Nikki is remembering the silver bullets only work on werewolf shaped problems. I read that quote from you, stuck in my head ever since, I use it all the time. But it’s just very, very interesting to me to when you see something that’s such an obvious win. At least for a broad swath of use cases. Again, not a silver bullet, but there are a lot of things we’re looking at that we’ve been hacking around this either because we weren’t quite ready to go serverless, didn’t like cold starts, or dealing with serverless cold starts because we didn’t want to deal with servers. Now we get to say I’d like to have the cake and eat it, too.
SUNIL: Yeah, yeah. It’s fine if I can’t connect to a database directly from one of these functions. I’ll figure that out later.
JASON: We’re getting there, right. These sorts of things are in the meantime you can do what I did, which is I have a serverless function that caches the first call, because the data doesn’t change more than every hour or so. So, I just do that. I just use this cached thing and it’s basically like loading a JSON file from the edge. Cool, great. Fast enough, I’m happy. I don’t really care if the TTL is an hour or day, whatever. Would I build a stock picker off of it? No. Would I show the latest stats from my analytics? Yeah, I don’t care if they are an hour out of date.
SUNIL: Can I tell you something meta, just reminiscing on something?
SUNIL: Steph’s quote on being dangerous also and the whole thing on edge functions and this thing. I might have discussed this on your last time I was on, which is I did very badly in college. I actually did really well to get into a very good college, and then I discovered weed, serious girlfriend, got into the college band. I did everything fucking wrong. I did really badly in college. There was a lot of fun, trust me. Anyway, that’s a conversation that can’t happen
JASON: That’s the after hours, yeah. Learn With Jason After Hours.
JASON: Oh, nice.
JASON: You can do more with less, and that’s the core thing. And I’m going to make that the moral of the story, because, unfortunately, we ran out of time. I was thinking that we might be, oh, I don’t know, 60 minutes, maybe we could be out of stuff to talk about, I could go another two hours. Sunil, thank you so, so much for taking the time hanging out with us. I’m going to give a shout out to Ashly from White Coat Captioning doing the live captioning all day today. Thank you so much for being here with us. I’m also going to drop another link to Sunil’s Twitter, make sure you go and follow Three Point One on Twitter. And I dropped a link to the schedule in the chat, as well. Make sure that you go and check out the schedule. We have so many good episodes coming up, including a couple that are relevant to what we talked about today, such as Auth0. I’m going to be talking about their new actions interface, which allows you to execute arbitrary code dealing with Auth0. Cool stuff like that. Make sure you check the schedule out. Sunil, any parting words for everybody before we wrap this thing up?
JASON: I love it. Sunil, thank you so much, as always, absolute pleasure talking with you today.
SUNIL: Likewise, thank you so much for having me.
JASON: We’re going to have somebody to raid. Looks like Ben is live, we’re going to raid Ben. Thank you all for hanging out. We’ll see you all very soon.
Closed captioning and more are made possible by our sponsors: