Best Stack for Multi-Threaded Batch Tasks in Python?

0
7
Asked By CuriousCoder42 On

Hey folks! I'm transitioning from a Java environment, where we currently use a Spring Boot batch process to handle millions of users. We're thinking about moving this to Python and I want your suggestions on the best architecture or stack to handle our needs. Here's how our existing system operates: it connects to all major databases and has individual servers that pull in batches of 100 to 1,000 users at a time. We have a thread pool so each user gets processed by its own thread, and once done, messages are pushed to RabbitMQ or Kafka. I'm aware Python has its quirks with CPU-bound multithreading, but I know there are alternatives, like multiprocessing. I'm looking for guidance on the Python ecosystem as we make this switch!

5 Answers

Answered By PythonPal88 On

If you're pulling from a database, consider structuring your tasks to assign batches to separate processes. This approach maximizes performance. Also, integrating a master node to fetch data and dispatch it through RabbitMQ could streamline your workflow.

Answered By TechieTom On

Why switch to Python at all? If your Java system is effectively handling these tasks, it might be worth staying put unless absolutely necessary. Python has its advantages, but expect some sacrifices, especially with concurrency.

Answered By CodeNinja123 On

Celery with RabbitMQ seems like a solid choice for managing your tasks. It’s widely used and fits well within the Python ecosystem. Just keep in mind that Celery can get a bit clunky for complex workflows, but for straightforward tasks, it should serve you well.

Answered By BackendBeast On

Dramatiq is a great alternative if you want something lightweight and easier to configure than Celery. It’s been effective for my team at scale without the bloat Celery has.

Answered By CloudGuru9 On

If you're considering the cloud, leveraging serverless functions with something like GCP Cloud Pub/Sub could ease the transition while allowing gradual migration, keeping your current Java processing in the mix initially.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.