Multi-tenancy query

540 views
Skip to first unread message

icross

unread,
Dec 14, 2011, 9:05:01 AM12/14/11
to Quartz.NET
Hi guys,

Apologies if this is an old question. I have seem some mention of
this, but I'm still not confident of the right approach yet.

We're exploring the use of Quartz.NET however we have a multi-tenant
application with one database per tenant. We would like to duplicate
the Quartz.NET tables for each tenant into each database so that the
jobs etc. are physically seperated just like the rest of the tenant's
data.

The application we are running is based on ASP.NET and DDD. The middle
tier is shared among tenants and uses NHibernate to connect to
multiple databases (one per tenant). We assume we will need a Windows
Service to manage the schedule and connect to the ADO Job Store(s). Is
it possible for one Windows Service to do work for multiple stores?
ideally the Windows Service would be passed a collection of connection
strings telling it what stores to communicate with. Then it will
initiate the job and we will make sure somehow that the Job instance
is matched up to the right tenant.

BTW, we're happy to use Quartz.NET 2.0 if that helps and our code is
based on .NET 4.0.

Thanks in advance... if Quartz.NET is not the right way to go, that's
ok too. Just keen to find out before we get too far in.

Kind regards,

Ian

Jason Meckley

unread,
Dec 14, 2011, 4:41:05 PM12/14/11
to quar...@googlegroups.com
Quartz has the concept of clustering, but i don't think that applies to multi-tenant applications.
You may be able to implement your own connection builder/manager but I haven't looked into the source code that much to if
1. it's possible
2. how much work it takes.

one thing to consider is that quartz is designed to run on a pre-defined number of threads. if all your tenants are using a single instance of Quartz then everyone funnels through these threads.
if you want each tenant to have their own set of threads, then you would need to run separate instances of the scheduler.

Nathan Baulch

unread,
Dec 14, 2011, 9:27:04 PM12/14/11
to quar...@googlegroups.com
It's certainly possible but it does involve creating a lot of MBR wrappers if you want a single host scheduler and AppDomain isolated tenants.
The current project I'm working on does exactly this. An AppDomain is created for each tenant with a remote IJobFactory (for job instantiation) and IJobStore (for state persistence) injected into each. The host keeps track of tenant jobs and triggers by associating them with a unique group name for each tenant.

Todd Mueller

unread,
May 10, 2012, 5:54:16 PM5/10/12
to quar...@googlegroups.com
Hi Ian,

I am trying to do the same thing with Quartz and Multi-Tenancy with each tenant running their own database. Did you find out more on an approach for this? I would live to hear more about what you might have found.

Todd

Todd Mueller

unread,
May 10, 2012, 5:55:06 PM5/10/12
to quar...@googlegroups.com
Hi Nathan,

Were you able to get your project working based on what you described? I would love to hear more about it as I am trying to do the same thing.

Todd
Reply all
Reply to author
Forward
0 new messages