ServiceNow Architecture & Design Principles: A Cheat Sheet for Architects

A comprehensive cheat sheet for ServiceNow architects covering platform fundamentals, design patterns, and best practices.


1. Platform Architecture Overview

ServiceNow is a cloud-based enterprise platform following a multi-instance architecture where each customer gets their own dedicated instance.

Core Architectural Layers

LayerDescription
User Interface LayerForms, lists, portals, Service Portal, UI Builder/Next Experience
Application LayerITSM, ITOM, ITAM, CSM, HR apps built on the Now Platform
Business Logic LayerBusiness Rules, Script Includes, Flows, Workflows
Data LayerTables, CMDB, relationships stored in MySQL/MariaDB
Integration LayerREST/SOAP APIs, IntegrationHub, MID Servers

Instance Architecture

┌─────────────────────────────────────────────────────────┐
│                    ServiceNow Cloud                      │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐     │
│  │   DEV       │  │    TEST     │  │    PROD     │     │
│  │  Instance   │──│   Instance  │──│  Instance   │     │
│  └─────────────┘  └─────────────┘  └─────────────┘     │
│         │                │                │             │
│         └────────────────┼────────────────┘             │
│                          │                              │
│                   Update Sets / CI/CD                   │
└─────────────────────────────────────────────────────────┘

Source: ServiceNow ESM Architecture Blueprint (opens in a new tab)


2. The 8 Pillars of ServiceNow Architecture

These foundational pillars guide scalable, secure, and maintainable platform design.

Pillar 1: Modularity & Reusability

"Build once, reuse everywhere"

Pillar 2: Security by Design

Pillar 3: Scalability

Pillar 4: Observability

Pillar 5: Business Alignment

Pillar 6: Governance

Pillar 7: Maintainability

Pillar 8: Performance

Source: Build It the Right Way: The 8 Pillars (opens in a new tab) | BRY Framework (opens in a new tab)


3. Scoped Applications Architecture

When to Use Scoped Apps

ScenarioRecommendation
Specific use case, won't interact with other appsCreate new scope
Needs to interact with platform/other appsEvaluate existing scope
Reusable across instances or Store distributionCreate new scope
Global platform modificationGlobal scope (with caution)

Scope Benefits

Best Practices

Namespace format: x_[vendor]_[app_name]
Example: x_acme_csm
  1. Plan thoroughly before development—define required resources and data access
  2. Use scoped APIs for platform interaction
  3. Document cross-scope dependencies explicitly
  4. Test scope interactions before deployment

Source: Understanding Application Scope (opens in a new tab) | Background and Philosophy of Scoped Applications (opens in a new tab)


4. CMDB & CSDM Architecture

CSDM Framework Domains

┌─────────────────────────────────────────────────────────┐
│                    CSDM FRAMEWORK                        │
├──────────────┬──────────────┬──────────────┬────────────┤
│  FOUNDATION  │    DESIGN    │    MANAGE    │ SELL/      │
│              │              │   TECHNICAL  │ CONSUME    │
├──────────────┼──────────────┼──────────────┼────────────┤
│ • Locations  │ • Business   │ • Technical  │ • Service  │
│ • Users      │   Apps       │   Services   │   Offerings│
│ • Groups     │ • Business   │ • CI         │ • Requests │
│ • Companies  │   Services   │   Relationships│ • Catalog│
│ • Cost Ctrs  │ • App Svcs   │ • Discovery  │   Items    │
└──────────────┴──────────────┴──────────────┴────────────┘

Implementation Approach: Crawl → Walk → Run

PhaseFocus
CrawlFoundation data (users, locations, business apps)
WalkService instances, relationships, technical services
RunAdvanced domains, full service modeling, automation

CMDB Best Practices

  1. Follow CSDM schema for compatibility with ServiceNow analytics and upgrades
  2. Configure identification rules to avoid duplicate CIs
  3. Set up reconciliation rules to prioritize trusted data sources
  4. Use Service Graph Connectors for third-party tool integrations
  5. Schedule regular data quality checks using CMDB Health dashboards
  6. Establish CI ownership and validation rules
  7. Document customizations and obtain governance approval

Key Tables

TablePurpose
cmdb_ciBase CI table (parent of all CIs)
cmdb_ci_serviceBusiness/Technical Services
cmdb_ci_applApplications
cmdb_ci_serverServers
cmdb_rel_ciCI Relationships

Source: CMDB Design Guidance (opens in a new tab) | CMDB & CSDM Data Foundations (opens in a new tab)


5. Integration Architecture

Integration Pattern Decision Matrix

PatternUse WhenProsCons
REST APIReal-time, synchronous needsClear contracts, predictableTight coupling
IntegrationHub SpokesPre-built connectors availableFast implementationLicensing cost
MID ServerOn-prem systems behind firewallSecure bridgeAdditional infrastructure
Event-driven (EDA)Decoupled, async processingScalable, loose couplingComplexity
Stream Connect (Kafka)High-volume, bidirectional streamingReal-time, scalableKafka expertise needed

MID Server Architecture

┌──────────────────┐         ┌──────────────────┐
│  ServiceNow      │◄───────►│    MID Server    │
│  Cloud Instance  │  HTTPS  │  (On-Premise)    │
└──────────────────┘         └────────┬─────────┘

                    ┌─────────────────┼─────────────────┐
                    │                 │                 │
              ┌─────▼─────┐    ┌──────▼──────┐   ┌─────▼─────┐
              │  LDAP/AD  │    │   Database  │   │  Network  │
              └───────────┘    └─────────────┘   │  Devices  │
                                                 └───────────┘

When MID Server is Required:

IntegrationHub Best Practices

  1. Use Spoke Generator for OpenAPI 2.0/3.0 specs
  2. Group similar action steps to avoid environment switching
  3. Set MID Server selection via connection aliases
  4. Use credential aliases for secure credential management
  5. Implement retry logic for transient failures

Instance-to-Instance Integration

MethodUse Case
Service BridgeMSP/Provider-Consumer scenarios
Instance Data Replication (IDR)Data synchronization across instances
Custom REST integrationFlexible, custom requirements

Source: Integration Design Patterns (opens in a new tab) | IntegrationHub Spokes (opens in a new tab)


6. Security Architecture

ACL Evaluation Order (Performance Optimized)

1. Roles/Security Attributes  ← FASTEST (use first)

2. Data Conditions            ← Use indexed fields

3. Reference Controls

4. Scripts                    ← SLOWEST (use last)

ACL Types

TypeGranularityUse Case
Table ACLEntire tableBroad access control
Field ACLSpecific fieldSensitive field protection
Row-levelRecord conditionsData segregation

ACL Best Practices

  1. Start with roles — fastest security check
  2. Use non-contextual ACLs when possible (faster, easier to audit)
  3. Prefer indexed fields in conditions
  4. Shield scripts with roles/criteria — script only runs if conditions match first
  5. Merge ACLs that differ only by roles
  6. Test with impersonation — admins bypass ACLs

Role Management

               ┌─────────────────┐
               │   itil_admin    │  ← Higher-level role
               └────────┬────────┘
                        │ inherits
          ┌─────────────┼─────────────┐
          ▼             ▼             ▼
    ┌─────────┐   ┌─────────┐   ┌─────────┐
    │  itil   │   │ change  │   │ problem │
    │         │   │ _manager│   │ _manager│
    └─────────┘   └─────────┘   └─────────┘

Principles:

Security Configuration Checklist

Source: Configuring ACLs the Right Way (opens in a new tab) | ServiceNow Security Best Practices (opens in a new tab)


7. Performance Optimization

GlideRecord Best Practices

DoDon't
✅ Use addQuery() with indexed fields❌ Query without filters
✅ Use addEncodedQuery() for complex queries❌ Chain many addQuery()/addOrCondition()
✅ Use GlideAggregate for counts❌ Use getRowCount()
✅ Select only needed fields with setLimit()❌ Fetch all columns when only need sys_id
✅ Use async for heavy operations❌ Nested loops with GlideRecord

Server-Side Optimization

// BAD: Fetches all columns, no filter
var gr = new GlideRecord('incident');
gr.query();
while (gr.next()) {
	/* ... */
}
 
// GOOD: Filtered, limited, uses encoded query
var gr = new GlideRecord('incident');
gr.addEncodedQuery('active=true^priorityIN1,2');
gr.setLimit(100);
gr.query();
while (gr.next()) {
	/* ... */
}
 
// BEST for counts: Use GlideAggregate
var ga = new GlideAggregate('incident');
ga.addQuery('active', true);
ga.addAggregate('COUNT');
ga.query();
if (ga.next()) {
	var count = ga.getAggregate('COUNT');
}

Client-Side Rules

  1. Never use client-side GlideRecord — use GlideAjax instead
  2. Avoid g_form.getReference() — fetches all fields
  3. Use asynchronous patterns for server calls
  4. Minimize DOM manipulation — use GlideForm API

Performance Monitoring Tools

ToolPurpose
SQL DebuggingAnalyze slow queries
Script Execution TrackerTrack script execution times
Slow Query LogsIdentify problematic queries
Transaction LogsMonitor request/response times
Instance ScanIdentify performance issues

Async Processing Patterns

// Use Event Queue for async processing
gs.eventQueue(
	'x_custom.heavy_process',
	current,
	current.sys_id,
	current.number
);
 
// Scheduled Jobs for batch operations
// Configure via System Definition > Scheduled Jobs

Source: Performance Considerations with GlideRecord (opens in a new tab) | Beyond Best Practices: Time & Space (opens in a new tab)


8. High Availability & Instance Performance

ServiceNow's HA Architecture

ServiceNow operates a fully managed HA infrastructure. As an architect, understand what's automatic vs. what you influence.

LayerServiceNow ManagesYou Influence
Data CenterMulti-DC redundancy, geo-failoverData residency selection
DatabaseClustering, replication, backupsQuery efficiency, indexing requests
Application NodesLoad balancing, auto-scalingCode efficiency, async patterns
NetworkCDN, DDoS protection, TLSMID Server placement, integration design

Automatic HA Capabilities

Key Insight: You cannot configure HA directly—it's baked in. Your job is to not defeat HA through poor design (e.g., single MID Server dependencies, synchronous blocking calls).

Instance Performance Levers

What architects can control to maximize performance:

LeverStrategy
IndexingRequest indexes for frequently filtered/sorted fields via HI case
SemaphoresThrottle concurrent heavy operations to prevent resource exhaustion
Scheduled JobsStagger timing; use off-peak windows for batch processing
Table RotationArchive old data (task tables grow fast)
Domain SeparationLimit domains—excessive domains degrade query performance
Clone SchedulingClone during low-usage periods

Performance Monitoring Strategy

┌─────────────────────────────────────────────────────────────┐
│                   MONITORING LAYERS                          │
├──────────────────┬──────────────────┬───────────────────────┤
│    PROACTIVE     │    REACTIVE      │     DIAGNOSTIC        │
├──────────────────┼──────────────────┼───────────────────────┤
│ • Instance Scan  │ • Slow Query Log │ • Session Debug       │
│ • Performance    │ • Transaction    │ • SQL Debug           │
│   Homepage       │   Quota Exceed   │ • Script Execution    │
│ • Scheduled      │ • Error Logs     │   Tracker             │
│   Health Checks  │ • PA Dashboards  │ • Debug Business Rule │
└──────────────────┴──────────────────┴───────────────────────┘

Key Performance Metrics to Monitor

MetricTargetWhere to Find
Transaction Response Time< 1 second (avg)Performance Homepage
Long-Running Transactions< 0.1% of totalTransaction Logs
Slow Queries0 criticalSlow Query Logs
Semaphore WaitsMinimalSystem Diagnostics
Scheduler BacklogNear zeroScheduled Job Dashboard
Memory Utilization< 80%Stats.do

Capacity Planning Guidelines

FactorPlanning Consideration
User ConcurrencyEstimate peak concurrent users; provision accordingly
Integration VolumeMap peak API call rates; design for 3x expected load
Data GrowthProject table growth; implement archival before problems
Scheduled LoadAudit job schedules; eliminate conflicts and clustering
Seasonal PeaksDocument business cycles; engage ServiceNow for capacity events

Load Testing Approach

1. Identify Critical Paths    →  Catalog items, searches, dashboards

2. Create Realistic Scripts   →  Simulate actual user journeys

3. Test Non-Production First  →  Never load test production

4. Gradual Ramp-Up           →  Start small, increase load incrementally

5. Monitor During Test        →  Watch Transaction Logs, memory, semaphores

6. Analyze & Tune            →  Address bottlenecks before go-live

Warning: Load testing production requires explicit ServiceNow approval and coordination. Contact your TAM or support before attempting.

Common HA/Performance Anti-Patterns

Anti-PatternWhy It's BadFix
Single MID ServerSingle point of failure for discovery/integrationsDeploy MID cluster with load balancing
Synchronous integrations for non-critical pathsBlocks user transactionsUse async (events, IntegrationHub async)
Unindexed query in Business RuleScales poorly as table growsRequest index or redesign query
Heavy operations in before Business RulesDelays user saveMove to async or after when possible
No data archival strategyTables grow indefinitely; queries slowImplement table rotation policies
Scheduled job pile-upJobs compete for resources at same timeStagger schedules; use priority queues

MID Server HA Configuration

┌─────────────────────────────────────────────────────────────┐
│                 MID SERVER CLUSTER                           │
│                                                              │
│   ┌───────────┐    ┌───────────┐    ┌───────────┐          │
│   │   MID 1   │    │   MID 2   │    │   MID 3   │          │
│   │ (Active)  │    │ (Active)  │    │ (Standby) │          │
│   └─────┬─────┘    └─────┬─────┘    └─────┬─────┘          │
│         └────────────────┼────────────────┘                 │
│                          ▼                                   │
│              MID Server Cluster (Load Balanced)             │
│              Auto-failover if node fails                    │
└─────────────────────────────────────────────────────────────┘

Best Practices:

Source: ServiceNow High Availability (opens in a new tab) | Performance Best Practices (opens in a new tab) | Instance Performance Diagnostics (opens in a new tab)


9. Flow Designer Architecture

Component Hierarchy

┌─────────────────────────────────────────┐
│                 FLOW                     │
│  ┌─────────────────────────────────┐    │
│  │           SUBFLOW               │    │
│  │  ┌───────────┐ ┌───────────┐   │    │
│  │  │  ACTION   │ │  ACTION   │   │    │
│  │  └───────────┘ └───────────┘   │    │
│  └─────────────────────────────────┘    │
└─────────────────────────────────────────┘

Flow = Trigger + Logic + Actions/Subflows
Subflow = Reusable composite logic (no trigger)
Action = Single-purpose atomic operation

Best Practices

PrincipleImplementation
Keep flows short< 25 actions; use subflows for larger
Subflows for reuseBuild once, reference everywhere
Pass referencesOne reference variable vs. many individual values
Use data pillsAvoid hardcoding values in scripts
Decision tablesReplace complex if/else branching
CategorizeTag flows/subflows/actions for discoverability

Flow Designer vs. Workflow

FeatureFlow DesignerWorkflow
Recommended forNew developmentLegacy support
Scripting neededMinimalOften required
ReusabilityActions, SubflowsActivities
TestingBuilt-in test featureManual
PerformanceOptimizedVariable

Error Handling Strategy

┌─────────────────────────────────────┐
│          MAIN FLOW                   │
│                                      │
│  ┌────────────────────────────────┐ │
│  │ SUBFLOW with Error Handler     │ │
│  │                                │ │
│  │  Try: [Action 1] → [Action 2]  │ │
│  │       ↓ error                  │ │
│  │  Catch: [Log] → [Notify]       │ │
│  └────────────────────────────────┘ │
│                                      │
│  Flow continues even if subflow fails│
└─────────────────────────────────────┘

Source: Best Practices for Flow Designer (opens in a new tab) | Flow Designer Architecture Overview (opens in a new tab)


10. Instance Strategy & Domain Separation

Multi-Instance Decision Framework

FactorSingle InstanceMultiple Instances
Same processes, same data✅ Preferred❌ Avoid
Legal/geographic data requirementsDomain Separation✅ May be required
Completely separate entities❌ Not suitable✅ Consider
Heavy integration/sync needs✅ Preferred⚠️ High cost
Sensitive data, restricted visibilityDomain Separation✅ May be required

Key Rule: "You cannot run the same process on the same data in multiple instances."

Domain Separation Overview

┌─────────────────────────────────────────┐
│           SINGLE INSTANCE               │
│  ┌───────────┐  ┌───────────┐          │
│  │ Domain A  │  │ Domain B  │          │
│  │ • Data    │  │ • Data    │          │
│  │ • Config  │  │ • Config  │          │
│  │ • Users   │  │ • Users   │          │
│  └───────────┘  └───────────┘          │
│         │              │                │
│         └──────┬───────┘                │
│                ▼                        │
│         Global Domain                   │
│    (Shared configurations)              │
└─────────────────────────────────────────┘

When to Use Domain Separation

Good fit:

Avoid when:

Domain Separation Considerations

AspectImpact
SetupMust be enabled in new instance; cannot be removed
MaintenanceSubstantially increases administrative work
PerformanceToo many domains slow database queries
ComplexityRequires careful planning and expertise

Source: Multi-Instance Architecture Decision (opens in a new tab) | Domain Separation Architecture (opens in a new tab)


11. Deployment & CI/CD

Deployment Pipeline

┌─────────┐    ┌─────────┐    ┌─────────┐    ┌─────────┐
│   DEV   │───►│   QA    │───►│   UAT   │───►│  PROD   │
└────┬────┘    └────┬────┘    └────┬────┘    └─────────┘
     │              │              │
     ▼              ▼              ▼
  Develop      ATF Tests      User Acceptance
  & Test       Code Scan      Final Approval

Update Sets vs. Source Control

AspectUpdate SetsSource Control (App Repo)
Version controlLimitedFull Git capabilities
MergingManual collision handlingGit merge/branch
Recommended forLegacy, simple changesScoped apps, CI/CD
CI/CD integrationBasicFull pipeline support

ATF (Automated Test Framework) Best Practices

  1. Create ATF tests in dedicated scoped app (e.g., "Incident ATF Tests")
  2. Run ATF before deployment — fail pipeline if tests fail
  3. Cover critical paths: Catalog items, flows, business logic
  4. Use parameterized tests for data-driven testing
  5. Include cleanup in test teardown

CI/CD Integration Options

ToolDescription
ReleaseOpsNative ServiceNow deployment control (no extra licensing)
GitHub ActionsServiceNow CI/CD integration (community supported)
Jenkins PluginServiceNow CI/CD plugin
Azure DevOpsPipeline integration via APIs

Deployment Checklist

Source: ReleaseOps (opens in a new tab) | CI/CD with ATF (opens in a new tab)


12. Design Patterns Quick Reference

Creational Patterns

PatternServiceNow Use Case
SingletonScript Includes with shared state
FactoryCreating different record types based on input
BuilderComplex GlideRecord query construction

Structural Patterns

PatternServiceNow Use Case
AdapterWrapping external APIs for platform use
FacadeScript Include exposing simplified API
DecoratorExtending Business Rule functionality

Behavioral Patterns

PatternServiceNow Use Case
ObserverBusiness Rules reacting to record changes
StrategyDifferent assignment algorithms based on criteria
Template MethodBase Script Include with overridable methods

Source: 23 ServiceNow Design Patterns (opens in a new tab) | Introducing Design Patterns (opens in a new tab)


13. Quick Reference: Do's and Don'ts

✅ Do

❌ Don't


Additional Resources

Official Documentation

Community Resources

Certifications

If you're preparing for any of these, SNReady (opens in a new tab) offers practice questions generated from official Now Learning content across 19 ServiceNow certification exams, with detailed explanations for each answer.


Last updated: January 2026