The internet has been around for more than three decades now. So naturally, it shouldn't be that hard to create a website, and use the internet's incredible power to reach billions of people worldwide. And really, it is pretty easy - if you want to create a simple website, you don't even need to know how to write code. Services like Wordpress, Github Pages, etc. will get your website up and running in a matter of a few minutes for free (if you don't care for a custom domain).
So recently, when I was working on creating a web app for a side project, I did my research on the latest and greatest tools available in the market for web development. Frontend technology evolves really fast - there are always new, shiny tools available and the old ones are getting deprecated.
It suited the requirements for my use-case and so, I decided to go ahead with it. It's worth noting that spending some time assessing the pros and cons between available alternatives before you start your project can save you a ton of headache later on.
But the benefit of persevering through this was an accelerated learning rate. I figured out exactly the things that I needed for my tasks, without wasting a lot of time reading unnecessary bits.
You don't need a backend at all if your site consists of mostly static pages (just like this website). In that case, you can use static generation. What that means is that your code will go through a build process and get rid of server interactions as much as possible. This will also make your website cacheable and load much faster. This architecture pattern is called Jamstack (this website is based on Jamstack pattern too!).
In case a more sophisticated backend is needed, you can implement it in the language of your choice, containerize it and deploy it to serve from a cloud provider. Broadly speaking, there are 2 main options here which are common across all Cloud providers:
- Need-basis shared environment: Your container(s) will run in a shared environment. You might need to modify some settings to prevent the server processes from being killed when there is no traffic.
- Dedicated VMs: This makes sense in case your app has high Quality of Service (QoS) requirements or needs to do complex stuff. This option usually costs more.
Where you buy your domain from doesn't really matter. What's more important is picking your hosting provider. For Next.JS, you'll get a good development and deployment experience with Vercel (since they created it), but Netlify and Cloudflare are great options too.
In order to have a non-trivial backend, you'll most likely use one of the cloud providers. I found that the starter tier of several Cloud providers has generous limits which makes the hosting essentially free. But depending upon what kind of traffic you're expecting in future, it makes sense to review how the pricing plan scales for more traffic.
- Pay attention to what CDN you're going to be using. Depending upon your hosting, you might get it for free. Using a fast, global CDN will reduce loading times for your website. This is particularly important if your frontend is heavy on assets like images, etc.
- Avoid early optimization. Prioritize iterating on an initial MVP. That being said, it's a good idea to spend some time thinking about important decisions which will impact your app's performance like your database schemas, number of network hops, API calls, etc.
I hope that this write-up proves at least somewhat helpful to a soul who is as lost as I was when I started my journey a few weeks back. Not knowing what you don't know is a constant challenge when you're in the initial stages of learning something new.
The more time you can invest in it, the more systematically you can structure your learning. And the better understanding you have of what you're doing, the easier time you'll have while building. Have fun!
Thanks for reading. I would love to hear your thoughts about this article. Connect with me on Twitter.