← Cloud computing

Virtual machines and containers

Serverless computing

无服务器计算

With serverless computing you only write the code, and the provider runs it on its servers when needed. The servers exist, but you neither see nor manage them.

Its basic unit is the function: a small piece of code that runs when an event happens, such as an image upload, a request from a website or a set time each day.

Example: whenever a user uploads a photo, a function shrinks it and saves a thumbnail. If a thousand users upload at once, the provider automatically runs a thousand copies of the function.

Its advantages: you pay only when the code runs, scaling is automatic and there are no operating systems to update. So it suits small projects and work that comes in bursts.

But it has limits: the first run after idle time may be slow (a cold start), each function has a time limit, and moving to another provider later can be hard. Vercel, the platform this site runs on, uses this idea.

Ask the AI assistant

Ask anything about this lesson and get a simple answer with the terms in Chinese, Arabic and English.

The AI assistant runs on Google's Gemini model and can make mistakes. Do not write personal information. Available to signed-in learners, up to 30 requests a day.

The content is simplified and covers the basics only.