Giter Site home page Giter Site logo

Comments (2)

Allgoodnamesargone avatar Allgoodnamesargone commented on June 3, 2024

Same concerns here.
Even thought using redis speed-up the queue, when you imagine of having 1k tenants that they have thousand queues each, things will not work as it would in a non multi-tenancy project/website.

Let's make an example possible case where there are 1k tenants that each has 50 queue items which is not far from real world project. There will 50k queue items in the redis db and one queue worker! of course we can make the queue worker to execute multiple queue items at the same time, but how much FR? 1k concurrents? And it is still a big mess regarding queue orders per tenant.

The best and the implementation that a multi-tenancy package/project needs to have, in my opinion, is queue and queue processor per tenant, dedicated for each tenant. not shared. however, still with one worker process to keep the server's resources usage as low as possible, not one process per tenant.

While i was writing this and thinking more and more on this, i found out that the current implementation might be the best and the only possible way while there are known issues too!

from tenancy.

stancl avatar stancl commented on June 3, 2024

I don't think this is fundamentally different from single-tenant apps in any way. It's the same problem of queue scaling.

It doesn't matter if you have 50 jobs from 1k tenants, or if you have one app that dispatches 50 000 jobs.

I think the solution is to just add more queue workers. I don't think queue per tenant is a good idea because in your example you'd have to manage 1000 queue workers that are fully coupled to the tenant and would need to be managed as such — create a worker when a tenant is added, delete a worker when a tenant is removed etc.

It's probably best to treat this the same as a single-tenant app — just add more queue workers as your queue volume grows.

from tenancy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.