Member-only story
Why I Chose Gatsby Over Next.js
Server-side rendering vs. static site generators
Occasionally, Developers Get It Wrong
It’s rare, but it happens.
We love using the latest technology and exploring the latest frameworks. Greenfield projects are a great opportunity for trying something totally new, often using the old “using the right technology for the project” excuse even if you don’t fully understand whether it is, in fact, the right technology. So when I was approached to create a new website for a client, I used this as the perfect opportunity to explore Next.js.
I wanted to explore Next.js because server-side rendering (SSR) is great for SEO purposes, but where it really shines is the ability to create “hybrid” websites with React. This allows you to use SSR to grab some data from an API that can be used for SEO purposes, and then any content that isn’t required for SEO can be loaded once the page has been rendered. Next.js conveniently exposes getInitialProps
(which is now getServerSideProps
), so it’s fairly trivial to get up and running with Next.js.
Within no time at all, I had deployed a completed website with Next.js. This required a server, which I originally deployed to Amazon Elastic Beanstalk before eventually moving to Amazon EKS. However, it wasn’t…