spicedb icon indicating copy to clipboard operation
spicedb copied to clipboard

Read replica support for Postgres and MySQL datastores

Open josephschorr opened this issue 1 year ago • 6 comments

josephschorr avatar Apr 25 '24 20:04 josephschorr

Just to clarify, this update will allow spice to use multiple reader nodes for postgres and mysql? So if I have 3 readers I would be able to pass in the entries for all of them to be used?

benny-yamagata avatar May 02 '24 02:05 benny-yamagata

@benny-yamagata Yes, the replica URI parameter is a list of URIs and the system will round robin between them

josephschorr avatar May 02 '24 03:05 josephschorr

I don't think the implementation will work for that more common use case because the datastore snapshot reader does not use a single transaction.

It uses a single connection, which means it should stay connected to the same replica

josephschorr avatar May 02 '24 15:05 josephschorr

It uses a single connection, which means it should stay connected to the same replica

I possibly just missed it, but it looked like you were using a pgxpool.Conn for the read replicas which cycles actual connections out from under itself.

ecordell avatar May 02 '24 17:05 ecordell

It uses a single connection, which means it should stay connected to the same replica

I possibly just missed it, but it looked like you were using a pgxpool.Conn for the read replicas which cycles actual connections out from under itself.

Yeah, I traced it and it does use the pool. We'll have to do something else

josephschorr avatar May 02 '24 17:05 josephschorr

Updated

josephschorr avatar Jun 26 '24 16:06 josephschorr

Updated

josephschorr avatar Jul 01 '24 16:07 josephschorr