|
10 | 10 |
|
11 | 11 | ## Contents |
12 | 12 |
|
13 | | -<!-- regenerate TOC with `rake format:toc` --> |
| 13 | +<!-- regenerate TOC with `rake toc` --> |
14 | 14 |
|
15 | 15 | <!-- toc --> |
16 | 16 |
|
|
19 | 19 | * [1.2 High-level implementation](#12-high-level-implementation) |
20 | 20 | * [1.3 Concepts](#13-concepts) |
21 | 21 | * [1.4 Prior Art](#14-prior-art) |
| 22 | + * [1.5 Shared state (WIP)](#15-shared-state-wip) |
22 | 23 | - [2. Application Configuration](#2-application-configuration) |
23 | 24 | * [2.1 The Default Configuration](#21-the-default-configuration) |
24 | 25 | * [2.2 Configuring the Database](#22-configuring-the-database) |
@@ -127,6 +128,17 @@ In December 2020, [Rails 6.1 was released](https://guides.rubyonrails.org/6_1_re |
127 | 128 | In early 2025, Julik Tarkhanov published a [tenanting implementation named "Shardine"](https://blog.julik.nl/2025/04/a-can-of-shardines) that uses the Rails sharding API. However, it also provided very limited integration with the rest of the Rails framework. |
128 | 129 |
|
129 | 130 |
|
| 131 | +### 1.5 Shared state (WIP) |
| 132 | + |
| 133 | +- when we talk about "integration with the rest of rails" we're talking about Rails' assumptions about shared state |
| 134 | +- some of these assumptions are now busted |
| 135 | + - database ids are no longer unique |
| 136 | + - global ids are no longer global |
| 137 | + - cache is no longer global |
| 138 | + - cable channels are no longer global |
| 139 | + - jobs are no longer global |
| 140 | + |
| 141 | + |
130 | 142 | ## 2. Application Configuration |
131 | 143 |
|
132 | 144 | This gem offers an "omakase" configuration that specifies: |
@@ -384,19 +396,10 @@ TODO: |
384 | 396 |
|
385 | 397 | Documentation outline: |
386 | 398 |
|
387 | | - - configuring either tenant-by-subdomain or a tenant-by-root-path-element |
388 | | - - fragment cache disambiguation |
389 | | - - global id disambiguation |
390 | | - - invalid characters in a tenant name |
| 399 | + - invalid characters in a tenant name (which is database-dependent) |
391 | 400 | - and how the application may want to do additional validation (e.g. ICANN subdomain restrictions) |
392 | 401 | - `#tenant` is a readonly attribute on all tenanted model instances |
393 | 402 | - `.current_tenant` returns the execution context for the model connection class |
394 | | -- talk a bit about busted assumptions about shared state |
395 | | - - database ids are no longer unique |
396 | | - - global ids are no longer global |
397 | | - - cache is no longer global |
398 | | - - cable channels are no longer global |
399 | | - - jobs are no longer global |
400 | 403 | - and what we do in this gem to help manage that "current tenant" state |
401 | 404 | - logging |
402 | 405 | - SQL query logs |
|
0 commit comments