Dgraph is an open source, low-latency, high throughput, and distributed graph database. Designed to easily scale to meet the needs of small startups as well as large companies with massive amounts of data, Dgraph can handle terabytes of structured data running on commodity hardware with low latency for real time user queries. It’s available under the Apache 2.0 license for easy adoption.
Written entirely in Go, Dgraph is built to embrace simplicity and robustness. To keep these intact, maintaining code quality is one of the essential measures. The team had been using a code quality tool to keep everyone aligned. But due to limitations like lack of workflow integration, limited category of issues reported and a few others, it wasn’t serving the purpose.
When Dgraph’s founder saw the issues DeepSource’s Go analyzer was able to detect, he soon onboarded his engineering team to evaluate the tool. DeepSource’s native integration with GitHub and the way quality checks fit in the code review workflow, led to quick adoption across.
Within a few days, Martin Martinez, Distributed Systems Engineer at Dgraph and one the team members, noticed the value DeepSource was bringing and further added it to their related Go projects — Badger (key-value store) and Ristretto (highly performant cache).
Today, Dgraph uses DeepSource effectively to detect critical issues across categories like bug risks, anti-patterns, performance issues, security flaws and not just style and formatting warnings. Additionally, since each issue detected by DeepSource is tagged with the category it belongs to, the developers quickly prioritize which one to address first.
Few instances of the issues detected:
Earlier, the code quality tool Dgraph was using needed manual effort to run analysis. This becomes a tedious task when you are creating close to 30 pull requests per developer every week.
With DeepSource, Dgraph’s code review is now streamlined. DeepSource checks fit right into the code review workflow. The team sees the status of their pull request directly as a GitHub check within a few seconds of creating them. This way every PR is automatically analyzed before the code is merged. DeepSource’s pre-merge checks act as a gatekeeper preventing issues from entering the codebase. “DeepSource has helped decrease the amount of technical debt since it analyzes every GitHub PR”, says Martin, after seeing developers regularly resolve issues flagged and the positive impact of this on code quality.
Dgraph’s engineering team is continuously rolling out fixes, features, new versions. In such a fast-paced cycle, maintaining consistency and best practices across the codebase gets difficult. Moreover, they can neither afford the time-intensive code review loops nor the risk of missing issues.
That’s where DeepSource adds value. Martin says,
Our dedicated analyzer team adds new issues regularly and keeps an eye on false positive reports as well. This has helped Dgraph team in two ways:
Dgraph has been using DeepSource since October 2019. The team has grown to adopt DeepSource as their go-to code quality tool. Dgraph uses DeepSource to identify issues in their pull request, merge cleaner code every time, and reduce the risk of code breaking in production. Till date, DeepSource has helped
It takes couple of minutes to setup. You can sign up with your GitHub or GitLab account and start analysis or request a demo to have a closer look and understand how DeepSource can be useful for your use case.