0

I'm evaluating ArangoDb+Foxx for a multi-tenant application.

Currently I have a coordinator service in _system that creates new databases and installs a single service into that db that bootstraps it and serves as the api layer.

Are there optimization concerns with having one monolithic Foxx service that handles an entire api stack? Or is it better to split it up into many smaller services so requests can be spread to different V8 contexts?

Finally, with a service or even many services per db/tenant, do you now need to update every single service for every tenant when you need to update? That sounds like a lot of room for error and bugs when you try to apply rolling or blue/green deployment. Is there a better way of handling multi-tenant apps with Foxx in a cluster? Perhaps a single service at the _system level?

Thanks!

Jonathan Dumaine
  • 5,575
  • 3
  • 38
  • 50

1 Answers1

0

A Foxx service can host an entire layer / stack for a single tenant. The question if it is a good idea is for me less a per tenant consideration per se but more that of functional unity. Having said that, your authentication plans, as far as they are hosted in arangodb might also play a role. Single sign on and contrary models may also push you into artificial separations.

Your worries about the complexity and the resulting error proneness don't sound manageable, if rolled out through established means for complex applications. Good test coverage should be easily detecting those errors. I also think that the same errors can happen both with a widely distributed application and a more concentrated one, or monolithic as you put. But upgrading strategies should definitely be part of the planning, if you think that different parts could remain unchanged while others are expected to be upgraded more often, it might make sense to keep them apart.

TLDR: there is no principal underlying mechanism, that would force you one way or the other. As a guide I think that you should be able to explain your decisions to a third.

Kaveh Vahedipour
  • 3,412
  • 1
  • 14
  • 22
  • "there is no principal underlying mechanism, that would force you one way or the other" Except for the fact that _system services can't call `useDatabase()` ? – Jonathan Dumaine Jun 20 '18 at 19:21