Design and Manage Couchbase Databases Visually with DbSchema

DbSchema lets you design, manage, and document Couchbase databases. Create ER diagrams, define tables and columns, and generate SQL scripts - with or without a live database connection.

Use Git to share the design, compare it with the Couchbase database, and deploy changes. DbSchema also includes a data editor, query builder, and HTML5 documentation - everything you need in one tool.

DbSchema Database Designer

Download DbSchema Download Couchbase JDBC Driver

Bucket, Scope, and Collection Hierarchy

Couchbase is a distributed multi-model database that blends document storage, key-value access, and a full SQL query language called N1QL into a single platform. Data is organized into a three-level hierarchy: buckets represent the top-level storage unit with its own memory quota and replication settings, scopes provide a logical namespace within a bucket, and collections hold the actual JSON documents. DbSchema connects via the Couchbase JDBC driver and introspects this hierarchy, rendering scopes and collections as a schema diagram. You can visualize the inferred JSON field structure for each collection, annotate field descriptions, and produce documentation that captures the data model at every level of the hierarchy.

Writing N1QL SQL Queries in the SQL Editor

N1QL is Couchbase's SQL++ dialect that extends standard SQL to operate on JSON documents, supporting nested path expressions, UNNEST for arrays, and USE KEYS for primary-key lookups. DbSchema's SQL editor connects over the N1QL query service and provides auto-completion for bucket, scope, and collection names as well as inferred field paths. You can write joins across collections, aggregate nested arrays with UNNEST, and use Couchbase's Index Advisor recommendations directly from within DbSchema. Results are displayed in a tabular grid that flattens nested JSON for easy reading, with the ability to copy rows or export them to CSV.

Writing N1QL SQL queries against Couchbase collections in DbSchema SQL editor

Exploring Document Collections and JSON Structure

The DbSchema data explorer lets you browse Couchbase collection contents without writing N1QL. You can apply filter predicates to restrict the result set, page through large collections, and inspect the JSON field structure for any document row. This is invaluable when validating that application writes are producing the expected document shape or when debugging data quality issues in a specific scope. The explorer respects Couchbase's RBAC permissions, showing only the collections and fields that the connected user is authorized to access.

Browsing Couchbase JSON document collections in DbSchema data explorer

Connection Setup and JDBC URL

To connect DbSchema to Couchbase, register the Couchbase JDBC driver (com.couchbase.jdbc.CouchbaseDriver) in DbSchema's driver manager. The JDBC URL format is jdbc:couchbase://localhost:8093, where port 8093 is the default port for the Couchbase Analytics service — JDBC connectivity requires the Analytics Service to be enabled on the cluster. Provide a Couchbase username and password with the necessary RBAC roles in the connection dialog. For production clusters, use the node hostname or load-balancer address instead of localhost. Cross-datacenter replication (XDCR) is configured separately in the Couchbase web console and does not affect JDBC connectivity.

Couchbase bucket and collection hierarchy visualized as a schema diagram in DbSchema

Why Teams Use DbSchema with Couchbase

  • Visualize the full bucket → scope → collection hierarchy in a schema diagram to document multi-tenant Couchbase deployments.
  • Write and test N1QL queries with UNNEST, nested paths, and joins in the SQL editor before embedding them in application code.
  • Explore inferred JSON field structures for each collection to understand document shapes without reading application source code.
  • Generate schema documentation that captures collection field types and relationships for developer onboarding.
  • Use DbSchema's offline model to design new Couchbase collection schemas and share them for team review before deployment.
  • Connect to multiple Couchbase environments (development, staging, production) from a single DbSchema project file.