Anyway, that's that about building this way. If you feel like these people who are dancing here, that's exactly how I felt when we finished the JAMstack Explorer platform with my team, we built it all on the JAMstack, we did a lot of dynamic things, but at the end of the day, we had fun and we didn't really do so much of the things that makes us uncomfortable as developers.
All right, but like I said, every new solution introduces its own trade-offs. So there's a little bit of a trade-off here, which is that if you build this way, when your site gets large, as you can imagine since the build process kind of generates all those pages for you ahead of time, it means that if you have so many pages in your application, if you have 10,000, 100,000 pages, all of those pages are going to get generated at build time, which means you get to spend a little bit longer waiting for your sites to build as opposed to just deploying it as it is.
And to make that a little bit clearer, imagine that you have a site like this that has a thousand products. Once your build process kicks off, all of those products, all of those products are going to get generated. This is before your site is deployed before it goes live. So the build process takes like, let's watch this 100, 200, 300, 400. It goes all, all the way to 8,000 products gets generated, and then if you have more, if you have like 50,000, for instance, you're going to have to wait for all of that time to expire before your, before all your product pages are generated and deployed.
So take, for instance, that I have a site called my site.com. In that site, I have 1,500 product pages, blog pages, and press releases. Now, what happens is I have a total of 4,000 pages, right? So if I want to deploy this site, my build process is going to kick in and pregenerate all of these pages. And let's just say that hypothetically, this is not ideal in any way, but let's just say for the purposes of this presentation, that it takes our static site generator one second to build one page. Like I said, this is not the reality, but let's work with that. So assuming it takes one second to build one means it's going to take me 4,000 seconds to deploy the sites, to build the site before I deploy it. And that is like an hour plus, right? So imagine building your site, getting ready, finishing, putting out the finishing touches and just want to deploy your site and you have to sit there and wait for its build for one hour. That is not good. Nobody wants that. And that's not even all, right? Like if you want to update the site, you go through the same exact process. In this case, imagine that you want to add one more product page to your existing site, which you have built and deployed. What happens is your product is going to get one more product page, right? So instead of having 1,500, you have 1,501, which gives you 4,001 pages. And what happens is because it's a Jamstack site, the build process is going to start again. And when that happens, it's going to rebuild the entire site all over again. So that's another one hour plus that you have to wait for your site to build, just because you updated one product page. That is not ideal. I don't want that. I'm sure you don't as well, which brings us to the solutions. So while all this is going on, everyone in the community realized that this is a bottleneck that needed to be fixed. So that's one good thing about the Jamstack community, everyone rallies around to find solutions to problems like this that affects everyone. So the first solution is incremental build.
Comments