Azimutt is a Next-Gen ERD that allows you to Design, Explore, Document and Analyze your database. What is an ERD, you ask? ERD stands for Entity Relationship Diagram. Because, yes, you can have (virtual) entity relationships in a document database. A picture being better than a thousand words, here’s the kind of result you can achieve by connecting a database to Azimutt.
So how does it work with Couchbase? Right now, you cannot directly connect your cluster to it, you need to export an Azimutt schema from your cluster, but it’s pretty straightforward.
You need your username, password , connection URL and a command line terminal. If you don’t have an instance on hand, you can quickly get one up and running with our free trial on cloud.couchbase.com. While writing this post I created a new user who only has access to the travel-sample bucket that should be automatically imported when creating a new trial.
In your terminal, run:
npx azimutt export couchbase "couchbases://userName:P4ssword@cb.zw-scs3n3uw-t7ww.cloud.couchbase.com" --output travel-sample.json
This command browses all your buckets, scope and collections, gets some document samples from them, and creates an inferred schema from these documents. You can specify exactly which bucket to export with the –bucket parameter. Take a look at the complete list on the associated npm page.
The output produces a JSON file containing something like:
The export might encounter issues if you don’t have a primary index on every namespace being imported. For instance, there’s no primary index for the tenant_0X scopes of the travel-sample, but we can ignore that.
From there, you are ready to go to azimutt.app and create your account (and take a look at the full list of features while you are there). This is what I see when logging in with my GitHub account:
From there you can create a new project. As we saw earlier, there is currently no way to directly connect your database, which is fine. Instead, click on From JSON and upload your travel-sample.json file generated earlier.
You are now ready to explore your different entity diagrams, document them, add memos, and share them with your colleagues.
I have added the relations myself. So granted, this is more ED than ERD, but you still get a visual overview of your bucket content and the ability to document your data and relationships between entities, even if you cannot enforce them on the schema level like you would with a traditional RDBMS.
There is also support for nested structures, like the reviews.rating field in this screenshot:
If you like what you see and want to support this project, you can vote for them on Product Hunt. They are happy to receive contributions and if you are looking to extend the Couchbase support, there are some interesting tasks available:
- Add relation support by importing existing indexes
- Add support for Key/document metadata in the schema export
- Both these tasks would be implemented in the following file and an issue has been created to track this
- Create a VSCode plugin
- Embed Azimutt in Electron/Tauri
Kudos to the Azimutt team for building such a cool product 🙏They are pretty active and responsive and I had the opportunity to chat with them on their Slack while trying it out.