GitMonitor on Elixir
The engineering team here at GitMonitor has been excited about the Elixir programming language for a while, for multiple reasons. It’s blazing fast, it’s extremely scalable, and it’s very resilient.
Those things make Elixir a great candidate for our rule violation check service. This service processes large amounts of data from git hosting services such as GitHub, and Elixir has allowed us to handle large influxes in requests very easily. And using Erlang’s OTP principles ensures that if something goes wrong for one person, it doesn’t go wrong for everyone.
And today I’m happy to announce that our rule violation check service, written in Elixir, is complete and deployed to production! All new repositories generated in GitMonitor will use the new Elixir endpoints automatically. And for our current customers, the old webhooks URL will reverse proxy to the new Elixir app, so you don’t have to make any changes 2to any of your repositories on GitHub.
In addition to the rule violation check service, we also migrated our notification service to Elixir as well. Now all your Slack & Flowdock notifications, email alerts, and push notifications go through our Elixir codebase as well. You may have noticed that those are two separate microservices, but we are only using one codebase. This is accomplished through the concept of umbrella projects.
Umbrella projects are a way to create multiple applications that may or may not depend on each other. They live in the same Elixir project, and the same git repository. They are simply separated by subfolders, but run as separate applications. It is a really great concept that allows us to have multiple microservices living in the same codebase, while giving us the flexibility to scale each service separately.
The first thing we were able to do after deploying our production Elixir services was downsize the servers running the old Rails services, which obviously is a big money saver for any startup. We were able to get rid of some servers, and downsize the remaining servers.
Response times are down as well. From how long it takes to receive and process a webhook from GitHub, to how long it takes to send notifications of a rule violation, everything is faster.
Development and deployment are also faster. Because everything is housed in one umbrella application, making changes to a specific service or deploying a specific service is now no different than your normal workflow. It’s also fun to learn a new language, and Elixir really helps you think about solving problems in a different way, and our developers love it.
The future of Elixir at GitMonitor
Obviously, we are fans of Elixir, but we’re also fans of being pragmatic as well. We believe in “the right tool for the job”. For example, our website is still running Ruby on Rails, and probably will be for a while. The amount of traffic it receives, compared to the rule violation check service, is very small. And the majority of the use on GitMonitor is passive (you generally don’t come to the website for updates, we push updates out to you).
However, with the performance increases and multiple other wins we’ve seen converting two of our major services to Elixir, it would be hard not to put it at the top of the list for all our new projects moving forward.
Instant email, Slack message & push notification when:
- Any of your protected branches are force pushed to
- Any commits are made directly to protected branches
- A new team member of collaborator is added to the repository
- A pull request is merged with no comments
- A pull request is merged without an “LGTM” comment
- A pull request is merged by an unauthorized user
- A protected file is modified or deleted in any branch