Skip to main content

Module map

A bird's-eye view of every module in the Titan ecosystem — who depends on whom, who can substitute for whom, and which combinations show up in real backends.

Dependency graph

Solid arrows are hard dependencies — you can't run the dependent module without the foundation. Dotted arrows are soft / optional — feature flagged at config time (storage: 'redis', multiTier: true, enableDatabaseIndicator: true).

Install footprint

The numbers below count peer modules a typical adoption pulls in (transitive Redis client, postgres driver, etc. are omitted):

You installWhat else lights up
titan-eventsStandalone
titan-redisStandalone
titan-databaseStandalone (+ db driver)
titan-cacheStandalone (+ titan-redis if multiTier: true)
titan-lock+ titan-redis
titan-discovery+ titan-redis
titan-ratelimitStandalone (+ titan-redis if storage: 'redis')
titan-notifications+ titan-redis (+ titan-database for preference store)
titan-schedulerStandalone (+ titan-redis for distributed persistence)
titan-authStandalone (+ titan-cache for token cache)
titan-healthStandalone (indicators light up per enableXxxIndicator)
titan-metricsStandalone (+ storage driver if persisting)
titan-telemetry-relayStandalone (paired with titan-metrics at remote end)
titan-pmStandalone

The framework deliberately keeps modules independently versionable — you only pull in what you actually use.

Common stacks

Web API service

Built-in@omnitron-dev/titanconfig + logger

Ships inside @omnitron-dev/titan. No additional install required.

Officialtitan-redis + titan-database + titan-cache + titan-auth + titan-health + titan-metrics

Maintained by the Omnitron team. Independent npm package.

Common starting set for any REST / RPC backend.

Worker fleet

Built-in@omnitron-dev/titanconfig + logger

Ships inside @omnitron-dev/titan. No additional install required.

Officialtitan-redis + titan-database + titan-lock + titan-scheduler + titan-metrics + titan-health

Maintained by the Omnitron team. Independent npm package.

titan-lock is what stops two workers running the same job.

Notification gateway

Built-in@omnitron-dev/titanconfig + logger

Ships inside @omnitron-dev/titan. No additional install required.

Officialtitan-redis + titan-notifications + titan-ratelimit + titan-metrics

Maintained by the Omnitron team. Independent npm package.

titan-ratelimit shields the upstream provider; titan-metrics records throughput / failures by channel.

Multi-instance app

Add titan-discovery to any of the above when you have more than one pod and want to address services without hard-coded URLs.

Edge / offline node

Officialtitan-telemetry-relay

Maintained by the Omnitron team. Independent npm package.

Add titan-telemetry-relay when the node may be disconnected from the central metrics endpoint — it buffers samples to SQLite and flushes when connectivity returns.

Similar modules — when which?

NeedReach forWhy
Sync in-process pub/subtitan-eventsFire-and-forget, intra-process, typed channels
Reliable cross-pod queuetitan-notificationsBuilt on rotif; survives crashes, has DLQ + retry
Periodic work (cron / interval)titan-schedulerPer-job persistence + missed-fire handling
Memoize a function calltitan-cache@Cached(...) decorator; multi-tier (L1+L2)
Talk to Redis directlytitan-redisJust a typed client; no service abstraction
Throttle callstitan-ratelimitToken-bucket / sliding-window / fixed-window
Coordinate across instancestitan-lockRedis-backed mutex with UUID ownership
Spawn / supervise child processestitan-pmWorker pools, IPC, crash supervision
Find sibling servicestitan-discoveryHeartbeat-based service registry
Count / measuretitan-metricsCounters, gauges, histograms; Prom exposition
Ship metrics off-hosttitan-telemetry-relayStore-and-forward; survives offline windows
Check it's alivetitan-healthk8s probes + custom indicators
Authenticate RPC callerstitan-authJWT (HS256/RS256/ES256), JWKS, token cache
Query a databasetitan-databaseKysely + migrations + RLS
Validated configconfig (built-in)Layered, validated, hot-reloadable
Structured logginglogger (built-in)pino under the hood; transports + processors

Replacement / overlap matrix

ModuleClosest overlapWhen to prefer
titan-eventstitan-notificationsIn-process / no persistence / lowest latency
titan-notificationstitan-events + titan-schedulerCross-process, retry, DLQ, channel templating
titan-cachebare titan-redisCaching semantics (@Cached, TTL, multi-tier)
titan-schedulersetInterval / node-cronPersistence, missed-fire, observability
titan-lockbare SETNX on RedisSafe ownership (UUID) + Lua-script atomicity
titan-discoveryenv-var URL configDynamic topology, autoscaling, rolling deploys
titan-metricsprom-clientNative persistence + cross-pod aggregation
titan-telemetry-relaydirect Prom scrapeEdge / offline / store-and-forward
titan-healthrolling-your-own /healthzStandard k8s probe shapes + indicator registry
titan-authmanual JWT verificationJWKS rotation, token cache, RBAC primitives

Where Redis sits

Five official modules use Redis as their primary backend. They share the same Redis client provided by titan-redis:

Register TitanRedisModule.forRoot(...) once at app boot; all five pick up the connection automatically.

@Module({
imports: [
TitanRedisModule.forRoot({ config: { url: env.REDIS_URL } }),
TitanLockModule.forRoot(),
DiscoveryModule.forRoot(),
TitanCacheModule.forRoot({ multiTier: true, l2: { /* picked up */ } }),
TitanRateLimitModule.forRoot({ storageType: 'redis' }),
NotificationsModule.forRoot({ /* … */ }),
],
})
class AppModule {}

Recommended Redis-DB split (avoid keyspace collisions):

DBPurpose
0App data (cache, sessions, business state)
1Queues / pub-sub (notifications, events)
2Rate limits
3Locks (titan-lock)
4Discovery registry

Configure per-module by passing a different db: index in the options, or by registering multiple named Redis clients via TitanRedisModule.forRootMultiple([...]).

Lifecycle order — first to last

The container resolves lifecycle in dependency order:

On shutdown, the reverse order is followed — user services drain first, then surface modules, then foundations, then logger / config last. The exact reverse ensures dependants always stop before their dependencies.

Picking the right tier

QuestionTier
Always available, smallest install?Built-in
Battle-tested, official, individually versioned?Official
Niche need, no official equivalent yet?Community (audit first)
Want to publish your own?Authoring a module

See also