├── .github └── workflows │ └── lint.yml ├── .markdownlint.jsonc ├── CODE_OF_CONDUCT.md ├── LICENSE └── README.md /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: CI lint 2 | 3 | on: 4 | push: 5 | branches: ["main"] 6 | pull_request: 7 | branches: ["main"] 8 | workflow_dispatch: 9 | 10 | jobs: 11 | lint: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Check out repository code 15 | uses: actions/checkout@v4 16 | - name: Markdown Lint 17 | uses: avto-dev/markdown-lint@v1.5.0 18 | with: 19 | args: "./README.md" 20 | config: "./.markdownlint.jsonc" 21 | - name: Typos 22 | uses: crate-ci/typos@v1.19.0 23 | -------------------------------------------------------------------------------- /.markdownlint.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "MD013": false 3 | } 4 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Covenant Code of Conduct 3 | 4 | ## Our Pledge 5 | 6 | We as members, contributors, and leaders pledge to make participation in our 7 | community a harassment-free experience for everyone, regardless of age, body 8 | size, visible or invisible disability, ethnicity, sex characteristics, gender 9 | identity and expression, level of experience, education, socio-economic status, 10 | nationality, personal appearance, race, caste, color, religion, or sexual 11 | identity and orientation. 12 | 13 | We pledge to act and interact in ways that contribute to an open, welcoming, 14 | diverse, inclusive, and healthy community. 15 | 16 | ## Our Standards 17 | 18 | Examples of behavior that contributes to a positive environment for our 19 | community include: 20 | 21 | * Demonstrating empathy and kindness toward other people 22 | * Being respectful of differing opinions, viewpoints, and experiences 23 | * Giving and gracefully accepting constructive feedback 24 | * Accepting responsibility and apologizing to those affected by our mistakes, 25 | and learning from the experience 26 | * Focusing on what is best not just for us as individuals, but for the overall 27 | community 28 | 29 | Examples of unacceptable behavior include: 30 | 31 | * The use of sexualized language or imagery, and sexual attention or advances of 32 | any kind 33 | * Trolling, insulting or derogatory comments, and personal or political attacks 34 | * Public or private harassment 35 | * Publishing others' private information, such as a physical or email address, 36 | without their explicit permission 37 | * Other conduct which could reasonably be considered inappropriate in a 38 | professional setting 39 | 40 | ## Enforcement Responsibilities 41 | 42 | Community leaders are responsible for clarifying and enforcing our standards of 43 | acceptable behavior and will take appropriate and fair corrective action in 44 | response to any behavior that they deem inappropriate, threatening, offensive, 45 | or harmful. 46 | 47 | Community leaders have the right and responsibility to remove, edit, or reject 48 | comments, commits, code, wiki edits, issues, and other contributions that are 49 | not aligned to this Code of Conduct, and will communicate reasons for moderation 50 | decisions when appropriate. 51 | 52 | ## Scope 53 | 54 | This Code of Conduct applies within all community spaces, and also applies when 55 | an individual is officially representing the community in public spaces. 56 | Examples of representing our community include using an official email address, 57 | posting via an official social media account, or acting as an appointed 58 | representative at an online or offline event. 59 | 60 | ## Enforcement 61 | 62 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 63 | reported to the community leaders responsible for enforcement at 64 | [INSERT CONTACT METHOD]. 65 | All complaints will be reviewed and investigated promptly and fairly. 66 | 67 | All community leaders are obligated to respect the privacy and security of the 68 | reporter of any incident. 69 | 70 | ## Enforcement Guidelines 71 | 72 | Community leaders will follow these Community Impact Guidelines in determining 73 | the consequences for any action they deem in violation of this Code of Conduct: 74 | 75 | ### 1. Correction 76 | 77 | **Community Impact**: Use of inappropriate language or other behavior deemed 78 | unprofessional or unwelcome in the community. 79 | 80 | **Consequence**: A private, written warning from community leaders, providing 81 | clarity around the nature of the violation and an explanation of why the 82 | behavior was inappropriate. A public apology may be requested. 83 | 84 | ### 2. Warning 85 | 86 | **Community Impact**: A violation through a single incident or series of 87 | actions. 88 | 89 | **Consequence**: A warning with consequences for continued behavior. No 90 | interaction with the people involved, including unsolicited interaction with 91 | those enforcing the Code of Conduct, for a specified period of time. This 92 | includes avoiding interactions in community spaces as well as external channels 93 | like social media. Violating these terms may lead to a temporary or permanent 94 | ban. 95 | 96 | ### 3. Temporary Ban 97 | 98 | **Community Impact**: A serious violation of community standards, including 99 | sustained inappropriate behavior. 100 | 101 | **Consequence**: A temporary ban from any sort of interaction or public 102 | communication with the community for a specified period of time. No public or 103 | private interaction with the people involved, including unsolicited interaction 104 | with those enforcing the Code of Conduct, is allowed during this period. 105 | Violating these terms may lead to a permanent ban. 106 | 107 | ### 4. Permanent Ban 108 | 109 | **Community Impact**: Demonstrating a pattern of violation of community 110 | standards, including sustained inappropriate behavior, harassment of an 111 | individual, or aggression toward or disparagement of classes of individuals. 112 | 113 | **Consequence**: A permanent ban from any sort of public interaction within the 114 | community. 115 | 116 | ## Attribution 117 | 118 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 119 | version 2.1, available at 120 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. 121 | 122 | Community Impact Guidelines were inspired by 123 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. 124 | 125 | For answers to common questions about this code of conduct, see the FAQ at 126 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at 127 | [https://www.contributor-covenant.org/translations][translations]. 128 | 129 | [homepage]: https://www.contributor-covenant.org 130 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html 131 | [Mozilla CoC]: https://github.com/mozilla/diversity 132 | [FAQ]: https://www.contributor-covenant.org/faq 133 | [translations]: https://www.contributor-covenant.org/translations 134 | 135 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Harold Martin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Comparing hosts / providers for serverless cloud functions (FaaS) for Python 2 | 3 | [![discord](https://img.shields.io/discord/267624335836053506?logo=discord&label=&color=323338)](https://discord.gg/python) 4 | [![twitter](https://img.shields.io/badge/@hmartin-00aced.svg?logo=twitter&logoColor=black)](https://twitter.com/hmartin) 5 | 6 | No Python support: Netlify Edge Functions, StackPath EdgeEngine. IBM Cloud Functions are deprecated. 7 | 8 | This document provides a comparison between hosted, serverless (no cost or management to spin down to zero) providers of cloud function hosts with Python runtimes. 9 | Note the distinction between edge providers (execution at PoP) and non-edge (typically predetermined DS region). 10 | 11 | Please join our [discussions](https://github.com/hbmartin/comparison-hosts-serverless-cloud-function-faas-for-python/discussions) or fix/update information by [editing this doc](https://github.com/hbmartin/comparison-hosts-serverless-cloud-function-faas-for-python/edit/main/README.md)! 12 | 13 | See also the [Serverless SQL DB Comparison](https://github.com/hbmartin/comparison-serverless-cloud-sql-databases) 14 | 15 | - [DevEx](#devex) 16 | - [Pricing](#pricing) 17 | - [Runtime Limits](#runtime-limits) 18 | - [Other Platform Products](#other-platform-products) 19 | - [Discussions, Community, and Support](#discussions-community-and-support) 20 | 21 | ## DevEx 22 | 23 | | | Python Version | Status | API Framework | Requirements | Local Testing | Docs | Hello World | 24 | | ------------------------------------- | -------------- | --------- | ------------------------------- | ---------------- | ------------- | ---- | ------------------------------------------------------------ | 25 | | **Alibaba Cloud Function Compute** | 3.10 | GA | Plain object | Vend in zip | ❔ | 🎉 | [Link](https://www.alibabacloud.com/help/en/functioncompute/latest/event-handlers) | 26 | | **AWS Lambda & Lambda@Edge** | 3.12 | GA | Plain object | Vend in zip | ✅ | 👍 | [Link](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) | 27 | | **Azure Functions** | 3.11 | GA | azure functions | ✅ | ✅ | 🎉 | [Link](https://learn.microsoft.com/en-us/samples/browse/?products=azure-functions&languages=python) | 28 | | **Cloudflare Workers** (WASM) | 3.12 | Beta | fastapi [and others](https://developers.cloudflare.com/workers/languages/python/packages) | 🚫 | 🚫 | 🎉 | [Link](https://github.com/cloudflare/python-workers-examples) | 29 | | **Fermyon** (WASM) | 3.11+ | No-native | Spin | ✅ | ❔ | 🎉 | [Link](https://www.fermyon.com/blog/spin-python-sdk) | 30 | | **Fly.io** (microVM) | Any | GA | Any | ✅ | ❔ | 👍 | [Link](https://fly.io/docs/languages-and-frameworks/python/) | 31 | | **Google / Firebase Cloud Functions** | 3.12 | GA | Flask | ✅ | ✅ | 🎉 | | 32 | | **IBM Code Engine** | 3.11 | GA | Plain object | ✅ | ✅ | 👍 | [Link](https://github.com/IBM/CodeEngine/tree/main/helloworld-samples/function-codebundle-python) | 33 | | **Oracle (OCI) Functions** | 3.11 | GA | FDK | ✅ | ❔ | Min. | [Link](https://github.com/oracle-samples/oracle-functions-samples/tree/master/samples/helloworld) | 34 | | **Tencent Cloud Functions** | 3.6 | GA | SCF | Vend in zip | ❔ | Min. | [Link](https://www.tencentcloud.com/document/product/583/40327) | 35 | | **Vercel Functions** | 3.12 | Beta | HTTP handler or WSGI / ASGI | ✅ | ❔ | 👍 | [Link](https://vercel.com/templates/python/python-hello-world) | 36 | 37 | ## Pricing 38 | 39 | Note that the "Free Plan" is intended to represent ongoing free resources i.e. not trials or sign-up credits. 40 | 41 | | | **Free Plan** | Bill Limits | **First Paid Tier** | 42 | | ------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | 43 | | **Alibaba Cloud Function Compute** | 3 month trial with resource limits | ? | [Based on requests and resources](https://www.alibabacloud.com/help/en/fc/product-overview/billing-overview) | 44 | | **AWS Lambda** | [1m reqs / mo + 400,000 GB-s / mo](https://docs.aws.amazon.com/whitepapers/latest/how-aws-pricing-works/lambda.html) (based on memory configuration) + [data egress](https://aws.amazon.com/ec2/pricing/on-demand/) (~$0.09 per GB) | 🚫 | $0.20 per 1m reqs + $0.00001667 per GB-s (over free tier) + [data egress](https://aws.amazon.com/ec2/pricing/on-demand/) (~$0.09 per GB) | 45 | | **AWS Lambda@Edge** | None | 🚫 | [$0.60 per 1m reqs + $0.00000625125 per GB-s](https://aws.amazon.com/cloudfront/pricing/) + egress (~$0.09 per GB) | 46 | | **Azure Functions** | 1m reqs / mo + 400,000 GB-s / mo + first 100 GB / mo egress | [Yes](https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/spending-limit) | $0.20 per 1m reqs + $0.000016 per GB-s (over free) + $0.08 per GB egress (over 100 GB) | 47 | | **Cloudflare Workers** | 100k reqs / day, 10ms CPU / req | ? | $20 / mo for 10m reqs / mo, 30ms CPU / req + $0.02 per million CPU ms | 48 | | **Fermyon** | [100k reqs + 5GB egress](https://www.fermyon.com/pricing) | NA | 1m reqs + 50GB egress at $20 / mo | 49 | | **Fly.io** | 3 shared-cpu-1x 256mb VMs + 100GB egress | NA | Depends on VM + $0.02 per GB egress (over free, min $5 / mo) + $0.15 per GB / mo stopped VMs | 50 | | **Google / Firebase Cloud Functions** | 2m / mo reqs + 400k / mo GB-s + 200k / mo CPU-s + 5 GB / mo egress | [Yes](https://cloud.google.com/billing/docs/how-to/budgets) | $0.40 per 1m reqs + $0.0000025 per GB-s + $0.0000100 per CPU-s + $0.12 per GB egress | 51 | | **IBM Code Engine** | 100k vCPU-s + 200k GB-s + 100k reqs per mo | ? | $0.00003431 / vCPU-s + $0.00000356 / GB-s + $0.538 / 1m reqs | 52 | | **Oracle (OCI) Functions** | 2m / mo reqs + 400k / mo GB-s | Yes | $0.0000002 per req + $0.00001417 per GB-s | 53 | | **Tencent Cloud Functions** | 3 month trial with resource limits | ? | $0.0000167 per GB-s + $0.002 per 10k reqs + $0.00000847 per idle GB-s + $0.06 per day + $0.0752 per GB egress | 54 | | **Vercel Functions** | 100 GB-hrs + 100 GB data transfer | Yes | 1,000 GB-hrs + 1TB data transfer | 55 | 56 | reqs = requests, m = million, mo = month, s = seconds, mem = memory, k = thousand, ms = milliseconds 57 | 58 | ## Runtime Limits 59 | 60 | | | Memory | | Execution Time (s) | | **Payloads (MB)** | | Code Size (MB) | Scale Limits | 61 | | ------------------------------------- | ----------- | ------- | ------------------ | ------- | ----------------- | ------------ | -------------- | ------------------------- | 62 | | | **Default** | **Max** | **Default** | **Max** | **Request** | **Response** | | | 63 | | **Alibaba Cloud Function Compute** | 32 GB | 32 GB | 86k | 86k | 32 | ? | 500 | 300 | 64 | | **AWS Lambda** | 128 MB | 10 GB | 3s | 15min | 6 | 6 | 50 (zip) | 10k per reg. per sec. | 65 | | **AWS Lambda@Edge** | 128 MB | 3 GB | 3s | 30s | ? | 1 | 50 (zip) | 10k per reg. per sec. | 66 | | **Azure Functions** | 1.5 GB | 14 GB | 5min | 10min | 100 | ? | ? | 100 inst. | 67 | | **Cloudflare Workers** | 128 MB | 128 MB | 10ms | 30ms | ? | ? | 1 / 10 | 100 / 500 | 68 | | **Fermyon** | ? | ? | 30s | 30s | ? | ? | 100 | 1k RPS | 69 | | **Fly.io** | 256 MB | 128 GB | NA | NA | NA | NA | NA | NA | 70 | | **Google / Firebase Cloud Functions** | - | 32GB | - | 60min | 32 | 32 | None | 1k RPS / inst. | 71 | | **IBM Code Engine** | 2 GB | 4 GB | 120s | - | ? | ? | 100 KB | ? | 72 | | **Oracle (OCI) Functions** | 128 MB | 2 GB | 30s | 300s | ? | ? | ? | 40 GB total mem | 73 | | **Tencent Cloud Functions** | 64 MB | 3 GB | 1s | 900s | 6 | 6 | 500 (unzip) | 64 GB total mem | 74 | | **Vercel Functions** | 1 GB | 3 GB | 10s | 300s | ? | ? | 250 (zip) | 1k RPS per 10 sec per reg | 75 | 76 | AWS allocates 1 vCPU per 1,769 MB of memory configured. 77 | 78 | ## Other Platform Products 79 | 80 | | | SQL DB | No SQL DB | Blob Store | File Hosting | GPU | 81 | | ------------------------------------- | ------ | --------- | ---------- | ------------ | ---- | 82 | | **Alibaba Cloud Function Compute** | ✅ | ✅ | ✅ | ✅ | ✅ | 83 | | **AWS Lambda and Lambda@Edge** | ✅ | ✅ | ✅ | ✅ | ✅ | 84 | | **Azure Functions** | ✅ | ✅ | ✅ | ✅ | ✅ | 85 | | **Cloudflare Workers** | SQLite | ✅ | ✅ | ✅ | ✅ | 86 | | **Fermyon** | SQLite | 🚫 | 🚫 | 🚫 | ✅ | 87 | | **Fly.io** | ✅ | ✅ | 🚫 | 🚫 | ✅ | 88 | | **Google / Firebase Cloud Functions** | ✅ | ✅ | ✅ | ✅ | ✅ | 89 | | **IBM Code Engine** | ✅ | ✅ | ✅ | ✅ | ✅ | 90 | | **Oracle (OCI) Functions** | ✅ | ✅ | ✅ | ✅ | ✅ | 91 | | **Tencent Cloud Functions** | ✅ | ✅ | ✅ | ✅ | ✅ | 92 | | **Vercel Functions** | ✅ | ✅ | ✅ | ✅ | 🚫 | 93 | 94 | ## Performance (median times) 95 | 96 | TODO: Need a benchmark suite for Python, see [this JS suite](https://github.com/serverless-benchmark/backend) 97 | 98 | | | PoPs (if edge) or regions | Uptime | Cold Response (ms) | Warm Response (ms) | Overhead (ms) | 99 | | ------------------------------------- | ------------------------- | ------ | ------------------ | ------------------ | ------------- | 100 | | **Alibaba Cloud Function Compute** | | | | | | 101 | | **AWS Lambda** | | | | | | 102 | | **AWS Lambda@Edge** | | | | | | 103 | | **Azure Functions** | | | | | | 104 | | **Fermyon** | | | | | | 105 | | **Fly.io** | | | | | | 106 | | **Google / Firebase Cloud Functions** | | | | | | 107 | | **IBM Code Engine** | | | | | | 108 | | **Oracle (OCI) Functions** | | | | | | 109 | | **Tencent Cloud Functions** | | | | | | 110 | | **Vercel Functions** | | | | | | 111 | 112 | ## Security Considerations 113 | 114 | TODO: e.g. compliance certifications, data encryption, and network security options 115 | 116 | See also [awesome serverless security](https://github.com/puresec/awesome-serverless-security) 117 | 118 | ## Discussions, Community, and Support 119 | 120 | | | Ours | Forum | GitHub | SO | Reddit | 121 | | ------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | 122 | | **Alibaba Cloud Function Compute** | [Link](https://github.com/hbmartin/comparison-hosts-serverless-cloud-function-faas-for-python/discussions/1) | [Forum](https://www.alibabacloud.com/forum) | | [SO](https://stackoverflow.com/questions/tagged/alibaba-cloud) | [r/AlibabCloud](https://www.reddit.com/r/AlibabaCloud/) | 123 | | **AWS Lambda and Lambda@Edge** | [Link](https://github.com/hbmartin/comparison-hosts-serverless-cloud-function-faas-for-python/discussions/2) | [re:Post](https://repost.aws/tags/questions/TA5uNafDy2TpGNjidWLMSxDw?view=all) | [GitHub](https://github.com/aws/aws-lambda-builders) | [SO](https://stackoverflow.com/collectives/aws) | [r/aws](https://www.reddit.com/r/aws/) | 124 | | **Azure Functions** | [Link](https://github.com/hbmartin/comparison-hosts-serverless-cloud-function-faas-for-python/discussions/3) | [Forum](https://learn.microsoft.com/en-us/answers/tags/87/azure-functions) | [GitHub](https://github.com/Azure/azure-sdk-for-python) | [SO](https://stackoverflow.com/collectives/azure) | [r/AZURE](https://www.reddit.com/r/AZURE/) | 125 | | **Cloudflare Workers** | [Link](https://github.com/hbmartin/comparison-hosts-serverless-cloud-function-faas-for-python/discussions/10) | [Forum](https://community.cloudflare.com/c/developers/workers/40) | | [SO](https://stackoverflow.com/questions/tagged/cloudflare-workers) | [r/CloudFlare](https://www.reddit.com/r/CloudFlare/) | 126 | | **Fermyon** | [Link](https://github.com/hbmartin/comparison-hosts-serverless-cloud-function-faas-for-python/discussions/4) | [Discord](https://discord.com/invite/P4Cx7xUbJu) | [Feedback](https://github.com/fermyon/feedback) | [SO](https://stackoverflow.com/questions/tagged/fermyon-spin) | | 127 | | **Fly.io** | [Link](https://github.com/hbmartin/comparison-hosts-serverless-cloud-function-faas-for-python/discussions/5) | [Forum](https://community.fly.io/) | | [SO](https://stackoverflow.com/questions/tagged/fly?tab=Active) | | 128 | | **Google / Firebase Cloud Functions** | [Link](https://github.com/hbmartin/comparison-hosts-serverless-cloud-function-faas-for-python/discussions/6) | [Group](https://groups.google.com/g/firebase-talk/) | [GitHub](https://github.com/firebase/firebase-functions-python) | [SO](https://stackoverflow.com/collectives/google-cloud) | [r/Firebase](https://www.reddit.com/r/Firebase/) and [r/googlecloud](https://www.reddit.com/r/googlecloud/) | 129 | | **IBM Code Engine** | [Link](https://github.com/hbmartin/comparison-hosts-serverless-cloud-function-faas-for-python/discussions/7) | [Slack](https://cloud.ibm.com/kubernetes/slack) | [GitHub](https://github.com/IBM/CodeEngine) | [SO](https://stackoverflow.com/questions/tagged/ibm-cloud-code-engine) | | 130 | | **Oracle (OCI) Functions** | [Link](https://github.com/hbmartin/comparison-hosts-serverless-cloud-function-faas-for-python/discussions/8) | [Forum](https://forums.oracle.com/ords/apexds/domain/dev-community/category/containers-cloud-native) | [GitHub](https://github.com/oracle-samples/oracle-functions-samples) | [SO](https://stackoverflow.com/questions/tagged/oracle-cloud-functions) | [r/oraclecloud](https://www.reddit.com/r/oraclecloud/) | 131 | | **Vercel Functions** | [Link](https://github.com/hbmartin/comparison-hosts-serverless-cloud-function-faas-for-python/discussions/9) | [Help](https://vercel.com/help) | [GitHub](https://github.com/orgs/vercel/discussions) | [SO](https://stackoverflow.com/questions/tagged/vercel) | [r/Vercel](https://www.reddit.com/r/vercel/) | 132 | 133 | ## References and Useful Links 134 | 135 | - [Comparison by Brecht De Rooms from Feb 6th, 2020](https://fauna.com/blog/comparison-faas-providers) 136 | --------------------------------------------------------------------------------