-
Notifications
You must be signed in to change notification settings - Fork 302
Documentation and announcement blog for relationship queries #2738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/routes/blog/post/announcing-relationship-queries/+page.markdoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| --- | ||
| layout: post | ||
| title: "Announcing relationship queries: Filter across related data with ease" | ||
| description: You can now use filter queries directly on relationship columns, plus enjoy up to 18x faster relationship performance across the board. | ||
| date: 2026-02-06 | ||
| cover: /images/blog/announcing-relationship-queries/cover.png | ||
| timeToRead: 5 | ||
| author: jake-barnby | ||
| category: announcement | ||
| featured: false | ||
| --- | ||
|
|
||
| If you've worked with relationships in Appwrite, you've likely run into two pain points: they presented performance challenges, and you couldn't query across them. If you wanted to find all posts by a specific author or all orders containing a certain product, you had to fetch everything and filter in your application layer. | ||
|
|
||
| Both of those problems are now solved. | ||
|
|
||
| As of today, Appwrite Databases supports **filter queries on relationship columns** and delivers a **12-18x performance improvement** for relationship operations. Relationships are no longer just a way to connect data, they're now a fast, queryable foundation you can build on with confidence. | ||
|
|
||
| # Querying relationships | ||
|
|
||
| You can now use filter queries directly against relationship columns using dot notation. Reference fields on related rows with the format `relationshipKey.field`, and Appwrite handles the rest. | ||
|
|
||
| ```js | ||
| const { Client, TablesDB, Query } = require('node-appwrite'); | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') | ||
| .setProject('<PROJECT_ID>'); | ||
|
|
||
| const tablesDB = new TablesDB(client); | ||
|
|
||
| // Get all posts where the author's name is 'Jake' | ||
| await tablesDB.listRows({ | ||
| databaseId: 'blog', | ||
| tableId: 'posts', | ||
| queries: [ | ||
| Query.equal('author.name', ['Jake']) | ||
| ], | ||
| }); | ||
| ``` | ||
|
|
||
| All [comparison operators](/docs/products/databases/queries#comparison) are supported, including `equal`, `notEqual`, `greaterThan`, `lessThan`, `between`, `contains`, and the full set of spatial queries. | ||
|
|
||
| # 12-18x faster relationship performance | ||
|
|
||
| Alongside query support, we've overhauled the internals of how relationships are resolved, delivering a consistent **12-18x speed improvement** for relationship operations. | ||
|
|
||
| Whether you're loading a user's posts, an order's line items, or a project's team members, the response comes back faster across the board. | ||
|
|
||
| These performance gains apply automatically. There's nothing to configure or opt into. If you're already using relationships, they just got faster. | ||
|
|
||
| # What this unlocks | ||
|
|
||
| With queryable, high-performance relationships, you can now build patterns that were previously impractical: | ||
|
|
||
| - **Filtered views across tables:** Show all articles by authors in a specific country, or all products in a category with stock above zero. | ||
| - **Search with context:** Find users whose organization matches a criteria, without fetching and filtering client-side. | ||
atharvadeosthale marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - **Dashboards and reports:** Aggregate and filter data across related tables directly in your queries. | ||
| - **Faster applications:** Reduced response times mean snappier UIs, especially for pages that load multiple levels of related data. | ||
|
|
||
| # Availability | ||
|
|
||
| Relationship queries and performance improvements are available now on both **Appwrite Cloud** and **self-hosted**. | ||
|
|
||
| If you've been working around the limitations of relationships, now is a great time to revisit your data model. Queries across relationships and dramatically faster performance make them a first-class tool for building connected, real-world data structures. | ||
|
|
||
| # More resources | ||
|
|
||
| - [Read the relationships documentation](/docs/products/databases/relationships) | ||
| - [Learn about queries in Appwrite Databases](/docs/products/databases/queries) | ||
| - [Announcing opt-in relationship loading](/blog/post/announcing-opt-in-relationship-loading) | ||
| - [Announcing API for spatial columns: Build scalable location-aware apps with ease](/blog/post/announcing-spatial-columns) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.