DEV Community

Cover image for Gatsby Development 101
Max Ikäheimo
Max Ikäheimo

Posted on • Originally published at ikius.com

Gatsby Development 101

Gatsby.js is one of the most popular JavaScript frameworks. It offers many advantages for business, such as its powerful plugin system, the ability to use React, and built-in performance and image optimization. 

Gatsby doubles as a static site generator empowering you to create a website from scratch using HTML, CSS, and JavaScript. It's open source and free to use, and it has a massive community of developers who contribute to the project. 

It empowers companies to build blazing-fast websites, progressive web apps, and single page applications by giving them the toolbox and blueprints needed to build fully customizable digital experiences.

This post covers

Interested in giving Gatsby a try? Keep reading.

What is Gatsby.js?

Gatsby.js is a static site generator developed by Max Stoiber and Kyle Mathews in React. A static website is an excellent alternative to traditional web development frameworks like PHP or Ruby on Rails because they can be hosted anywhere without needing a server-side application.

Gatsby takes this one step further by pre-rendering your pages so they are as close to static as possible, resulting in impressive performance improvements.

Gatsby Features

Now that we've taken a long look at Gatsby let's dive deeper into its features. 

Code-splitting 

Code-splitting is a software development technique that builds the application in different independent chunks that can be loaded on demand. As a result, your applications load only what’s necessary each time, helping your websites achieve faster time-to-interactive.

Smart preloading

This type of preloading predicts and prefetches content and assets in advance with an accuracy of over 90%, speeding up next-page navigation on average 900ms, improving your SEO and Core Vitals Score.

GraphQL support 

GraphQL is a language that uses a special syntax to describe the data you want in your component. Then, that data is made available through a headless CMS in the browser when needed.

Solid plugin ecosystem 

Similar to WordPress, Gatsby has a plugin layer that extends its functionalities. You have four plugins to choose from: source plugins, progressive images, analytics, CSS libraries, and other website functionalities like SEO, offline support, and RSS feeds. 

Open source 

As an open source product, Gatsby has a solid collection of hooks and functionalities that allows a Gatsby developer to customize it and the digital experiences you create as much as you need.

CDN-ready 

Gatsby leverages an array of servers worldwide that ensure that no matter where your visitor comes from, they will always access a copy of your website closer to them. 

Why choose Gatsby in your projects?

Along with Gatsby enhancing your website’s speed, SEO, and more, additional benefits are depending on your specific project. Let’s look at these. 

Technical benefits of Gatsby

Jamstack-ready

What if we could take the reliability and robustness of a traditional web server infrastructure and combine it with the ease of use and developer-friendly nature of a platform like WordPress? Well, Gatsby can. Built on top of modern technologies and 100% ready for Jamstack, Gatsby offers an attractive alternative to traditional web hosting setups. 

Image optimization

Serving optimized images is challenging, especially if you have to serve them to multiple devices and channels. Gatsby makes it easy to do it using plugins like the gatsby-plugin-image component that fetches images using GraphQL and transforms them using Sharp, a high-performance image processing library. 

Works with a headless CMS

Gatsby integrates seamlessly with most headless CMSs in the market, enabling you to reap the benefits of a modern tech stack and build your frontend on a robust headless backend. 

Gatsby Cloud

Gatsby Cloud is a cloud platform specifically built for building, previewing, and deploying Gatsby websites. With Cloud, your site is built and deployed in real-time on a global Edge network that provides millisecond load times for site visitors worldwide.

Modern workflow 

Gatsby js follows the latest web standards and technologies. This includes a React-based architecture, GraphQL, and Webpack. For Gatsby developers already proficient in React, moving to Gatsby should be seamless. 

Business benefits of Gatsby

Internationalization

Internationalization or i18n is the practice of adapting your content to the language and culture of your target audience. Gatsby leverages React’s internationalization packages react-intl and i18next, and it also uses gatsby-plugin-i18n to help you create localized content faster. 

Search features

A website without search features isn’t very accessible. Luckily, a few ways to add search capabilities to a Gatsby site exist. For instance, you could use Gatsby’s native js-search library or use an external, API-based search engine like Algolia and ElasticSearch.

Robust authentication

User authentication adds another layer of security to your website or app. If you need to create gated content restricted to authenticated users with Gatsby, using the plugin gatsby-auth is possible. 

SEO-friendly

Gatsby can also help you with your website SEO.  It makes it easier for search engine crawlers to crawl and index your site. Plus, Gatsby has other advantages to SEO. This includes helping your site rank and perform better in search engines. Using Gatsby makes your site fast and efficient for search engine crawlers, like Googlebot, to crawl your site and index your pages. Some advantages, like speed, come out of the box, while others require configuration.

Gatsby.js pros and cons

Pros

Cons

SEO-friendly

Needs constant content updates

Future-proof

Potentially slow build times

Low hosting costs

 

Secure against cyberattacks

 

Allows for omnichannel marketing

 

What to build with Gatsby?

Gatsby turns your text into beautiful, interactive sites that are easy on the eyes and quick to load. You can take any content and publish them onto one of many customizable templates in seconds. All without ever having done anything technical before, even if you don't know how code works.

  • Business pages: The power and flexibility of Gatsby make it an excellent choice for building business sites that need to be integrated with several third-party platforms. You can use Gatsby to build a single-page application and present it to your visitors, providing a lightweight, interactive experience. 
  • Jamstack websites: Jamstack is a content API that returns JSON or XML. This means you can use the same backend for your Gatsby site and native applications, which are both important if one wants their application's UI to be accessible by users using other devices.
  • Headless eCommerce stores:  Merchants who want a modern commerce framework based on proven technologies like React can find it in Gatsby. With Gatsby, you can  build breathtaking commerce experiences and deliver omnichannel content across different devices to reach more potential consumers using Gatsby’s plugin system and pre-built integrations.

Gatsby vs Next.js vs React

 

Gatsby

Next.js 

React

Application size

Smaller than a React application but bigger than a Next.js one

A Nextjs application is smaller than a React app

A React application is bigger than a Nextjs app

Developer experience

Average 

Great 

Great

Maintainability

Easy to maintain

Easy to maintain

Hard to keep updated

Ideal use cases

Blogs, static sites

eCommerce, company websites, static landing pages

Single page applications, company websites, portals

SEO-friendly

Yes

Yes

Yes

Documentation 

Excellent

Excellent

Average

Plugin ecosystem

Bigger than Next.js

Small

Bigger than others

Internationalization

Yes

Yes

Yes

Starter templates

Yes

Limited

Plenty

Community size

Large

Larger than Gatsby’s

Huge 

If you’re still struggling with which one to choose for your next project, take a look at our article on how to choose a static site generator.

Gatsby and Jamstack

Jamstack is a new technology stack changing how we build websites and applications. The JAM in Jamstack stands for JavaScript, APIs, and HTML markup - meaning you can use it as an alternative to WordPress or Drupal if your business needs something more lightweight but still powerful enough. 

As a Jamstack agency, we at Ikius are intimately familiar with Gatsby.js. Choosing Gatsby as your JavaScript framework has plenty of advantages for developers and business users, with the added benefit of being one of the best technologies in a Jamstack tech stack. 

Gatsby is a great option for companies and brands who want to build Jamstack-based digital experiences that are fast, scalable, and ultimately successful in serving thousands of visitors. 

Gatsby in the wild

Brightway Careers

brightway careers home page

We migrated Brightway's site from WordPress to Jamstack and saw an astonishing increase in Google Lighthouse's performance score. We also provided guidance and help regarding UI/UX when working with Brightway's designers to create a refreshed style for the brand.

The site is multilingual and features a fully customizable page structure with modular components and content for each locale. The content is managed with Sanity, an excellent headless content management system for Brightway's use case, achieving a 6x faster load speed compared to its previous WordPress build.

KVH

kvh group home page

We designed and built a modern Gatsby website for Real Estate Asset Management KVH Ltd, whose previous WordPress-built site was buckling under the weight of plugins. 

Thanks to Gatsby’s great plug-in ecosystem, pre-loading, and worldwide servers, we were able to enhance the KVH site from being weighed down under plugins to smoothly loading. 

Closing thoughts

If you're looking for a powerful, flexible, and performant frontend framework, Gatsby is definitely worth checking out. You can do much with Gatsby with its plugin system and React support. And the built-in performance optimizations make it a great choice for high-traffic websites. 

If you're looking for a static site generator that offers an intuitive, user-friendly experience, Gatsby is definitely worth checking out. With its huge community of developers and growing library of plugins, it's well on its way to becoming the go-to option for static websites. 

And thanks to its support for progressive web apps and single page applications, Companies can use Gatsby to build some pretty amazing websites. So if you're ready to take your website or app development skills to the next level, Gatsby is a great place to start. 

If you want to assess whether or not Gatsby is the right tool for the job you have in mind, get in touch with us, and let’s discuss your Gatsby project. Our Gatsby development service can help you make a decision or help you choose the right technology for your project. 

Top comments (0)