@@ -228,6 +228,10 @@ For SELECT, the required interfaces and commands are:
228
228
` StorageCollections ` (exists, from [ design: decoupled storage
229
229
controller] ( 20240117_decoupled_storage_controller.md ) )
230
230
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
+
231
235
The workflow after those changes looks like this. The work is "pushed out" from
232
236
the main loop to the frontend (which already has a task/thread per connection)
233
237
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
274
278
time/count. Additionally, because they are low-hanging fruit, we should take
275
279
the rest of controller processing off the Coordinator main loop.
276
280
277
- We initially have these tasks which can be worked on concurrently:
281
+ We propose these tasks which can be worked on concurrently:
278
282
279
283
1 . Move SELECT processing to the frontend.
280
284
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:
286
290
287
291
Then we reassess pressing issues and continue shrinking the Coordinator.
288
292
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
+
289
323
## Alternatives
290
324
291
325
An alternative is keeping the Big Coordinator and investing more into staged
0 commit comments