4 ms·
The Salesforce CRM application somewhat "famously" does not use native DB foreign keys to model most relationships, and has a custom relational integrity and in
by cdcarter 3y ago
The Salesforce CRM application somewhat "famously" does not use native DB foreign keys to model most relationships, and has a custom relational integrity and indexing layer.
Mostly, this is in order to support our complex custom schema functionality, described in the Multitenant Whitepaper here (https://www.developerforce.com/media/ForcedotcomBookLibrary/Force.com_Multitenancy_WP_101508.pdf https://www.developerforce.com/media/ForcedotcomBookLibrary/...)
But interestingly, this also lets our internal data modelers choose to make a relationship e.g. leave dangling records or have other update/delete patterns that are appropriate for the data and data volume. Obviously there are cleanups and tradeoffs required here. It's certainly not a model I'd suggest people start with, but there really are times where database native FKs aren't the answer.
- jamestimmins 3y agoDo you think this has served y'all well in the long term? I assume "internal data modelers" is an actual role of person whose job is to ensure long run data integrity?
- oxfordmale 3y agoSalesforce storage is about 1000 times more expensive than regular storage, so might not be the best example. Data volume and Salesforce also don't belong in the same sentence, as it is not comparable to the data volume a basic Postgres database can handle. Until recently Salesforce didn't provide a data backup facility, other than exporting CSVs, so not even sure you can call it a database.