Need advice about which tool to choose?Ask the StackShare community!

Celery

1.6K
1.6K
+ 1
280
Serverless

1.3K
1.2K
+ 1
26
Add tool

Celery vs Serverless: What are the differences?

Celery vs Serverless

Introduction

In this comparison, we will explore the key differences between Celery and Serverless. Both of these technologies are used for task scheduling and execution in distributed environments. However, they have distinct characteristics that make them suitable for different use cases.

  1. Scalability: Celery is a distributed task queue framework that allows for horizontal scaling by adding more worker nodes. It provides flexibility in terms of scaling up or down based on demand. On the other hand, Serverless computing platforms automatically scale the execution environment up and down based on the incoming request load. This makes Serverless more suitable for applications with unpredictable or bursty workloads.

  2. Execution Environment: Celery requires a separate infrastructure setup with dedicated worker nodes to execute tasks. It relies on a message broker, usually RabbitMQ or Redis, to manage the communication between the task scheduler and workers. In contrast, Serverless platforms provide a managed execution environment where developers can deploy their functions or tasks without the need to manage the underlying infrastructure. This simplifies the deployment process and reduces operational overhead.

  3. Pricing Model: Celery's pricing model is based on the costs associated with infrastructure setup, maintenance, and scaling. Additional costs may arise from managing message brokers and worker nodes. On the other hand, Serverless platforms typically adopt a pay-as-you-go model, where you are billed based on the actual usage of resources during the execution of functions or tasks. This allows for cost optimization, as you only pay for the resources consumed without the need to provision and manage infrastructure.

  4. Programming Language Support: Celery is a Python-based task queue framework, and while it supports other programming languages as well, it is primarily used within the Python ecosystem. Serverless platforms, on the other hand, offer broader support for multiple programming languages, including JavaScript, Python, Java, Go, and more. This makes Serverless more suitable for applications built using different programming languages or a polyglot microservices architecture.

  5. Cold Start Performance: Cold start refers to the delay experienced when initiating a function or task execution due to the need to start up the execution environment. In Celery, since the infrastructure and worker nodes are pre-provisioned, there is no cold start delay. In contrast, Serverless platforms may experience a cold start delay, especially when there is no warm execution environment available. This can impact the overall latency and response times for certain types of workloads.

  6. Flexibility and Control: Celery provides a high degree of flexibility and control over the task execution flow and management. You have fine-grained control over the concurrency, routing, and prioritization of tasks. Serverless platforms, while offering simplicity and ease of use, may have limited configuration options, especially when it comes to fine-grained control over the task execution behavior.

Summary

In summary, Celery offers scalability, customizable task execution, and broader programming language support, while Serverless computing platforms provide automatic scaling, managed infrastructure, pay-as-you-go pricing, and simplicity in deployment. Understanding these key differences is essential to choose the right technology for your specific use case.

Advice on Celery and Serverless
Needs advice
on
CeleryCelery
and
RabbitMQRabbitMQ

I am just a beginner at these two technologies.

Problem statement: I am getting lakh of users from the sequel server for whom I need to create caches in MongoDB by making different REST API requests.

Here these users can be treated as messages. Each REST API request is a task.

I am confused about whether I should go for RabbitMQ alone or Celery.

If I have to go with RabbitMQ, I prefer to use python with Pika module. But the challenge with Pika is, it is not thread-safe. So I am not finding a way to execute a lakh of API requests in parallel using multiple threads using Pika.

If I have to go with Celery, I don't know how I can achieve better scalability in executing these API requests in parallel.

See more
Replies (1)
Recommends
on
rqrqRedisRedis

For large amounts of small tasks and caches I have had good luck with Redis and RQ. I have not personally used celery but I am fairly sure it would scale well, and I have not used RabbitMQ for anything besides communication between services. If you prefer python my suggestions should feel comfortable.

Sorry I do not have a more information

See more
Decisions about Celery and Serverless

When adding a new feature to Checkly rearchitecting some older piece, I tend to pick Heroku for rolling it out. But not always, because sometimes I pick AWS Lambda . The short story:

  • Developer Experience trumps everything.
  • AWS Lambda is cheap. Up to a limit though. This impact not only your wallet.
  • If you need geographic spread, AWS is lonely at the top.
The setup

Recently, I was doing a brainstorm at a startup here in Berlin on the future of their infrastructure. They were ready to move on from their initial, almost 100% Ec2 + Chef based setup. Everything was on the table. But we crossed out a lot quite quickly:

  • Pure, uncut, self hosted Kubernetes — way too much complexity
  • Managed Kubernetes in various flavors — still too much complexity
  • Zeit — Maybe, but no Docker support
  • Elastic Beanstalk — Maybe, bit old but does the job
  • Heroku
  • Lambda

It became clear a mix of PaaS and FaaS was the way to go. What a surprise! That is exactly what I use for Checkly! But when do you pick which model?

I chopped that question up into the following categories:

  • Developer Experience / DX 🤓
  • Ops Experience / OX 🐂 (?)
  • Cost 💵
  • Lock in 🔐

Read the full post linked below for all details

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of Celery
Pros of Serverless
  • 99
    Task queue
  • 63
    Python integration
  • 40
    Django integration
  • 30
    Scheduled Task
  • 19
    Publish/subsribe
  • 8
    Various backend broker
  • 6
    Easy to use
  • 5
    Great community
  • 5
    Workflow
  • 4
    Free
  • 1
    Dynamic
  • 14
    API integration
  • 7
    Supports cloud functions for Google, Azure, and IBM
  • 3
    Lower cost
  • 1
    Auto scale
  • 1
    Openwhisk

Sign up to add or upvote prosMake informed product decisions

Cons of Celery
Cons of Serverless
  • 4
    Sometimes loses tasks
  • 1
    Depends on broker
    Be the first to leave a con

    Sign up to add or upvote consMake informed product decisions

    What is Celery?

    Celery is an asynchronous task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports scheduling as well.

    What is Serverless?

    Build applications comprised of microservices that run in response to events, auto-scale for you, and only charge you when they run. This lowers the total cost of maintaining your apps, enabling you to build more logic, faster. The Framework uses new event-driven compute services, like AWS Lambda, Google CloudFunctions, and more.

    Need advice about which tool to choose?Ask the StackShare community!

    Jobs that mention Celery and Serverless as a desired skillset
    What companies use Celery?
    What companies use Serverless?
    See which teams inside your own company are using Celery or Serverless.
    Sign up for StackShare EnterpriseLearn More

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with Celery?
    What tools integrate with Serverless?

    Sign up to get full access to all the tool integrationsMake informed product decisions

    Blog Posts

    GitHubPythonNode.js+47
    54
    72306
    JavaScriptGitHubPython+42
    53
    21847
    GitHubPythonSlack+25
    7
    3155
    GitHubPythonDocker+24
    13
    17011
    What are some alternatives to Celery and Serverless?
    RabbitMQ
    RabbitMQ gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.
    Kafka
    Kafka is a distributed, partitioned, replicated commit log service. It provides the functionality of a messaging system, but with a unique design.
    Airflow
    Use Airflow to author workflows as directed acyclic graphs (DAGs) of tasks. The Airflow scheduler executes your tasks on an array of workers while following the specified dependencies. Rich command lines utilities makes performing complex surgeries on DAGs a snap. The rich user interface makes it easy to visualize pipelines running in production, monitor progress and troubleshoot issues when needed.
    Cucumber
    Cucumber is a tool that supports Behaviour-Driven Development (BDD) - a software development process that aims to enhance software quality and reduce maintenance costs.
    Amazon SQS
    Transmit any volume of data, at any level of throughput, without losing messages or requiring other services to be always available. With SQS, you can offload the administrative burden of operating and scaling a highly available messaging cluster, while paying a low price for only what you use.
    See all alternatives