Skip to content

Commit f16247d

Browse files
committed
note on horizontal scalability
1 parent 43d6b90 commit f16247d

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

doc/developer/design/20250717_a_small_coordinator_more_scalable_isolated_materialize.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ For SELECT, the required interfaces and commands are:
228228
`StorageCollections` (exists, from [design: decoupled storage
229229
controller](20240117_decoupled_storage_controller.md))
230230

231+
We need the `Catalog` for resolving objects in the query, the `TimestampOracle`
232+
for selecting a query timestamp, and the controllers for acquiring read holds
233+
and actually setting off the peek.
234+
231235
The workflow after those changes looks like this. The work is "pushed out" from
232236
the main loop to the frontend (which already has a task/thread per connection)
233237
and the controller. Much less time is spent on the coordinator main loop:
@@ -274,7 +278,7 @@ SELECT processing as the workload where we want to reduce command processing
274278
time/count. Additionally, because they are low-hanging fruit, we should take
275279
the rest of controller processing off the Coordinator main loop.
276280

277-
We initially have these tasks which can be worked on concurrently:
281+
We propose these tasks which can be worked on concurrently:
278282

279283
1. Move SELECT processing to the frontend.
280284
2. Remove remaining places where the compute controller needs processing on the
@@ -286,6 +290,36 @@ We initially have these tasks which can be worked on concurrently:
286290

287291
Then we reassess pressing issues and continue shrinking the Coordinator.
288292

293+
## A Note on Horizontal Scalability and Use-Case Isolation
294+
295+
This proposal does not aim at working on horizontal scalability of
296+
`environmentd` but we think it is an incremental step towards that. Pushing
297+
processing out of the Coordinator and into the frontend will make us put in
298+
place the interfaces that are needed for processing queries and will make the
299+
code more amenable to running in concurrent processes.
300+
301+
Taking the example of processing SELECTs from above, together with a good dose
302+
of hand waving, we argue that none of the required clients/interfaces will need
303+
a central coordinator: anyone with a persist client can read and write the
304+
Catalog, the distributed timestamp oracle is a "thin client" of CRDB right now
305+
and so can also be invoked from anywhere.
306+
307+
As a strawman sketch, we could now put one cluster-specific `environmentd` in
308+
front of every cluster. The controllers running within are only responsible for
309+
replicas of its cluster and it could serve peeks from its cluster. It could
310+
also execute DDL and any other command that don't involve clusters, but not
311+
queries that would require talking to another `environmentd`'s cluster
312+
replicas.
313+
314+
One wrinkle with the above is that the Catalog Client/Coordinator code cannot
315+
currently act on Catalog changes that it discovers from other writers, but that
316+
is achievable with a good amount of elbow grease.
317+
318+
There are more thorough arguments for this in the already mentioned [a logical
319+
architecture for a scalable and isolated
320+
Materialize](20231127_pv2_uci_logical_architecture.md).
321+
322+
289323
## Alternatives
290324

291325
An alternative is keeping the Big Coordinator and investing more into staged

0 commit comments

Comments
 (0)