At my company, we use a separate SVN repository for every component of the system. I can tell you that it gets extremely frustrating. Our build process has so many layers of abstraction.
We do this with Java, so we have a heavy build process with javac compilation, JibX binding compilation, XML validation, etc.
For your site, it may not be a big deal if you don't really "build it" (such as vanilla PHP).
Downsides to splitting a product into multiple repositories
- Build management - I can't just checkout code, run a self-contained build script and have a runnable / installable / deployable product. I need an external build system that goes out to multiple repos, runs multiple inner build scripts, then assembles the artifacts.
- Change tracking - Seeing who changed what, when, and why. If a bug fix in the frontend requires a backend change, there are now 2 divergent paths for me to refer back to later.
- Administration - do you really want to double the number of user accounts, password policies, etc. that need to be managed?
- Merging - New features are likely to change a lot of code. By splitting your project into multiple repositories, you are multiplying the number of merges needed.
- Branch creation - Same deal with branching, to create a branch, you now have to create a branch in each repository.
- Tagging - after a successful test of your code, you want to tag a version for release. Now you have multiple tags to create, one in each repository.
- Hard to find something - Maybe frontend/backend is straightforward, but it becomes a slippery slope. If you split into enough modules, developers may have to investigate where some piece of code lives in source control.
My case is a bit extreme as our product is split across 14 different repos and each repo is then divided into 4-8 modules. If I remember, we have somewhere around 80 or some "packages" which all need to be checked out individually and then assembled.
Your case with just backend/frontend may be less complicated, but I still advise against it.
Extreme examples can be compelling arguments for or against pretty much anything :)
Criteria I would use to decide
I would consider splitting a product into multiple source code repositories after considering the following factors:
- Build - Do the results of building each component merge together to form a product? Like combining .class files from a bunch of components into a series of .jar or .war files.
- Deployment - Do you end up with components that get deployed together as one unit or different units that go to different servers? For example, database scripts go to your DB server, while javascript goes to your web server.
- Co-change - Do they tend to change frequently or together? In your case, they may change separately, but still frequently.
- Frequency of branching/merging - if everybody checks into trunk and branches are rare, you may be able to get away with it. If you frequently branch and merge, this may turn into a nightmare.
- Agility - if you need to develop, test, release and deploy a change on a moment's notice (likely with SaaS), can you do it without spending precious time juggling branches and repos?
Your arguments
I also don't agree with most of your arguments for this splitting. I won't dispute them all because this long answer will get even longer, but a few that stand out:
We have two modules that don't depend between each others.
Non-sense. If you take your backend away, will your frontend work? That's what I thought.
Having source history of both projects in the long term may complicate
things (try searching in the history for something in the frontend
while you have half of the commits that are completely unrelated to
the bug you're looking for)
If your project root is broken into frontend/ and backend/, then you can look at the history of those hierarchies independently.
Conflict and merging (This shouldn't happen but having someone pushing
to the backend will force other developer to pull backend changes to
push frontend changes.) One developer might work only on the backend
but will always have to pull the backend or the other way around.
Splitting your project into different repos doesn't solve this. A frontend conflict and a backend conflict still leaves you with 2 conflicts, whether it's 1 repository times 2 conflicts or 2 repositories times 1 conflict. Somebody still needs to resolve them.
If the concern is that 2 repos means a frontend dev can merge frontend code while a backend dev merges backend code, you can still do that with a single repository using SVN. SVN can merge at any level. Maybe that is a git or mercurial limitation (you tagged both, so not sure what SCM you use)?
On the other hand
With all this said, I have seen cases where splitting a project into multiple modules or repositories works. I even advocated for it once for a particular project where we integrated Solr into our product. Solr of course runs on separate servers, only changes when a changeset is related to search (our product does much more than search), has a separate build process and there are no code artifacts or build artifacts shared.
Best Answer
It really depends on what data it is and should be decided on a case by case basis, perhaps even for individual files. Take a look at the contents of those files. More often than not you can tell what they mean. Stuff like the position and size of the IDE's windows is something you do not want in source control.
But some of the IDE project files are vital project metadata. I don't know Netbeans well, but for eclipse, the .project file tells the IDE what the project's name is, that it's a Java web project, etc. and the .classpath file contains information about source folders and libraries. Some files in the .settings directory can be equally important, e.g. org.eclipse.core.resources.prefs contains information about what encoding should be used for which files.
As project metadata, this stuff very much deserves to be versioned in source control.
Some IDEs can import project metadata from other IDEs. It would be even better to have it in a form that is not tied to a specific IDE.
For Java, there is such a thing: Maven. It imposes strong conventions on the project's structure and allows you to specify project metadata (such as library dependencies) in one point (a file called pom.xml which is in the project's main directory and, of course, in source control). There are plugins which then create IDE project files from the Maven configuration, and others which can automate the project build process, or do just about anything. Sometimes it feels like it makes things unneccessarily complex and it takes some time to learn, but the benefits are generally worth it.