[sqlalchemy] Re: Custom secondary relation with composite primary keys

2020-04-26 Thread Alex Plugaru
Hi John, Composite primary keys: id + account_id is for multi-tenancy and consistent and efficient indexes/joins. Multiple customers use the same postgres database and to the split of their data, the most efficient way that I know is to add a tenant id (in our case it's account_id) for each

[sqlalchemy] Re: Custom secondary relation with composite primary keys

2020-04-26 Thread John Walker
Hello Alex, This is super old, so I don't have a lot of hope. But I'm wondering if you could explain a line in your example text. I'm trying to figure out if I need a data model similar to yours, but I'm not sure. Could you explain the datamodel/biz requirements reasoning behind this quote