GRPC client get all streams


Is there a way to get all the streams that exist in the database?
I’m using the grpc client they have added to the v20 version.
I know you have the grpc call get all the events happen over all the streams:

await _eventStoreClient.ReadAllAsync(Direction.Forwards, Position.Start);

But I would like to replay all the streams related to a single type.
This to create a read-only database, that stores the current status, based on the events that have happend.
I can’t filter on stream name because it contains the unique key of the obejct.

Or is the only way to do it by looping through all the events returned by ReadAllAsync?
And ignore the ones that don’t apply to my object?

If you store multiple streams based on different types this may cause performance issues because have to loop though all the events over all the stream.

Example I have created the following streams: ToDo-1, ToDo-2, ToDo-3, Task-1, Task-2, Task-3,…
I want to replay all the events related to ToDo items (ToDo-1, ToDo-2, ToDo-3,…).
The key are build using {object-name}-{Guid} but for my example here I used id’s

Thanks in advance!

It’s not really specific to gRPC, the $streams stream populated by the $streams system projection contains the list of all streams (

In the old days, we used the category projection for it.

With 20.6, we recommend using the server-side filtering, because any projection multiply reads and it degrades the database performance.

1 Like