Skip to content

Operations Framework: Diagrams ​

This page contains visual diagrams explaining how Operations Framework works.

High-Level Architecture ​

High-Level Architecture

Command Execution Pipeline:

ClassDescription
OperationReprocessorRetries commands that fail with transient errors
TransientOperationScopeProviderProvides transient operation scope
DbOperationScopeProviderProvides DB-backed operation scope
DeferredInvalidationScopeProviderOpens the deferred invalidation scope
OperationCompletionHandlerApplies the invalidation calls an operation recorded

Background Services:

ClassDescription
DbOperationLogReaderReads operations from other hosts
DbOperationLogTrimmerRemoves old operations from log
DbEventLogReaderProcesses pending events
DbEventLogTrimmerRemoves processed/discarded events

Notification System:

ClassDescription
DbOperationCompletionListener<TDbContext>Notifies log watchers when an operation completes locally
NpgsqlDbLogWatcher<TDbContext, TDbEntry>Listens for NOTIFY signals
RedisDbLogWatcherSubscribes to Redis pub/sub
FileSystemDbLogWatcherWatches for file changes

Command Execution Flow ​

Command Execution Flow
HandlerPriorityResponsibility
InvalidationGuard999,999,000Rejects a nested command run inside an invalidation pass
OperationReprocessor100,000Retries commands that fail with transient errors
TransientOperationScopeProvider10,000Transient scope, completion handling
DbOperationScopeProvider9,900DB transaction, operation persistence
DeferredInvalidationScopeProvider9,000Deferred invalidation scope
CompletionTerminator-1,000,000,000Terminal handler for ICompletion

Operation Scope Lifecycle ​

Operation Scope Lifecycle

Multi-Host Invalidation Flow ​

Multi-Host Invalidation Flow

Event Processing Flow ​

Event Processing Flow
Event StateDescription
NewFreshly added, awaiting processing
ProcessedSuccessfully executed
DiscardedFailed after max retries

Log Watcher Comparison ​

Watcher TypeMechanismLatencyInfrastructure
PostgreSQL NOTIFYNOTIFY / LISTEN on channel< 10msNone (uses DB)
Redis Pub/SubPUBLISH / SUBSCRIBE on channel< 1msRedis server
FileSystem WatcherTouch file / Watch directory< 100msShared filesystem
No Watcher (Polling)Poll _Operations table0-5sNone