From fd4800aad9b3e122cb483d28a265d7878c68da06 Mon Sep 17 00:00:00 2001 From: Thomas Tacquet Date: Mon, 25 Nov 2024 18:30:12 +0100 Subject: [PATCH 1/3] feat(serverless): add comparaison table --- .../difference-jobs-functions-containers.mdx | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/macros/serverless/difference-jobs-functions-containers.mdx b/macros/serverless/difference-jobs-functions-containers.mdx index 0dcc886257..85a424947e 100644 --- a/macros/serverless/difference-jobs-functions-containers.mdx +++ b/macros/serverless/difference-jobs-functions-containers.mdx @@ -4,6 +4,34 @@ macro: difference-jobs-functions-containers ## Differences between Functions, Containers, and Jobs +### Considerations + +* **Serverless Containers** offers more flexibility by allowing you to deploy any containerized application. It's suitable for stateless services and can handle more complex applications with configurable concurrency and no maximum execution time. +* **Serverless Functions** is ideal for lightweight, event-driven code where you don't manage the underlying infrastructure. It's limited to specific languages and is not suitable for long-running processes. +* **Serverless Jobs** is designed for executing batch jobs or tasks that need to run to completion. It is ideal for data processing tasks, migrations, or any workload that doesn't fit the request-response model. + +### Comparaison table + +| **Criteria** | **Serverless Functions** | **Serverless Containers** | **Serverless Jobs** | +|------------------------------------|---------------------------------------------------------------------|---------------------------------------------------------------------|---------------------------------------------------------| +| **Use case** | Event-driven functions responding to events or HTTP requests | Stateless HTTP containers handling web services or APIs | Processing tasks that run to completion | +| **Scaling** | Automatically scales based on incoming events | Automatically scales based on incoming events | Manually specified number of job executions | +| **Maximun execution time** | Up to 15 minutes per request | Up to 15 minutes per request | 24 hours | +| **Concurrency** | Single request per instance | Configurable concurrency per instance | Not applicable | +| **Pricing model** | Pay per exeuction time and invocations | Pay per vCPU and memory usage | Pay per vCPU and memory usage | +| **Triggers** | HTTP requests, scheduled (CRONs), messaging events (NATS, SQS, SNS) | HTTP requests, scheduled (CRONs), messaging events (NATS, SQS, SNS) | Manual invocation or scheduled | +| **Language support** | Node, PHP, Python, Go, Rust | Any language/runtime within a container | Any language/runtime within a container | +| **Infrastructure management** | Fully managed, handles provisionning and scaling automatically | Fully managed, handles provisionning and scaling automatically | Fully managed, abstracts away infrastructure management | +| **Cold-starts** | Can have startup latency on new instances | Can have startup latency on new instances | No applicable (jobs starts when scheduled or invoked) | +| **Supports custom containers** | No, deploy code in supported languages only | Yes, deploy any containerized application | Yes, deploy any containerized application | +| **Long-running Processes** | Not suitable for long running tasks | Not suitable for long running tasks | Ideal for long running processes | +| **Networking** | No VPC support at the moment | No VPC support at the moment | No VPC support at the moment | +| **Secret manager integration** | Only via local secrets | Only via local secrets | Yes | +| **Customisable ephemeral storage** | Yes | Yes | Yes | +| **Scaling from and to zero** | Yes | Yes | Not applicable | + +## Details + ### Serverless Jobs Serverless Jobs are designed for batch computing workloads, particularly large-scale and asynchronous tasks, like data processing, image rendering, or complex computations. From 5fa86e4f8655189fc61428d4053de96aedd56b64 Mon Sep 17 00:00:00 2001 From: Thomas TACQUET Date: Tue, 26 Nov 2024 11:25:36 +0100 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Jessica <113192637+jcirinosclwy@users.noreply.github.com> Co-authored-by: Rowena Jones <36301604+RoRoJ@users.noreply.github.com> --- .../difference-jobs-functions-containers.mdx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/macros/serverless/difference-jobs-functions-containers.mdx b/macros/serverless/difference-jobs-functions-containers.mdx index 85a424947e..065b8ca3fc 100644 --- a/macros/serverless/difference-jobs-functions-containers.mdx +++ b/macros/serverless/difference-jobs-functions-containers.mdx @@ -6,25 +6,25 @@ macro: difference-jobs-functions-containers ### Considerations -* **Serverless Containers** offers more flexibility by allowing you to deploy any containerized application. It's suitable for stateless services and can handle more complex applications with configurable concurrency and no maximum execution time. -* **Serverless Functions** is ideal for lightweight, event-driven code where you don't manage the underlying infrastructure. It's limited to specific languages and is not suitable for long-running processes. -* **Serverless Jobs** is designed for executing batch jobs or tasks that need to run to completion. It is ideal for data processing tasks, migrations, or any workload that doesn't fit the request-response model. +* **Serverless Containers** offers more flexibility by allowing you to deploy any containerized application. It is suitable for stateless services and can handle more complex applications with configurable concurrency and no maximum execution time. +* **Serverless Functions** is ideal for lightweight, event-driven code where you do not manage the underlying infrastructure. It is limited to specific languages and not suitable for long-running processes. +* **Serverless Jobs** is designed for executing batch jobs or tasks that need to run to completion. It is ideal for data processing tasks, migrations, or any workload that does not fit the request-response model. -### Comparaison table +### Comparison table | **Criteria** | **Serverless Functions** | **Serverless Containers** | **Serverless Jobs** | |------------------------------------|---------------------------------------------------------------------|---------------------------------------------------------------------|---------------------------------------------------------| | **Use case** | Event-driven functions responding to events or HTTP requests | Stateless HTTP containers handling web services or APIs | Processing tasks that run to completion | | **Scaling** | Automatically scales based on incoming events | Automatically scales based on incoming events | Manually specified number of job executions | -| **Maximun execution time** | Up to 15 minutes per request | Up to 15 minutes per request | 24 hours | +| **Maximum execution time** | Up to 15 minutes per request | Up to 15 minutes per request | 24 hours | | **Concurrency** | Single request per instance | Configurable concurrency per instance | Not applicable | -| **Pricing model** | Pay per exeuction time and invocations | Pay per vCPU and memory usage | Pay per vCPU and memory usage | +| **Pricing model** | Pay based on exeuction time and invocations | Pay based on vCPU and memory usage | Pay based on vCPU and memory usage | | **Triggers** | HTTP requests, scheduled (CRONs), messaging events (NATS, SQS, SNS) | HTTP requests, scheduled (CRONs), messaging events (NATS, SQS, SNS) | Manual invocation or scheduled | | **Language support** | Node, PHP, Python, Go, Rust | Any language/runtime within a container | Any language/runtime within a container | -| **Infrastructure management** | Fully managed, handles provisionning and scaling automatically | Fully managed, handles provisionning and scaling automatically | Fully managed, abstracts away infrastructure management | -| **Cold-starts** | Can have startup latency on new instances | Can have startup latency on new instances | No applicable (jobs starts when scheduled or invoked) | +| **Infrastructure management** | Fully managed, handles provisioning and scaling automatically | Fully managed, handles provisioning and scaling automatically | Fully managed, abstracts away infrastructure management | +| **Cold-starts** | There may be startup latency on new instances | There may be startup latency on new instances | Not applicable (jobs starts when scheduled or invoked) | | **Supports custom containers** | No, deploy code in supported languages only | Yes, deploy any containerized application | Yes, deploy any containerized application | -| **Long-running Processes** | Not suitable for long running tasks | Not suitable for long running tasks | Ideal for long running processes | +| **Long-running processes** | Not suitable for long running tasks | Not suitable for long running tasks | Ideal for long running processes | | **Networking** | No VPC support at the moment | No VPC support at the moment | No VPC support at the moment | | **Secret manager integration** | Only via local secrets | Only via local secrets | Yes | | **Customisable ephemeral storage** | Yes | Yes | Yes | From aafe530ad5c6bea3b4e63146e9c8270751be4fab Mon Sep 17 00:00:00 2001 From: Rowena Jones <36301604+RoRoJ@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:45:13 +0100 Subject: [PATCH 3/3] Update macros/serverless/difference-jobs-functions-containers.mdx --- macros/serverless/difference-jobs-functions-containers.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/serverless/difference-jobs-functions-containers.mdx b/macros/serverless/difference-jobs-functions-containers.mdx index 065b8ca3fc..759a80b8aa 100644 --- a/macros/serverless/difference-jobs-functions-containers.mdx +++ b/macros/serverless/difference-jobs-functions-containers.mdx @@ -18,7 +18,7 @@ macro: difference-jobs-functions-containers | **Scaling** | Automatically scales based on incoming events | Automatically scales based on incoming events | Manually specified number of job executions | | **Maximum execution time** | Up to 15 minutes per request | Up to 15 minutes per request | 24 hours | | **Concurrency** | Single request per instance | Configurable concurrency per instance | Not applicable | -| **Pricing model** | Pay based on exeuction time and invocations | Pay based on vCPU and memory usage | Pay based on vCPU and memory usage | +| **Pricing model** | Pay based on execution time and invocations | Pay based on vCPU and memory usage | Pay based on vCPU and memory usage | | **Triggers** | HTTP requests, scheduled (CRONs), messaging events (NATS, SQS, SNS) | HTTP requests, scheduled (CRONs), messaging events (NATS, SQS, SNS) | Manual invocation or scheduled | | **Language support** | Node, PHP, Python, Go, Rust | Any language/runtime within a container | Any language/runtime within a container | | **Infrastructure management** | Fully managed, handles provisioning and scaling automatically | Fully managed, handles provisioning and scaling automatically | Fully managed, abstracts away infrastructure management |