-
Notifications
You must be signed in to change notification settings - Fork 16
Add scalability story to ENSNode self-hosting module #2146
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
tk-o
merged 8 commits into
main
from
docs/2115-add-scalability-story-to-ensnode-self-host-module
May 20, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
054d4bb
Document the ENSNode scalability story
tk-o 99bf448
Add a graphical presentation of a scalable ENSNode deployment
tk-o 283c842
Merge remote-tracking branch 'origin/main' into docs/2115-add-scalabi…
tk-o 4a831fa
Update docs/ensnode.io/src/content/docs/docs/self-host/scalability.mdx
tk-o 6c59d33
Add temporary note on `v1.13` compatility requirements (#2150)
tk-o 3a4b1d3
Apply suggestions from code review
tk-o a645814
Update ENSNode Scalability chart
tk-o 1824ce5
Merge remote-tracking branch 'origin/main' into docs/2115-add-scalabi…
tk-o 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions
40
docs/ensnode.io/src/components/molecules/HostedInstanceSdkVersionWarning.astro
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,40 @@ | ||
| --- | ||
| import { Aside } from "@astrojs/starlight/components"; | ||
|
|
||
| interface Props { | ||
| /** | ||
| * Which SDK(s) the warning is for. | ||
| * - "enssdk": only enssdk | ||
| * - "enskit": both enskit and enssdk (enskit depends on enssdk) | ||
| * - "both": mention both enssdk and enskit, show both install commands | ||
| */ | ||
| for?: "enssdk" | "enskit" | "both"; | ||
| } | ||
|
|
||
| const { for: target = "enssdk" } = Astro.props; | ||
|
|
||
| const isEnskit = target === "enskit"; | ||
| const isBoth = target === "both"; | ||
|
|
||
| const sdkList = isEnskit | ||
| ? "<code>enskit@1.13.1</code> and <code>enssdk@1.13.1</code>" | ||
| : isBoth | ||
| ? "<code>enssdk@1.13.1</code> (and <code>enskit@1.13.1</code> when using React)" | ||
| : "<code>enssdk@1.13.1</code>"; | ||
| --- | ||
|
|
||
| <Aside type="caution" title="Version compatibility with hosted instances"> | ||
| Our hosted ENSNode instances currently run ENSNode v1.13. If you are querying them from your own app, you <strong>must</strong> use <span set:html={sdkList} />. The latest published versions (<code>1.14.0+</code>) contain breaking changes in the Omnigraph API data model not yet deployed to our hosted infrastructure. Use these exact install commands: | ||
|
Comment on lines
+18
to
+27
|
||
|
|
||
|
Comment on lines
+26
to
+28
|
||
| {isBoth ? ( | ||
| <pre>npm install enssdk@1.13.1 | ||
| # or, for React apps: | ||
| npm install enskit@1.13.1 enssdk@1.13.1</pre> | ||
| ) : isEnskit ? ( | ||
| <pre>npm install enskit@1.13.1 enssdk@1.13.1</pre> | ||
| ) : ( | ||
| <pre>npm install enssdk@1.13.1</pre> | ||
| )} | ||
|
|
||
| This notice will be removed once the hosted instances are upgraded. | ||
| </Aside> | ||
16 changes: 14 additions & 2 deletions
16
docs/ensnode.io/src/components/molecules/IntegrateHostedEnsNodeTip.astro
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 |
|---|---|---|
| @@ -1,13 +1,25 @@ | ||
| --- | ||
| import { Aside, LinkCard } from "@astrojs/starlight/components"; | ||
| import HostedInstanceSdkVersionWarning from "./HostedInstanceSdkVersionWarning.astro"; | ||
|
|
||
| interface Props { | ||
| /** | ||
| * Which SDK the warning should target. Passed through to HostedInstanceSdkVersionWarning. | ||
| * - "enssdk": enssdk-only warning | ||
| * - "enskit": both enskit and enssdk warning | ||
| * - "both": mention both enssdk and enskit, show both install commands (default) | ||
| */ | ||
| for?: "enssdk" | "enskit" | "both"; | ||
| } | ||
|
|
||
| const { for: target = "both" } = Astro.props; | ||
| --- | ||
|
|
||
| <Aside type="tip" title="No backend required"> | ||
| You don't need to run your own ENSNode to follow this guide — the steps below default to a NameHash-hosted instance. Browse the available deployments below. | ||
| </Aside> | ||
| <HostedInstanceSdkVersionWarning for={target} /> | ||
|
Comment on lines
+10
to
+21
|
||
| <LinkCard | ||
| title="Hosted ENSNode Instances" | ||
| href="/docs/hosted-instances" | ||
| /> | ||
|
|
||
|
|
||
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
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
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
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
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
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
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
50 changes: 50 additions & 0 deletions
50
docs/ensnode.io/src/content/docs/docs/self-host/scalability.mdx
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,50 @@ | ||||||
| --- | ||||||
| title: ENSNode Scalability | ||||||
| description: Understand how ENSNode's architecture enables horizontal scaling. | ||||||
| sidebar: | ||||||
| label: Scalability | ||||||
| order: 3 | ||||||
| --- | ||||||
|
|
||||||
| import { LinkCard } from '@astrojs/starlight/components'; | ||||||
|
|
||||||
| ENSNode's architecture achieves effectively limitless horizontal scalability, no matter how large your query demands might be. By separating read / write workloads and making use of PostgreSQL's async replication you can scale your ENSNode deployment to handle any request volumes while continuing to index the latest ENS data without impact to indexing performance. | ||||||
|
|
||||||
| ## Horizontally scale ENSApi | ||||||
|
|
||||||
| The ENSNode architecture naturally separates writes from reads: | ||||||
|
|
||||||
| - **ENSIndexer** is the sole writer to ENSDb. It processes blockchain events and updates the database with the latest ENS state. | ||||||
| - **ENSApi** is a read-only service. It serves GraphQL and REST API requests by querying ENSDb, but never writes to it. | ||||||
|
|
||||||
| This separation insulates ENSIndexer from high request volumes. Whether you serve 10 requests per second or 10,000, the indexing process remains unaffected because ENSApi does not compete with ENSIndexer for database write locks or indexer resources. | ||||||
|
lightwalker-eth marked this conversation as resolved.
lightwalker-eth marked this conversation as resolved.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
|
lightwalker-eth marked this conversation as resolved.
|
||||||
| ## Horizontally Scale ENSDb | ||||||
|
|
||||||
| ENSDb is built on PostgreSQL, which provides mature, production-proven mechanisms for horizontal scaling. The most common approach is **asynchronous replication**: | ||||||
|
|
||||||
| 1. **Primary ENSDb**: ENSIndexer writes to your single ENSDb primary instance. You can fully isolate this ENSDb primary instance from any incoming API requests coming through ENSApi. | ||||||
| 2. **Replica ENSDb**: Configure the asynchronous replication of your primary ENSDb instance to one or more ENSDb read replica instances. | ||||||
| 3. **Read scaling**: Connect your horizontally scaled ENSApi instances exclusively to your ENSDb read replica instances if you wish to fully isolate extreme levels of API request volumes from indexing. | ||||||
|
|
||||||
| Because ENSApi is read-only, it can safely connect to an ENSDb replica without write-routing or write-conflict concerns. The tradeoff is that, with asynchronous replication, replica reads may briefly lag behind the primary. As your query load grows, you simply add more PostgreSQL replicas for the ENSDb primary instance and more ENSApi instances pointing to them. | ||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||
|
|
||||||
| ## Going Massive | ||||||
|
|
||||||
| An ENSNode deployment with _massive_ horizontal scaling might look like this: | ||||||
|
|
||||||
|  | ||||||
|
|
||||||
| - **One ENSIndexer instance** → writes to the ENSDb primary instance | ||||||
| - **One ENSDb primary instance** → replicates asynchronously to `M` replicas | ||||||
| - **Multiple ENSApi instances** → each of `N` instances connected to one of the ENSDb replicas (often load-balanced across replicas) | ||||||
| - **One ENSRainbow instance** → co-located with ENSIndexer instance on the same local network for fast label healing | ||||||
|
|
||||||
| Only the largest ENSNode deployments will need such a complex setup. Still, it's good to know that if you need massive scalability, we have you covered! The ENSNode architecture lets you scale reads independently of writes, matching your infrastructure to your actual traffic patterns. | ||||||
|
|
||||||
| ## Further Reading | ||||||
|
|
||||||
| <LinkCard title="ENSApi Overview" href="/docs/services/ensapi" /> | ||||||
| <LinkCard title="ENSDb Overview" href="/docs/services/ensdb" /> | ||||||
| <LinkCard title="ENSIndexer Overview" href="/docs/services/ensindexer" /> | ||||||
| <LinkCard title="ENSRainbow Overview" href="/docs/services/ensrainbow" /> | ||||||
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
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
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
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 |
|---|---|---|
| @@ -1,5 +1,19 @@ | ||
| # enskit | ||
|
|
||
| The React toolkit for ENSv2 development. Provides typed Omnigraph API hooks, providers, and utilities powered by [`urql`](https://nearform.com/open-source/urql/) and [`gql.tada`](https://gql-tada.0no.co/). | ||
|
|
||
| This package name is reserved for the [ENSNode](https://ensnode.io) project by [NameHash Labs](https://namehashlabs.org). | ||
|
|
||
| For more information, visit [ensnode.io](https://ensnode.io). | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| npm install enskit enssdk | ||
| ``` | ||
|
|
||
| > **Version compatibility:** Our hosted ENSNode instances currently run ENSNode v1.13. If you are querying them from your own app, you **must** use `enskit@1.13.1` and `enssdk@1.13.1`. The latest published versions (`1.14.0+`) contain breaking changes in the Omnigraph API data model not yet deployed to our hosted infrastructure. This notice will be removed once the hosted instances are upgraded. | ||
| > | ||
| > ```bash | ||
| > npm install enskit@1.13.1 enssdk@1.13.1 | ||
|
Comment on lines
+9
to
+18
|
||
| > ``` | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.