Diagramming Patterns
Diagramming is a critical skill for Salesforce architects, enabling visualization of system architecture, data models, processes, and relationships. Effective diagrams communicate complex technical concepts to stakeholders, document architectural decisions, and guide implementation teams.
Different diagram types serve different purposes: system architecture diagrams show overall system structure, entity relationship diagrams (ERDs) show data models, sequence diagrams show process flows, and environment diagrams show deployment architecture. Understanding when and how to use each diagram type enables architects to communicate effectively.
Creating effective diagrams requires understanding diagramming conventions, tool selection, and how to balance detail with clarity. Diagrams should be clear, accurate, and appropriate for their audience.
Core Concepts
System Architecture Diagram
What it is: High-level diagram showing overall system structure, components, and their relationships.
Key elements:
- System components (Salesforce, external systems, integrations)
- Data flows and integration patterns
- User types and access patterns
- Key technologies and platforms
When to use: Initial architecture discussions, stakeholder presentations, system overview documentation.
Best practice: Keep system architecture diagrams high-level and focused. Show key components and relationships. Use for stakeholder communication and initial design discussions.
Entity Relationship Diagram (ERD)
What it is: Diagram showing data model, objects, fields, and relationships.
Key elements:
- Objects (standard and custom)
- Fields and field types
- Relationships (lookup, master-detail)
- Cardinality and relationship types
When to use: Data model design, database planning, object relationship documentation.
Best practice: Use ERDs for data model visualization. Show objects, relationships, and key fields. Keep ERDs focused on data model, not all object details.
Sequence Diagram
What it is: Diagram showing process flow and interactions between components over time.
Key elements:
- Components and actors
- Message flows and interactions
- Process steps and sequence
- Decision points and branches
When to use: Process documentation, integration design, workflow visualization.
Best practice: Use sequence diagrams for process flows. Show component interactions clearly. Include decision points and error handling.
Activity Diagram
What it is: Diagram showing business process flows and decision logic.
Key elements:
- Process steps and activities
- Decision points and branches
- Parallel processes and synchronization
- Process start and end points
When to use: Business process documentation, workflow design, automation planning.
Best practice: Use activity diagrams for business processes. Show decision logic clearly. Include parallel processes when applicable.
Environment Diagram
What it is: Diagram showing deployment architecture, environments, and data flow between environments.
Key elements:
- Environments (production, sandboxes, scratch orgs)
- Data flow and deployment paths
- Environment relationships
- Integration points
When to use: Deployment planning, environment strategy, CI/CD architecture.
Best practice: Use environment diagrams for deployment architecture. Show environment relationships and data flow. Include deployment processes.
Role Hierarchy Diagram
What it is: Diagram showing organizational structure and role hierarchy for sharing and access.
Key elements:
- Roles and positions
- Hierarchy relationships
- Reporting structure
- Access patterns
When to use: Security design, sharing model design, organizational structure documentation.
Best practice: Use role hierarchy diagrams for security design. Show organizational structure clearly. Align with actual organizational structure.
Deep-Dive Patterns & Best Practices
Diagramming Tool Selection
Tool considerations:
- Ease of use and learning curve
- Collaboration features
- Export and sharing capabilities
- Integration with documentation tools
- Cost and licensing
Common tools:
- Lucidchart: Web-based, collaborative, Salesforce templates
- Draw.io (diagrams.net): Free, open-source, versatile
- Visio: Microsoft tool, enterprise standard
- Miro/Mural: Collaborative whiteboarding tools
Best practice: Choose tools based on team needs and collaboration requirements. Use tools that support collaboration and version control. Consider cost and licensing.
Diagram Design Principles
Principle 1 - Clarity: Keep diagrams clear and easy to understand.
Approach:
- Use consistent symbols and conventions
- Label all components clearly
- Use appropriate level of detail
- Remove unnecessary complexity
Principle 2 - Accuracy: Ensure diagrams accurately represent reality.
Approach:
- Verify diagram accuracy with stakeholders
- Update diagrams as systems evolve
- Document assumptions and limitations
- Review diagrams regularly
Principle 3 - Audience Appropriateness: Design diagrams for their intended audience.
Approach:
- Business stakeholders: High-level, business-focused
- Technical teams: Detailed, technical-focused
- Mixed audiences: Multiple diagram versions
Best practice: Design diagrams for clarity and accuracy. Tailor diagrams to audience. Update diagrams as systems evolve.
Diagram Maintenance
Version control:
- Version control diagrams with code
- Track diagram changes over time
- Document diagram evolution
- Enable rollback if needed
Regular review:
- Review diagrams periodically
- Update diagrams as systems evolve
- Remove outdated diagrams
- Maintain diagram library
Best practice: Version control diagrams. Review and update regularly. Maintain diagram library. Document diagram purpose and audience.
Implementation Guide
Diagram Creation Process
- Identify diagram need: Determine what needs to be diagrammed and why
- Select diagram type: Choose appropriate diagram type for purpose
- Gather information: Collect information needed for diagram
- Create diagram: Create diagram using selected tool
- Review and refine: Review diagram for accuracy and clarity
- Share and document: Share diagram with stakeholders and document purpose
- Maintain and update: Update diagram as systems evolve
Prerequisites
- Understanding of what needs to be diagrammed
- Access to diagramming tools
- Understanding of diagramming conventions
- Information about system/components to diagram
- Understanding of intended audience
Key Configuration Decisions
Diagram type decisions:
- Which diagram type serves the purpose?
- What level of detail is needed?
- What audience is the diagram for?
- What information should be included?
Tool decisions:
- Which tool supports collaboration needs?
- What export and sharing capabilities are needed?
- What is tool cost and licensing?
- What is team tool preference?
Validation & Testing
Diagram validation:
- Verify diagram accuracy with stakeholders
- Test diagram clarity with intended audience
- Review diagram for completeness
- Validate diagram conventions and standards
Tools to use:
- Diagramming tools (Lucidchart, Draw.io, Visio, etc.)
- Version control for diagram management
- Documentation tools for diagram storage
- Collaboration tools for diagram review
Common Pitfalls & Anti-Patterns
Over-Complex Diagrams
Bad pattern: Creating diagrams with too much detail, making them difficult to understand.
Why it’s bad: Confuses audience, reduces diagram effectiveness, and makes maintenance difficult.
Better approach: Keep diagrams focused and clear. Use appropriate level of detail. Create multiple diagram versions for different audiences if needed.
Not Updating Diagrams
Bad pattern: Creating diagrams but not updating them as systems evolve.
Why it’s bad: Diagrams become outdated and inaccurate, leading to confusion and poor decisions.
Better approach: Review and update diagrams regularly. Version control diagrams. Remove outdated diagrams. Maintain diagram library.
Not Tailoring to Audience
Bad pattern: Using the same diagram for all audiences without considering their needs.
Why it’s bad: Diagrams may be too technical for business stakeholders or too high-level for technical teams.
Better approach: Tailor diagrams to audience. Create multiple versions for different audiences if needed. Use business language for business stakeholders.
Not Documenting Diagrams
Bad pattern: Creating diagrams without documentation of purpose, assumptions, or limitations.
Why it’s bad: Diagrams may be misunderstood or used incorrectly without context.
Better approach: Document diagram purpose, assumptions, and limitations. Include diagram in documentation. Explain diagram conventions and symbols.
Using Wrong Diagram Type
Bad pattern: Using inappropriate diagram type for the purpose (e.g., using ERD for process flow).
Why it’s bad: Diagram doesn’t effectively communicate intended information, leading to confusion.
Better approach: Choose appropriate diagram type for purpose. Understand diagram type capabilities and limitations. Use multiple diagram types if needed.
Real-World Scenarios
Scenario 1 - System Architecture for Stakeholder Presentation
Problem: Need to present overall system architecture to business stakeholders for approval.
Context: New Salesforce implementation, multiple stakeholders, need high-level system overview.
Solution:
- Create system architecture diagram showing key components
- Focus on business value and capabilities
- Use business language, not technical jargon
- Show integration points and data flows
- Present diagram with clear explanations
Key decisions: Keep diagram high-level and business-focused. Use business language. Focus on capabilities and value, not technical details.
Scenario 2 - Data Model Documentation
Problem: Need to document custom data model for development team and future reference.
Context: Complex custom data model, multiple objects and relationships, need detailed documentation.
Solution:
- Create ERD showing all custom objects
- Show relationships and cardinality
- Document key fields and field types
- Include relationship types (lookup, master-detail)
- Maintain ERD as data model evolves
Key decisions: Use ERD for data model visualization. Show all objects and relationships. Keep ERD updated as model evolves.
Scenario 3 - Integration Process Documentation
Problem: Need to document integration process flow for development and operations teams.
Context: Complex integration with multiple steps, need process flow documentation.
Solution:
- Create sequence diagram showing integration flow
- Show component interactions and message flows
- Include error handling and retry logic
- Document decision points and branches
- Maintain diagram as integration evolves
Key decisions: Use sequence diagram for process flow. Show all interactions and decision points. Include error handling. Keep diagram updated.
Checklist / Mental Model
Diagram Creation Checklist
When creating diagrams:
- Identify need: What needs to be diagrammed and why?
- Select type: Which diagram type serves the purpose?
- Gather information: What information is needed?
- Create diagram: Create diagram with appropriate detail
- Review accuracy: Verify diagram accuracy
- Test clarity: Test diagram with intended audience
- Document purpose: Document diagram purpose and assumptions
- Share and maintain: Share diagram and maintain over time
Diagramming Mental Model
Choose right type: Select appropriate diagram type for purpose. Understand diagram type capabilities and limitations.
Design for audience: Tailor diagrams to intended audience. Use business language for business stakeholders, technical detail for technical teams.
Keep it clear: Keep diagrams focused and clear. Use appropriate level of detail. Remove unnecessary complexity.
Maintain accuracy: Review and update diagrams regularly. Version control diagrams. Remove outdated diagrams.
Document purpose: Document diagram purpose, assumptions, and limitations. Include diagram in documentation. Explain conventions.
Key Terms & Definitions
- System Architecture Diagram: High-level diagram showing overall system structure and components
- Entity Relationship Diagram (ERD): Diagram showing data model, objects, fields, and relationships
- Sequence Diagram: Diagram showing process flow and component interactions over time
- Activity Diagram: Diagram showing business process flows and decision logic
- Environment Diagram: Diagram showing deployment architecture and environments
- Role Hierarchy Diagram: Diagram showing organizational structure and role hierarchy
- Use Case Diagram: Diagram showing system use cases and actors
- Class Diagram: Diagram showing object-oriented class structure and relationships
RAG-Friendly Q&A Seeds
Q: What’s the difference between a system architecture diagram and an ERD?
A: A system architecture diagram shows overall system structure, components, and their relationships at a high level. An ERD shows data model, objects, fields, and relationships in detail. Use system architecture diagrams for system overview and stakeholder communication. Use ERDs for data model design and documentation.
Q: When should I use a sequence diagram?
A: Use sequence diagrams to show process flows and component interactions over time. Sequence diagrams are useful for: (1) Integration process documentation, (2) Workflow visualization, (3) Component interaction documentation, (4) Process flow documentation. Sequence diagrams show the order of interactions and message flows between components.
Q: How do I choose a diagramming tool?
A: Choose diagramming tool based on: (1) Ease of use and learning curve, (2) Collaboration features for team work, (3) Export and sharing capabilities, (4) Integration with documentation tools, (5) Cost and licensing. Common tools include Lucidchart, Draw.io, Visio, and Miro. Consider team needs and collaboration requirements.
Q: How detailed should diagrams be?
A: Diagram detail depends on audience and purpose. Business stakeholders need high-level, business-focused diagrams. Technical teams need detailed, technical diagrams. Create multiple diagram versions for different audiences if needed. Keep diagrams focused and clear. Remove unnecessary complexity.
Q: How often should I update diagrams?
A: Update diagrams regularly as systems evolve. Review diagrams periodically (quarterly or when significant changes occur). Version control diagrams to track changes. Remove outdated diagrams. Maintain diagram library. Diagrams should reflect current system state.
Q: What should I include in a system architecture diagram?
A: System architecture diagrams should include: (1) Key system components (Salesforce, external systems, integrations), (2) Data flows and integration patterns, (3) User types and access patterns, (4) Key technologies and platforms, (5) High-level relationships and interactions. Keep diagrams high-level and focused on key components.
Q: How do I make diagrams accessible to non-technical stakeholders?
A: Make diagrams accessible by: (1) Using business language, not technical jargon, (2) Focusing on business value and capabilities, (3) Keeping diagrams high-level and clear, (4) Providing clear explanations and context, (5) Using visual elements effectively, (6) Creating multiple versions for different audiences if needed. Tailor diagrams to audience needs.
Related Patterns
See Also:
- Architect Role - Architect responsibilities and skills
- Stakeholder Communication - Communicating with stakeholders
Related Domains:
- Event-Driven Architecture - Architecture diagram examples
- Portal Architecture - Portal architecture diagrams