on this page

GlossaryWhat is a serverless function?

What is a serverless function?

A serverless function is a piece of code you deploy on its own, without a server to manage, that runs when something calls it: usually an HTTP request, sometimes a timer or an incoming message. There are still servers. Someone else runs them, starts your code when a request needs it, and keeps it running as long as traffic does.


How it works

You hand the platform your code and a little configuration. The platform gives the function an address, routes requests to it, and runs as many copies as the traffic needs. Your code exports a handler that takes a request and returns a response. Between requests it keeps no state you can count on, so anything that has to last goes into a database or object store the platform connects for you.

The trade is control for less work. You don't patch an operating system, size a machine or keep a process alive, and you usually pay for use rather than for a server sitting idle. In return you live inside the platform's limits on CPU time per request, memory and what the code is allowed to reach.


Serverless functions on Tissue Cloud

On Tissue Cloud a serverless function is called a Cell. A Cell is a JavaScript or WebAssembly module that exports fetch(request, env), and ribo deploy puts it on a live HTTPS URL of the form https://<cell-name>.<account-subdomain>.tissue.dev. Storage comes in as bindings declared in ribo.toml: a SQL database with c3, object storage with g7, secrets from the vault. A Cell can also export pulse(event, env) to run on a cron schedule. Each request gets up to 10 seconds of CPU time, and time spent waiting on the network doesn't count toward it.

Cells overview covers the model in full, and the quick start deploys one in a few minutes.