A couple of months ago I wrote about the 5 things to consider when choosing a self-hosted code hosting platform. The question I didn’t answer was whether self-hosted or SaaS code hosting platform is the right way to go. I’ll address the question in this post through insights gathered from our over 10 years of experience in being part of developing and using both SaaS and self-hosted source code management systems. In the article, I refer SaaS as Software as a Service solution that is hosted in public internet and self-hosted as on-premises software that is run behind your firewall.
SaaS software is typically hosted outside your corporate network. In the worst case, it might be hosted even as far as in different continent. When building a development infrastructure, things need to work seamlessly and blazing fast. In feedback speeds related to code hosting it all boils down to what version control system you are using. With Git and Mercurial the distributed model and local operations make most of the operations fast since they are not restricted by network latency. However, when using Subversion, most of the operations require connection to the central server which causes latency to play a large role in user experience.
A long time ago I used to work at a company that had its Subversion repositories hosted in another country. The daily work was tedious and I kept avoiding using such features that required a network connection. Moving to Git or Mercurial would have been an option there, but at that time, there were no proper integrations with the IDE we were using (Oracle NetBeans).
Scalability and redundancy
Typically SaaS code hosting services offer horizontal scalability as one of the obvious benefits. In a rapidly growing organization this is good for not needing to constantly upgrade hardware. Scaling of on-premises code hosting typically requires upgrading to more powerful hardware. The upgrades cause maintenance breaks that could be avoided by using a SaaS code hosting service.
The maintenance breaks, be them planned or unplanned are a thing to consider. Whether hosting your source code behind your firewall or at SaaS service, maintenance breaks mean that the repositories are inaccessible for the duration of the break. Yet again this isn’t that big of a problem with Git and Mercurial, but with SVN you can’t do much while the server is inaccessible. What I have noticed from monitoring the Twitter feeds of some SaaS code hosting services is that even though scheduled maintenance breaks are rare, unscheduled ones do occur once in a while.
Self-hosted code management platforms can be set up to offer both horizontal scalability and redundancy if they support clustering. Deveo for example supports setting up multiple application nodes behind a load balancer. Clustered setup enables zero-downtime upgrades for both the software and hardware as well as scaling the service transparently to the end users. This is crucial in enterprise contexts where the work of hundreds or thousands of developers depends on code hosting services.
Backups and security
Backups are an interesting topic since most SaaS code hosting services tend to promise that they have proven backup mechanisms in place. Still, there are cases such as Code Spaces where a hacker put the whole hosting service out of business, that prove that the code is not safe even though promised. When hosting the code inside your firewall, even with no access to an external network you can’t be 100% sure of security, but you can at least delimit and some of the risks out. Handling backups is, of course, another burden that needs to be taken care of if you plan on setting up code hosting on-premises. I would probably take backups (and companies are) even from my SaaS code hosting just to be sure.
Company policies and legislations
In some environments I have worked in, such as financial institutions and payment processing organizations, the company policies state that the development, including source code, cannot leave a certain network. Some company policies restrict the code being hosted outside a certain geological area. In both of these cases using a SaaS code hosting becomes nearly impossible.
Comparing some of the license costs of SaaS and self-hosted code hosting solutions I concluded they fall into three categories: Self-hosted with support, Self-hosted without support and SaaS with support, with costs ranging respectively. Naturally, when hosting the code on-premises you also need to add the hardware costs to the equation. The costs are subjective to what you get and value, and thus there is no simple answer which of the three options to go for.
If I needed to do the decision choosing between SaaS Subversion hosting and self-hosted Subversion, I would go with the latter in every case. Subversion uses a client-server model that means the usability is much better when the servers are as close to the developers as possible.
With Git and Mercurial, the choice would depend on other factors that were covered. As a rule of thumb for smaller companies that are either using Git or Mercurial such as startups, hosting the code on-premises might cause too much overhead.
How do you host your code? What factors did you consider when choosing a hosting solution?