DEV Community

Discussion on: GatsbyJs: Pros and Cons

Collapse
 
juliusdelta profile image
JD Gonzales

Gatsby generates static sites and very much has a specific use case. There's a couple of questions to answer about it to see if it fits for you:

  1. Do I have a lot of dynamic data?

This means: Does your data vary by the individual user that's logged in? This means usually that you have to do some client side fetching and if that's all you're doing than Gatsby probably isn't the right fit.

  1. Are the data queries I'm running static? Do they only need to be run one time for all users of the site?

This is common among blogs. Where the user plays almost no part in what data loads and all the data is the same for each user. In this case Gatsby could be a good fit but again it depends more deeply on what you're wanting as well as how steep of a learning curve you're willing to deal with.

While Gatsby allows for client side code just fine and managing dynamic data, it has a steep learning curve compared to something like create-react-app if you're going to be hydrating data from a rest api.

Gatsby also sort of requires you to normalize the data as it comes in so you can use GraphQL to query it and this all happens during the build time, when the site is actually generated. This makes the learning curve exceptionally steep for Gatsby.

Unless you are developing a blog or just really want to learn Gatsby I probably wouldn't recommend it. I personally use it for my blog and it works just fine for that but none of my data is fetched client side so it all happens during the build process.

Collapse
 
stel profile image
St3l

Thank you JD for your answer. My project is mainly static but we have a small part of it that require dynamic data. That's why I'm doubting about using Gatsby.