Skip to main content

Relationship Model

Cloudaware uses Salesforce relationship primitives to model ownership hierarchies and runtime dependencies across assets. Knowing the pattern helps you pick the right traversal in SOQL and Graph.

Relationship Types

  • Master‑Detail (MD): strong containment; child inherits ownership/security; parent delete cascades; enables roll‑up summaries on the master
  • Lookup: flexible reference; parent/child lifecycles are independent; use dot notation for parent fields
  • Junction (MD+MD): many‑to‑many via a link object holding two master‑detail fields to its parents

Terminology used in CMDB reports often maps to these primitives:

  • Contains: hierarchical ownership (commonly master‑detail or required lookup)
  • Depends On: runtime dependency (lookup)
  • Connected To: network/attachment relationship (often junction)

Canonical Relationships

  • AccountResource (lookup)
    • Example: CA10__CaAwsInstance__c looks up CA10__CaAwsAccount__c
  • ApplicationApplication Tier (master‑detail)
    • CA10__CaApplicationTier__c (detail) → CA10__CaApplication__c (master)
  • InstanceVolume (junction)
    • CA10__CaAwsInstanceVolumeLink__c with two MDs pointing to Instance and Volume
  • ResourceSecurity Group (junction)
    • Link objects capture many‑to‑many application of security groups to instances/interfaces
  • VulnerabilitySource Object (lookup)
    • Record‑type‑specific primary lookup: host, project, repo, etc.
  • Kubernetes hierarchy (lookups)
    • ClusterNode/NamespacePodContainer/Workload (exact object set depends on CA10K package version)

Traversal Patterns

  • ChildParent (lookup/MD): SELECT Id, Parent__r.Name FROM Child__c
  • ParentChildren (subquery): SELECT (SELECT Id FROM ChildRelationshipName) FROM Parent__c (child relationship name is defined on the lookup)
  • Many‑to‑many via junction: query the link object, or filter parent by Id IN (SELECT Parent__c FROM Link__c WHERE OtherParent__c = '...')
tip

Prefer dot notation from child to parent for selective filters and to avoid large subqueries.

Lifecycle and Soft‑Delete

  • Most asset objects use CA10__creationDate__c (where provided) and CA10__disappearanceTime__c to track presence in the source system.
  • The normalized provider state (e.g., CA10__stateName__c, CA10__powerState__c, CA10__status__c) fields are used to indicate status/lifecycle state.
  • The filter “Active” CA10__disappearanceTime__c = NULL can be used in SOQL queries.
  • Junction rows follow the same convention and disappear when either side is removed in the source.