What is serverless #3 | Deploying applications globally | Prismic
Prismic
Channel
Interviewed Person
Guillermo Rauch
Description
Sadek and Guillermo are discussion how serverless allows to deploy application globally by having smart/application-aware CDNs More videos on what is serverless: https://www.youtube.com/playlist?list=PLUVZjQltoA3zXZ1ImqgO3ImQH4IFOYHcq --- As a developer, you should build websites using your favorite Jamstack framework. Prismic allows you to build website sections, that you can connect to a website builder for your client or team. They will create pages from there and you get that content back to your code through our fast API. ► [Tutorial] Build a full website with Next.js 13, Prismic, Tailwind and Typescript: https://youtu.be/nfZu56KsK_Q ► [Tutorial] Build a full website with Nuxt 3 and Prismic's new Page Builder: https://youtu.be/8GmfcbuYOWE ► [Starters] Try Slice Machine on Nuxt: https://prismic.club/nuxt-starters ► [Starters] Try Slice Machine on Next.js: https://prismic.club/nextjs-starters ► [Learn more about Slice Machine]: https://prismic.club/slice-machine --- ► Find us also on: Twitter: https://twitter.com/prismicio Instagram: https://www.instagram.com/prismicio LinkedIn: https://www.linkedin.com/company/prismic-io ► [Who are we?] : Prismic is a headless Website Builder, for Next.js and Nuxt.js developers. --- 00:00 Intro 00:19 Smart CDNs 02:08 Application-aware CDN provide hight reliability 03:07 Placing your functions near your data will cause latency problems 05:09 Prediction: As for code, database will ready for replicable, some kind of multi-master databases #Prismic #Serverless
Tags
Transcript
- We're still here at Prismic with Guillermo, and now, I want to talk about another topic of serverless: Deploying globally. Imagine I had a website or an application, I deployed it, and, you know, I have a global success, international. How does serverless adapt to that? - So there are two patterns here that I like to think about, so a CDN, which is the typical strategy
for caching your assets everywhere, works really well with static files and static assets, so when you use our platform for example like, we automatically cache all your static files in every edge of the world, but the question that comes up is like, what happens to dynamic data? Like not everything can be modeled as a static file. So what happens when you have to render HTML that composes a headless CMS for example, or you have to make queries to a database
on-demand as a user comes in. So, if you're using serverless, you can decide to deploy your functions everywhere in the world, so the CDN becomes a lot more smart. It can return static files immediately, close to where your customer is, it can invoke a function, and then it can cache the result of that function which is super interesting, because if you remember from our previous conversation,
when you invoke a serverless function you're basically handling an HTTP request. And that means you're responding with HTTP headers, and a body, or maybe an image content, so in the headers you can say Cache-Control, and cache your asset. - But just before even doing the caching, I like this metaphor about CDN and relating it to a CDN, because even imagine you don't have caching, even if you don't have it. You still can deploy that function and run it,
in anywhere around the world. Right? - Yes. Absolutely. - So if it's closer to the client anyway, even if you don't have caching. - Absolutely, and I think that the interesting thing here is, not only are you getting a scalability benefit, you're getting a reliability benefit, because the analogy that I like to use is, no one ever stresses or gets paged because their image is down at the CDN. So there's no mental conception
that your CDN could go offline. Or that one of your assets-- - Because it's a simple model, right? - Yeah, it's simple. - Because it's just a file. - It's simple, and the model itself ensures that there's no monitoring or observability necessary. We call this like health checks, you don't have to health check your process or your server to make sure it's up and running, everything loads on demand. So, basically serverless is making the CDN smart, is making it application-aware.
- Right, so basically what happens is that you have, you saved the function somewhere in a global storage, and then you, invoke it on demand, - So, so it gets a little tricky, - how does it work? - because one of the things that we have to remember is where your source of data is, so if you have your database in the east of the United States, say you have it in Virginia, and then you're trying to execute your function in China, you have to compensate for, you know, there's going to be a lot of round trips. - Between the, yeah. - Between China and the US, and if your code runs a lot of logic serially,
you may actually be at disadvantage. - If you separate them away. - (laughs) Exactly. So, what I always tell our users and our customers is, you have to think about, placing your functions near your data. And I think there's a new category of application that emerges as a result, which is kind of also in the same vibe of increasing regulation and data ownership and borders around data, is the idea that you can replicate your data,
Video Details
- Duration
- 7:13
- Published
- May 16, 2019
- Channel
- Prismic
- Language
- ENGLISH
- Views
- 1,255
- Likes
- 36
Related Videos

How to use Next.js with other frameworks and tools ft Tim Neutkens | Prismic
Prismic
Interviewed: Tim Neutkens

Next js 15 with Jimmy Lai and Tim Neutkens
Software Engineering Daily
Interviewed: Tim Neutkens

How to build APIs with Next.js? ft Tim Neutkens | Prismic
Prismic
Interviewed: Tim Neutkens

16. Pioneers. with Tim Neutkens Next.js lead and co-author
Catch the Tornado
Interviewed: Tim Neutkens