DEV Community

Megan
Megan

Posted on

Gatsby vs Next.js: Which would you choose?

Hi all! Hope your week has been going well.

Not to beat a dead horse, but I wanted to hear the opinions of the Dev community on Gatsby and Next.js, or really any other static site generators you enjoy/use.

I've been looking to make a food blog for a while now, given my background as a pastry chef, and I haven't quite come to a good conclusion on what to build it with.

At first I was like, no worries I will use my knowledge of React and Rails and make an amazing blog! But after reading a few great articles and hours of late night googling, this didn't seem to be the best route to go.

to the internet!

I don't need all of the functionality and weight of a full backend database, nor do I need to spend hours and hours building out a blog template from scratch when there are plenty of beautiful options out there. At first I was hurt at what I was reading, don't create it myself?

But after some thought, popular opinion is right, I don't need to reinvent the wheel. I can have plenty of customization using a React "framework" and all of the functionality with much less cost in time.

So all of that googling led me here: deciding between Gatsby and Next.js.

I watched this awesome video by Harry Wolff entitled Gatsby vs. Next.js. I found it very enlightening and definitely agreed with the tradeoffs he mentions.

I also came across this incredible article by James Bedford entitled Gatsby vs Next.JS - What, Why and When?. He does an outstanding job of comparing the two and speaking of their best use cases.

If you don't have time to watch the video or read the article, no worries (23 minutes is a lot of time), I've listed my compilation of the tradeoffs below:

Tradeoffs Gatsby Next.js
Starting off Steep learning curve at entry, difficult to understand plugin structure at first Quick and easy out of the box, use of node is more simple to breakdown and understand
Use of Server Not necessary Needs server
Scalability Great for small apps Better for large apps
Documentation Both have great, well thought out documentation Both have great, well thought out documentation
Integration Can easily integrate with CMS, many plugins available Libraries will need to be added by hand

I haven't had the pleasure of playing around with Next.js yet, but I did get to mess around a bit with Gatsby and I can definitely confirm that it is very confusing at first.

Some of my old classmates agreed and even with a base knowledge of React, I felt like it was not very intuitive. I am not giving up on Gatsby, but I do think I will need to take a significant amount of time to fully understand the structure of the "framework".

So with all of this in mind, I'm still not decided on which "framework" to go with. Although I haven't had a great experience with Gatsby so far, my blog won't be a huge application at first and could benefit from some of the plugins.

I can't decide

I'd love to hear other people's opinions, especially if you have a blog or have used one of these foundations in the past. Even if not, I'd still like to hear your input as there is so much to learn and I'm always excited to see everyone's different experiences.

Thanks in advance for sharing and hope you all have a great rest of your week ☀️

Top comments (10)

Collapse
 
juanfrank77 profile image
Juan F Gonzalez

If you're building a blog or a not-so-big thing, Gatsby will be the choice. You could leverage several of the plugins and have some nice cool-looking site for your posts. Although I agree is kinda hard to learn at first and I personally haven't done much with it.

On the flip side, I have done stuff with Next.js because I joined a project at my job that used Next.js as the UI part for a Drupal backend and by learning how to use some of its features, I'm now like all in on Next.js because with their new features you can build things that are sooo flexible and get the good stuff from SSG and SSR.

I'm planning to build my Next projects with it. (pun intended) 😜

Collapse
 
mwong068 profile image
Megan

Haha, love the pun. 😂 Thanks for the input Juan! I'd love to hear how your experience with Next.js is as you continue to use it in your future projects.

Collapse
 
giologist profile image
Gio

Gatsby is the epitome of the internet going full circle. Not only do I find it unintuitive as a framework, but even conceptually. The primary benefit I hear people boasting about is having a static website that loads fast. You can accomplish this easily by setting up appropriate caching on Cloudflare. While not being limited to a framework.

I'm very much a fan of Next.JS. However, i'm not entirely sure coding your own blog is a good use of your time. As a maker, I totally understand your inclination to do so.

However, if you take off your "software engineer" hat and put on your "blogger hat", what value is there in coding your own blog? None. You can argue that you'd have more control, but that's not entirely true. Your "control" will be limited by your productivity. And your productivity will be limited by you needing to re-invent and re-imagine an obscene amount of functionality. Functionality that already exists on a number of platforms (Wordpress, SquareSpace, Blogger, etc) and has been tested at scale.

These solutions might not seem "cool and shiny" as a developer, but they don't need to. Your job as a "blogger" (the other hat you'll be wearing) is to blog. And these software are great at that. They are proven and together power well over 30% of the internet.

I know this isn't the answer you're looking for, but its one I fully stand behind.

Collapse
 
mwong068 profile image
Megan

Hey Gio, I really appreciate your input. I couldn't agree more actually that blogging platforms these days are well built and there isn't much to be gained from me coding my own blog. Being a blogger in and of itself is work enough!

But personally (and with my "software engineer" hat on) I feel that this could be a fun project and a good learning experience for me. In terms of actually becoming a blogger, if anything great comes of this website (after it's hopefully built!) I'll switch over to a real blogging platform and maybe pursue that more seriously.

Thanks again for sharing and again, couldn't agree more!

Collapse
 
giologist profile image
Gio

I can totally appreciate that, I'll be cheering you on! 🤘🏻

Collapse
 
shcheklein profile image
Ivan Shcheklein

The biggest problem with Gatsby - build time. If you have 1000+ blog posts with images it would take an hour to build or rebuild it. There are optimizations, but first you have to pay for them (that's how they monetize it), second - sometimes you need to do a full rebuild anyways.

With Next you can do "lazy" server side rendering, which means you don't have to do the full build in advance.

Collapse
 
mwong068 profile image
Megan

This is great to keep in mind, thanks Ivan!

Collapse
 
gsferreira profile image
Guilherme Ferreira

Hi! I was facing the same dilemma recently. I also have the experience with React and I want to re-do my blog using Gastby or Next.
On my case, I was looking for a simple solution to my Blog. After trying out Gatsby and Next I was feeling:

  • Steep learning curve
  • Complex solutions for a simple problem
  • The generated HTML doesn't feel clean

So, I decided to go with Eleventy, a simpler static site generator. I shared the experience on my blog. Sorry to plug my own thing, but I think it will help you.

Collapse
 
mwong068 profile image
Megan

Hey Guilherme, no apologies necessary, I appreciate you sharing what has worked for you! I definitely want to check it out, thanks 😊

Collapse
 
mateh profile image
Máté Homolya

Hey Megan,
I was sick of all the boilerplate and syntactic sugar that most javascript frameworks come with and the steep learning curve. I think you might want to consider Sapper and Svelte, I found them very easy to learn, intuitive to use and they scale well to large projects. They may be a good choice for running a blog because of its file-based routing scheme. Deploying serverless Sapper projects are supported on vercel.app just like NextJS projects. The integrations I found on GitHub are endless. I recommend using Tailwind CSS for styling your blog. Also, if you care more about the content rather than the technology, then you can have the blog in Notion and pass it through a CloudFlare worker to serve it on your domain. Good Luck!