Rest API with multi-tenant database separated by client

后端 未结 2 1815
醉梦人生
醉梦人生 2021-02-03 09:57

I have a multi-tenant database with the composite key

clientId - docId

The routing looks like this

/api/controller/clientId/doc         


        
2条回答
  •  轮回少年
    2021-02-03 10:45

    Mark's approach is completely valid, however, I happen to use /tenant/docid because each tenant has a different database. If you don't include tenant in the URI then it would be a real pain trying to decide which database to connect to and hunt for the document.

提交回复
热议问题