Data modeling - sgml/signature GitHub Wiki
| Platform | Parent Object | Child Object | Grandchild Object | Stored Value | Relationship Implementation | Custom Object Limitations |
|---|---|---|---|---|---|---|
| Salesforce | Foo__c | Bar__c | Baz__c | "bop" | Lookup fields: Bar__c → Foo__c, Baz__c → Bar__c | Limited to 2,000 custom objects per org; lookups can become complex; querying nested hierarchies requires SOQL joins and may hit governor limits |
| HubSpot | Foo (Custom Object) | Bar (Custom Object) | Baz (Custom Object) | "bop" | Association API: Bar associated to Foo, Baz associated to Bar | Only 10 custom objects per account; associations are flexible but not deeply relational; reporting across multiple levels is limited |
| CiviCRM | Table: foo | Table: bar | Table: baz | "bop" | Foreign keys: bar.foo_id → foo.id, baz.bar_id → bar.id | No hard cap on tables, but schema changes require database admin; custom groups/fields can become unwieldy; querying serialized data is inefficient |
| Postgres | Table: foo | Table: bar | Table: baz | "bop" | Foreign keys: bar.foo_id → foo.id, baz.bar_id → bar.id OR native JSONB column with nested structure | No practical limit on tables; JSONB allows direct nested storage and indexing; complexity arises in designing hybrid relational + JSONB queries |
+=========================================================================+
| M O D E L L A Y E R |
+=========================================================================+
SUITECRM CIVICRM
-------- --------
+-----------------------------+ +--------------------------------+
| M: Model Override Points | | M: Model Override Points |
+-----------------------------+ +--------------------------------+
| SugarBean.php [C] | | DAO/<Entity>.php [M] |
| BeanFactory.php [C] | | BAO/<Entity>.php [M] |
| VardefManager.php [C] | | APIv4/<Entity>/Create [M] |
| <Module>Bean.php [C] | | APIv4/<Entity>/Update [M] |
| vardefs.php [A] | | APIv4/<Entity>/Delete [M] |
| relationship defs [A] | | Field validators [F] |
+-----------------------------+ +--------------------------------+
NOTES:
SuiteCRM model patches = class-level.
CiviCRM model patches = method-level + field-level.
+=========================================================================+
| V I E W L A Y E R |
+=========================================================================+
SUITECRM CIVICRM
-------- --------
+-----------------------------+ +--------------------------------+
| V: View Override Points | | V: View Override Points |
+-----------------------------+ +--------------------------------+
| View.php [C] | | CRM/*/Form/*.php [M] |
| Smarty templates [T] | | buildForm() [M] |
| tpl overrides [T] | | addField() [F] |
| metadata layouts [A] | | setDefault() [F] |
| no field isolation (!) | | per-element callbacks [F] |
+-----------------------------+ +--------------------------------+
NOTES:
SuiteCRM view patches = template-level.
CiviCRM view patches = element-level.
+=========================================================================+
| C O N T R O L L E R / A P I |
+=========================================================================+
SUITECRM CIVICRM
-------- --------
+-----------------------------+ +--------------------------------+
| C: Controller/API Points | | C: Controller/API Points |
+-----------------------------+ +--------------------------------+
| Controller.php [C] | | APIv4/<Entity>/Actions [M] |
| EntryPointRegistry [C] | | pre() / post() hooks [H] |
| REST v4_1 endpoints [A] | | apiWrappers() [H] |
| REST v10 endpoints [A] | | per-action override [M] |
| SOAP endpoints [A] | | per-entity override [M] |
| logic_hooks.php [H] | | per-field override [F] |
+-----------------------------+ +--------------------------------+
NOTES:
SuiteCRM controller patches = endpoint-level.
CiviCRM controller patches = action-level.
+=========================================================================+
| G R A N U L A R I T Y |
+=========================================================================+
SUITECRM: smallest natural override = CLASS or TEMPLATE
CiviCRM: smallest natural override = METHOD or FIELD
+=========================================================================+
- http://web.resource.org/rss/1.0/modules/
- https://www.xml.com/pub/a/2004/04/07/dive.html
- https://alistapart.com/article/content-modelling-a-master-skill/
- https://blogs.cisco.com/getyourbuildon/yang-opensource-tools-for-data-modeling-driven-management
- https://www.adtran.com/index.php/blog/technology-blog/232-modeling-microservices-in-yang
- https://communities.cisco.com/community/developer/opendaylight/blog
- https://www.tonymarston.net/php-mysql/dont-do-domain-driven-design.html#2018-12-02
- https://coggle.it/diagram/Wq28jcGZixoKb8bx/t/msf-usa-drupal-8-content-model
- https://docs.python.org/3/library/stdtypes.html
- https://docs.ruby-lang.org/en/master/security_rdoc.html
- https://www.php.net/manual/en/language.operators.type.php
- https://rosettacode.org/wiki/Metaprogramming#Perl_6
- https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/SavedFrame
- https://blog.theodorejb.me/sql-linked-lists/
- https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Guide/Hashtables_detailed
- https://wiki.mozilla.org/User:Jorend/Deterministic_hash_tables
- http://erlang.org/doc/man/persistent_term.html
- https://heap.io/blog/engineering/when-to-avoid-jsonb-in-a-postgresql-schema