1 Jul 2024 5 min read




Digital Director, Ultimate

Want a website as flexible as a yogi that scales effortlessly with traffic? Then serverless hosting might just be for you. In this Thought, we’re exploring the key advantages, limitations, and handy helpers for management.

Serverless vs Traditional Hosting

Traditional web hosting relies on either physical or virtual servers to handle requests. Serverless hosting, on the other hand, operates by running code as “functions” that are triggered on demand. 

These functions, often called FaaS (functions-as-a-service), don’t have a persistent state and are instead allocated memory and computational power as needed. Think of them as ultra-efficient assistants that only pop up (and get paid) when there’s work to be done. No server room necessary.

Traditional server room

What are the Advantages of Serverless Hosting?

Serverless hosting brings several advantages over traditional server setups, including:

  • Scalability: Serverless functions can handle multiple requests simultaneously and automatically scale to meet demand. Developers can specify a maximum concurrency per function, although there is usually an account-wide concurrency limit to consider.
  • Reduced maintenance: With serverless, there is no need to manage the underlying web server or operating system, significantly reducing maintenance demands.
  • Efficiency of cost: Serverless hosting charges are based on “actual usage”, meaning you only pay when your function is invoked. This can make serverless hosting a cost-effective solution compared to traditional servers (that run continuously.)

Understanding Serverless Limitations

While serverless hosting offers many benefits, like all good things it does have its limitations:

  • Memory and execution time: Serverless functions are typically limited to 1GB of memory and a maximum execution time of 15 minutes. Applications requiring more memory or longer processing times may need to be restructured.
  • Cost considerations: With pay per use, costs have the potential to be unpredictable, and may escalate with long-running or high-memory functions. It’s crucial that developers optimise code to avoid infinite loops, and manage resources efficiently to prevent unexpected costs. Some restrictions can also be put in place to prevent costs from spiralling (for example – max concurrency, or job restrictions/limits).
  • Data storage and management: Serverless functions have minimal and non-persistent storage. Developers will need to configure external solutions for data storage, logging, sessions, and caching.

Managing Serverless Hosting

Handling serverless functions involves integrating various services and configurations. At Ultimate, we use two tools to help simplify this process:

  • Laravel Vapor: This subscription-based service streamlines the setup and management of serverless Laravel applications. It provides a user-friendly CLI (command line interface)  and web interface, supporting multiple environments and easy deployment. However, it may not be compatible with custom AWS infrastructures. At Ultimate: We use Vapor for the backend API and admin of a tourism client’s online shop, with the front end hosted on AWS Amplify. Our devs find that Vapor handles multiple environments and .env variable management efficiently. 
  • Bref: Built on the Serverless Framework, Bref allows for the configuration and deployment of serverless applications to AWS Lambda. It supports various services like caching, storage, and databases, making it versatile for different projects. At Ultimate: For a large-scale client’s UPRN API project, we needed specific networking configurations within AWS VPC. Bref’s flexibility allowed us to meet these requirements and manage our deployments through custom scripts and Bitbucket pipelines.

The bottom line: Three key takeaways.

  • Serverless hosting is a powerful and efficient way to manage web applications, offering scalability, reduced maintenance, and a strong potential for cost savings.
  • However, serverless hosting requires careful planning and configuration to manage costs and resource limitations effectively.
  • Tools like Laravel Vapor and Bref can help streamline the process, making serverless a viable option for modern web development.

Why not
get in touch to explore how serverless hosting could work for your business.