Would it not be simpler instead to use explicit table lock when inserting events instead of PositionCounter? It limits performance but I believe result is same as PositionCounter table because it too needs a row level lock
begin;
lock table event;
insert into event ...
commit
Thanks for putting this together, great read!
Working on porting this to YugaByteDB.
Would it not be simpler instead to use explicit table lock when inserting events instead of
PositionCounter
? It limits performance but I believe result is same as PositionCounter table because it too needs a row level lockSimpler? It would be less to setup vs a Position table. In usage it's adding a lock statement vs calling
NextPosition()
in the insert.I suppose you will just have to test for the performance difference between the two.