4 ms·
Stored procedures can also be a great way to scale out transactional workloads. In Citus (a sharding extension for Postgres by Microsoft) we recently introduce
by mslot 7y ago
Stored procedures can also be a great way to scale out transactional workloads.
In Citus (a sharding extension for Postgres by Microsoft) we recently introduced a stored procedure call delegation feature.
If your tables are distributed by person_id and you have a stored procedure that takes person_id as a parameter, you can run e.g. "SELECT create_distributed_function('lineitem_add', 'person_id')". The procedure calls for a given person_id value will then be fully delegated to the PostgreSQL server that stores the data for that person_id without additional round-trips between statements or distributed planning overhead. It'll "magically" take care of procedures that access data from other servers as well.
I realize we're basically going full circle to PL/Proxy, except in Citus almost everything else (distributed queries, DML, DDL, transactions) works as well.