When Not To Use GatsbyJS?
Tags: react, gatsby, webdev
Published: 2020-02-04 10:43:04

<p>Over the past few weeks, we’ve been talking about <a href="https://blog.pagepro.co/2019/10/14/why-should-you-go-for-gatsbyjs/">how great Gatsby is</a> for <a href="https://pagepro.co/gatsby-development.html">creating new websites and apps</a>. </p>
<p>But…as with every framework, it does have its drawbacks, and there are times when Gatsby really isn’t the best solution. So, let’s take a look at when this could be the case.</p>
<h2><b>Do you have lots of content?</b></h2>
<img src="https://pagepro.co/blog/wp-content/uploads/2020/01/patrick-tomasso-Oaqk7qqNh_c-unsplash.jpg" alt="a lot of papers on a desk">
<p>If you’re constantly adding new content to your website (like few times per day) publishing updates can be kind of slow with Gatsby. </p>
<p>Take a large magazine-type blog, for example, it can take up to 15 minutes to generate your static website and put it on the live server.</p>
<p>Plus, you need to have advanced build machines that can build the page concurrently.</p>
<p>Why it’s like that? It’s a general problem for static generating websites. All pages should be generated when content has changed. This saves generation time for end-user (because page is already generated) but takes more time for website owners.</p>
<p>You can check more about it on <a href="https://www.gatsbyjs.org/blog/2019-06-12-performance-improvements-for-large-sites/" rel="nofollow">the official Gatsby blog</a>.</p>
<h2><b>Corporate size e-shops</b></h2>
<img src="https://pagepro.co/blog/wp-content/uploads/2020/01/freestocks-org-_3Q3tsJ01nc-unsplash-1024x683.jpg" alt="lady with many shopping bags">
<p>As I’ve already hinted in the previous paragraph, the more content you have, the larger the build time with Gatsby, which is when this solution could slow you down rather than speed you up.</p>
<p>Imagine you have a number of people who are responsible for adding new products to your company’s enterprise-sized e-shop, and they have to work on the site at the same time. </p>
<p>As the database is going to be pretty large, things can get complicated because you need to pay for a build machine that can cope with the high load, and that can be pricey. </p>
<p>This is why Gatsby is perfect for small/medium-sized businesses, but not quite so much for large enterprises.</p>
<p>We should also note that this won’t be the case forever, though. Gatsby announced they’re working on incremental builds. Exciting! </p>
<h2><b>Client-side web apps</b></h2>
<img src="https://pagepro.co/blog/wp-content/uploads/2020/01/balazs-ketyi-sScmok4Iq1o-unsplash.jpg" alt="a man is holding a cellphone showing app">
<p>While technically it is possible to use Gatsby to create a standard web app, this framework is mostly suited for static presentation sites, blogs, e-shops, etc. </p>
<p>If you want to create your own next big thing, maybe a new and improved version of something like Twitter, it’s possible but you really shouldn’t.</p>
<h2><b>CMS and hosting</b></h2>
<img src="https://pagepro.co/blog/wp-content/uploads/2020/01/austin-distel-744oGeqpxPQ-unsplash.jpg" alt="a man is typing on his laptop">
<p>With Gatsby, CMS and web hosting get a little complex - it’s unfortunately not as easy as signing up to GoDaddy and there’s your WordPress site hosted. </p>
<p>You can have both a self-hosted CMS using the likes of <a href="https://www.netlify.com/" rel="nofollow">Netlify </a>and a CMS that’s hosted elsewhere. </p>
<p>The bad part here is that updating Gatsby websites is usually handled by a service that makes sure that the page is rebuilt automatically when you send in the data. And you can’t host WordPress sites on hosting solutions like Netlify. </p>
<p>This is why you should only be using a self-hosted CMS for Gatsby sites like <a href="https://www.netlify.com/" rel="nofollow">Netlify </a>or <a href="https://www.contentful.com/" rel="nofollow">Contentful</a>.</p>
<h2><b>What can I use instead of Gatsby?</b></h2>
<img src="https://pagepro.co/blog/wp-content/uploads/2019/12/alternatives.png" alt="bargain with a lot of different hats">
<p>There are a number of different solutions you can use instead of Gatsby, and they start with the likes of a general Create React App. </p>
<p>What you can do is SSR parts of your app/site which will give you close to (if not all) of the benefits Gatsby has to offer. Then you’ve got Next.js.</p>
<p>Next.js is a framework for React that’s very similar to Gatsby, which allows you to make requests server-side and then render server-side which’ll help speed up your site/app and give you good SEO benefits, too. </p>
<p>Chances are if Gatsby isn’t really working out, Next.js is going to be the one.</p>
<p>I have already done some research in my article <a href="https://blog.pagepro.co/2019/12/09/is-gatsbyjs-the-best-framework-for-building-static-websites-what-are-the-other-alternatives/">“Is Gatsby The Best Framework For Building Static Websites? What Are The Other Alternatives?” </a></p>
<h2><b>Final thoughts</b></h2>
<p>I hope I’ve given you a brief insight into when Gatsby isn’t the best solution for you. </p>
<p>As you can probably tell, it’s not really a black and white kind of thing, so if you’d like to know more and talk about a concrete project, please get in touch. </p>