Skip to content
·10 min read

Serverless vs. a Server for Your Web App

Decide when your app needs to run and who will keep it working online.

Share

Choose a deployment model by answering two questions. When does your app need to do work? Who will keep its online setup working? A booking site can show prepared pages, run a short piece of code when someone books, or send that request to a running web service. You can have a hosting company manage that running service, or rent a computer and maintain it yourself.

Start with what your app needs to do

Imagine a site that lets people book a lesson. Anyone can read the opening hours. When someone presses Book, the app checks whether the slot is still available and saves the reservation. Showing prepared text and accepting a booking are different jobs. They can use different setups within the same app.

Deployment means putting a version of your app online. A host makes that version available to visitors. A server is a computer that responds when a browser or another program asks for something. That ask is a request, such as loading the opening hours or submitting the booking form.

Three ways to serve the booking app

How the app runsWhat the booking app doesWhat to check
Prepared pages, also called static pagesThe host sends files made ahead of time, such as the page showing opening hours.Where a form sends its request when it needs to check or save a booking.
On-demand code, often called serverless functionsThe host runs a piece of your code when a request or another event arrives. The booking function checks and saves the reservation, then returns a result.How long the code can run, what it can connect to and which work the host bills for.
A running web serviceThe host starts your app as a program that listens for requests. The same program can check bookings as requests arrive.Who handles restarts and whether the selected service keeps running during quiet periods.

A static page can still ask a separate service for current information. The booking itself belongs in a database, a place for keeping records after a function finishes or an app restarts. If the site accepts uploads, choose where those files will be kept too. Next.js static exports

An on-demand function still runs on a server. The host can reuse a running copy of the function for another request. When it needs to start a fresh copy, that setup can add a delay called a cold start. A running web service fits when your app already starts as a program that listens for requests or needs that program to stay running between requests. Check the actual host and plan. A running web service can also restart or sleep. Render, for example, documents that its free web services sleep after inactivity. AWS Lambda execution environment · Render web services · Render free web services

Who will maintain the app’s online home?

Suppose you choose a running service for the booking app. You can hand platform maintenance to a managed host, rent a virtual machine (a rented computer you control), or add a deployment dashboard to a machine you supply. The dashboard gives you a place to start deployments and see errors. Check who owns the work behind those buttons.

An operating system is the basic software the machine runs. A certificate lets the browser open an encrypted connection to your address over HTTPS. Scaling means changing the number or size of running copies of your app as demand changes.

JobManaged app service, such as DigitalOcean App PlatformRented machine you operateDeployment dashboard on a machine you supply, such as Coolify
Keep software updatedThe host maintains the platform. You maintain your app and the software it includes.You arrange updates to the machine and app.The dashboard helps you deploy. You arrange updates to the workload machine and app.
Keep HTTPS workingThe host can manage the certificate once you connect your address. Verify it on your domain.Set up certificate issuance and renewal, then check that it works.Check the dashboard’s certificate setup, then verify renewal and reachability on your machine.
Keep the service runningConfigure the available restart and scaling options, and decide who checks a failure.Set up restarts, watch errors and decide when to add capacity.Use available deployment controls and logs. You still own the machine’s capacity and recovery.
Recover reservations and uploadsChoose who can access the app and its records. Set up backups for the data services you chose and practice restoring them.Control access, collect logs and practice restoring records and files.Control machine and app access. Check dashboard settings and app data separately when planning recovery.

A useful question is who checks a failed update and restores the app if it stops overnight? Write a name next to that job before choosing an option. A managed dashboard can reduce deployment work while the connected machines are still your responsibility. Coolify documents that distinction even for its hosted dashboard. DigitalOcean App Platform features · DigitalOcean rented-machine setup · Coolify security responsibilities

Compare hosting providers by what they can run, how you can test changes and what they charge for.

Check limits and where the data lives

Before you choose a host, check the time a request can spend running, how much memory the code can use and whether your app can reach the database. Some platforms distinguish time spent actively running code from time spent waiting for another service. Read the limits for the specific product, plan and running mode you intend to use. Cloudflare Workers limits · Vercel function duration

Save reservations and uploads to storage designed to keep them. A host may let your code write temporary files that disappear on restart or deployment. If your test writes a file, restart the service and check that you can still open it from the storage you chose. Render free service storage

When does on-demand code fit?

Try it for a clear job with an obvious start and finish. A booking submission can check a slot, save the result and reply. If the app also emails a receipt, decide what happens when the booking succeeds but the email fails. Show that the reservation is saved and retry the email separately.

Check the host’s provisions for longer work separately. A background job is work the app can finish after replying to the visitor. Exporting a large list of bookings may fit that pattern. The browser can show that the export is being prepared and provide a download when it is ready.

Test one booking before you commit

Before you deploy or run the test version, check where it will save bookings and files. Use a separate test database and file location. If the app sends email, disable sending or direct messages only to a test address you control. If it takes payments, use your payment provider’s test mode. A temporary web address can still use live services. If you can’t confirm what an action will touch, stop before you run it. Vercel deployment environments

  1. Put up a test version that shows the opening hours. Use test accounts and made-up records.
  2. Save one reservation. Open the site again and check that it is still there.
  3. Try the same slot in two browser windows. Decide what the second person should see and check that the app avoids a double booking.
  4. Restart or redeploy the test version. Check that the booking and any test upload are still available, and find where a failed request would appear in the logs, the service’s record of what happened.
  5. Practice restoring the records and files into a separate, confirmed test location. Record who would handle that work after launch.

This exercise checks the path a visitor takes and gives you a small workload to measure.

Estimate the bill from the same workload

Write down the same assumptions for each option. Include how long the app runs, how often visitors submit bookings, how much data it stores and sends out, and whether you need a second environment for testing. Use both a quiet period and a busy one. A visit count alone leaves out how much work each visit creates.

For on-demand functions, check which events and resources count toward the bill. Vercel’s Fluid compute model, for example, tracks time spent actively running your code (CPU time), how much memory is reserved and for how long, and the number of requests to your functions. Other Vercel configurations can use different rules. For running services, check the charge for the resources or service size you choose, how idle time counts and any included usage. Railway, for example, describes a monthly plan with included usage and metered resources. Vercel function usage and pricing · Railway plans and usage

Add separately priced database, file storage, backups and data transfer where applicable. Also count your time for updates and recovery, or what you would pay someone to do that work. Check the plan’s included usage, region, currency and billing period before comparing totals.

When should you revisit your first choice?

Revisit it when you can name a problem. The booking request might hit a documented time limit, the export might need its own background job, or your bill might grow faster than the number of bookings. Start with the logs, the usage breakdown and the visitor’s experience. You may be able to change one job without moving the whole app.

If visitors need a connection that stays open for live updates, check that feature directly. A WebSocket is one way to keep a two-way connection open. Some on-demand platforms support it with specific limits and ways to keep shared state. Cloudflare Workers is one documented example. Cloudflare Workers WebSockets

Where do containers and separate services fit?

A container packages the app with software it needs to run. A managed platform can run that package for you, or you can run it on a machine you operate. The package describes how to start the app. The host and configuration determine when it runs and who maintains the machine. Deploy containers on DigitalOcean App Platform

A separate service is another program with its own job. If large exports start interfering with bookings, you can give exports their own worker. The opening-hours page and the booking request can stay where they are.

Record your choice and who handles recovery

For each job, write down what runs, where records and files are kept, and who will respond if it fails. Then put the first booking through the test above. Your first version might be a prepared hours page, a booking function and a database. A single managed web service and database can also make sense if your app already runs that way. Choose the setup you can test, pay for and recover.

PJ
Pranay Joshi

20+ years building products at scale. VP of Product & Engineering, startup founder, and AI coach. Helping dreamers turn ideas into reality with vibe coding.