The thing that separates a static website from a dynamic one is that you serve static files instead of ones that are dynamically driven. This usually means that you don’t have a backend architecture that you can use for processing data you receive from a user. So what are your options when you need backend services for a static website? You could change your static site to a dynamic one, or you could look at other services to handle your backend for you.
Through the use of Javascript or third-party tools, you can implement many functions that are typically reserved for dynamic sites. If you need to process email list subscriptions, handle form submissions or even full-scale CMS operations, you can do so on a static website. So, what is the point of using a static site if you need to implement backend processes? That depends on how your site is set up and what your goals for your site are.
Let’s take a look at some common goals for using static websites, some common backend functions you may want to leverage for your static site, and your options for running these.
Goals for a Static Site
Not everyone running a static website does so for the same reasons. Maybe that’s all you know how to work with. Or perhaps you want to reduce the cost of hosting your website. Different motivations for using static sites will impact your decision on if or when or even how you’ll use backend functions.
Lower Costs
Some developers that use static websites are looking to lower their costs. If you’re hosting on a free service with a generic domain, you can host your site for nothing out of pocket except a bit of your own time. Even if you want to host with a custom domain, you can usually do so for only the cost of your custom domain, typically $12.
Developers who want lower costs may be able to leverage some free options out there for providing backend services. Using third-party backend services, you can offer some backend services that you would generally have to pay for with a hosted environment.
Smaller Footprint
Sometimes, the management of a hosted environment is more trouble than it’s worth. If your site doesn’t change often and you implement a well-built static development strategy, you can quickly deploy a static website that a non-technical person would be able to maintain. You may also want to benefit from the increased security and site speed that you benefit from when you aren’t using a dynamic site.
If you’re looking to shrink the platform that you’re using to host your website, then using backend services may complicate things further than if you were merely using a hosted solution. Using backend services will usually spread out your management points, which can make it more difficult for you to maintain the environment. If a smaller footprint is your goal, you may be well-served to look at a backend as a service (BAAS) solution that will package all your backend functions into a single management point.
Common Backend Functions
When you think about the backend of a website, you usually think about the database that drives the website. However, that database is so much more than simply the data that your site uses. The database can be used to store information from customers, can be leveraged into a full-scale CRM solution, or can merely be used to handle subscriptions to your email list. Also, working with a database, you can have users use any kind of text editor to send in new content that will be stored in the database.
All of these common backend functions can be accomplished using third-party methods. Want to build an eCommerce solution? You can use a service like SnipCart, or perhaps send users to another platform such as Gumroad to complete their purchase. You can use an email subscription service to collect emails, and leverage hosted CRM solutions to manage your customer relationships. The point is that almost anything you would use a full-featured website host to do you can now do using alternative means.
Backend Options
If you’re looking to develop your website as a static website, you have some options that you can leverage to provide additional services to your users. You can pay for a hosted solution - such as a backend as a service solution, or you can leverage cloud technologies and write code yourself.
Backend as a Service
These types of services will abstract the backend of your website away from you. This means that you have the development and interaction with your website the same as if you were using a static website. This service will then generate static pages using a static site generator, such as Jekyll, and deploy your static site automatically to a repository - such as Github Repos.
This type of service is essentially paying for a CMS solution that will host your site statically instead of pulling data from a database for each page view. The pricing on this is marginally better than using a traditional hosted website solution so it may not be worth the effort for you.
Cloud Functions/AWS Lambda
You can also leverage cloud solutions that will let you run code to interact with your website. These types of providers allow you to run your code in the cloud without having to have a server. You’re basically paying the cloud provider to run your computations on a per-run basis, instead of paying the monthly or hourly fees of a server.
For example, I used AWS lambda to run an email collection for users that wanted to sign up for my email list. The code was written to accept the code from my form, then forward it on to my email address. I would then have to input the user into my email list manually. It wasn’t the best solution, and I’ve since moved my email lists to an email list provider. However, I’m sure there were better ways to implement this than what I was able to do.
Third-Party Tools
Finally, as I’ve mentioned before, you can pay for third-party tools to do your data processing for you. I haven’t been able to find a single provider that will do everything you can do with a hosted solution. That being said, even if you were using a hosted solution, you might have to pay for some of these solutions. Sure you could run your email subscription service from your own servers, but you get much more functionality using an email subscription service, such as ConvertKit.
If your primary goal is to reduce the overall cost of your site, using third-party tools may not be your best solution. However, if your site gets large enough to outgrow the free tiers of static website hosting, it should be able to generate enough income that you can pay for premium services to help grow your audience.
Final Thoughts
Static sites have much more power than they used to have, especially with all of the solutions being developed by tech companies. You have access to cloud-based approaches, full-featured service agencies, and tools that let you piece-meal your needed functions. Depending on your reasons for using a static website in the first place, you should be able to find something that you can use to help augment your current static site setup.
Related Questions
What is BAAS? - BAAS stands for backend as a service. This is a service offered by companies that allow you to abstract the backend of your website to their hosted service. They typically use a static site generator to convert and deploy your static pages automatically.
Can you run an eCommerce website as a static site? - With a third-party tool, nothing is stopping you! The problem with an eCommerce website is storing inventory and customer information without a database. If you use a third-party tool to do this for you, with a little bit of Javascript on your site, you can quickly turn your static site into an eCommerce store.
Thank you for reading all the way to the end. I hope you found this article useful. If you have any questions, please don’t hesitate to ask and I’ll do my best to answer. If you have any questions about static websites that you’d like me to cover, please let me know.
Have you hosted a static website and leveraged any third-party tools to add functionality? Do you think that simply using a full-featured hosting solution is better? I’d love to hear from you in the comments below.