Question

I have been recently quite seduced by the 12Factor app as it is strong guidelines I should force myself to follow. So on a project I'm working on currently I have decided to use them. Though I am having a doubt about my code structure:

I have a website that will just create new jobs and people can consult the results of the jobs there. The jobs are queued into a distributed queue (ftm Redis) and workers take each job and execute them. I decided to split the codebase in 2:

  • the actual site which will queue jobs and users will access the result.
  • the workers that are totally autonomous.

There is a node package in the middle which encapsulate the communication (queueing etc) and the only communication between nodes is through Redis.

So I just wanted to be sure that this was still coherent with 12factor as I am building a distributed system. If not should I build everything in one codebase with a launch script which either launch one or the other?

Thx for your help

Était-ce utile?

La solution

Keep it simple, but no simpler then makes sense. If it is simpler for you to keep it all in one codebase start out that way. Development is an iterative process, assume you are doing it wrong and be prepared to change things when they start to get unwieldy.

Premature optimization (or abstraction) of your code (or workflow) is always unwise.

Autres conseils

I decided to split the codebase in 2

Well, the first item on the 12 factors website says "One codebase tracked in revision control, many deploys"

From your description, I don't think it's possible to tell how well you followed the guidelines.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top