LogoLogo
Home
Core Platform
Core Platform
  • Introduction
    • Overview
    • Use Cases
    • Architecture
    • Built with ML & AI
    • Quick Start
  • Examples
    • Training Examples
      • API Flow Examples
      • Microservice Examples
      • UI Example
      • Exercise: Hello World API
      • Exercise: Test State
      • Exercise: Test UI
    • Exercise: To-do List
      • To-do List Runner
      • To-do List Gateway
      • To-do List UI
      • To-do List Query
  • Troubleshooting
    • Rierino Packages
    • Release Notes
    • Useful Checks
    • Error Codes
  • Devops
    • Overview
    • API Flows
      • Using the Saga Screen
      • Defining a Saga
      • Configuring Saga Steps
        • Event Step
        • Transform Step
          • Transform Classes
        • Condition Step
          • Condition Classes
        • Step Link
      • Injecting Variables
    • Microservices
      • Runners
        • Using the Runner Screen
        • Defining a Runner
        • Managing Runner Settings
        • Adding Runner Elements
        • Deploying Runners
          • Spring Runners
          • Samza Runners
          • Camel Runners
      • Elements
        • Systems
        • State Managers
          • Typical Use Cases
          • State Data Structure
          • Local States
            • In-Memory Map
            • Caffeine Cache
            • Samza Based
            • Lucene Based
            • Single File
            • Multiple Files
            • Selected IDs Map
            • Indexed Map
          • Shared States
            • MongoDB Collection
            • Jooq (SQL) Table
            • Redis Map
            • Couchbase Collection
            • Elasticsearch Index
            • Elasticsearch Joined
            • Etcd Namespace
          • Specialized States
            • CRUD Service
            • Odata Service
          • State Coordinators
            • Lazy Cache Coordinator
            • Event Store Coordinator
            • Write thru Coordinator
          • Loading Strategies
          • ID Generators
        • Listeners
        • Query Managers
          • MongoDB
          • Elasticsearch
          • Lucene
          • SQL Based
          • Odata Service
        • Handlers
          • Core Handlers
            • Write Data
            • Read Data
            • Query Data
            • Apply Rules
            • Call Rest API
            • Generate Text/Html
            • Parse Html
            • Generate Secrets
            • Orchestrate User Task
            • Perform File Operation
            • Run Shell Command
            • Send/Receive Emails
          • Custom Code Handlers
            • Run Scripts
            • Run Java Code
            • Run Java Package
          • Flow Handlers
            • Orchestrate Saga
            • Loop Each Entry
            • Run Multiple Steps
            • Buffer Payloads
            • Merge Parallel Steps
            • Log Event
            • Send Event
            • Validate Event
            • Transform Event
            • Perform DB Transaction
            • Trigger Runner Command
            • Do Nothing
            • Modify Role Data
            • Enrich Role Data
            • Convert Pulse to Journal
          • Gateway Handlers
            • Authenticate
              • No Authentication
              • State Based
              • Keycloak Based
            • Sessionize
          • Specialized Handlers
            • Apply Advanced Rules
            • Calculate Real-time Metrics
            • Score ML Models
            • Score LangChain Models
            • Service MCP Requests
            • Service A2A Requests
            • Consume Web of Things
            • Perform Text Embedding
            • Run Python Procedure
            • Generate Excel
            • Generate PDF
            • Call SOAP API
            • Integrate with Camel
        • Actions
        • Streams
          • Kafka Topic
          • CDC Feed
          • Camel Component
        • Roles
        • Generic Settings
        • Global Settings
      • Deployments
        • Defining a Deployment
        • Alternative Loaders
    • Gateway & Security
      • Gateway Servers
        • Gateway Systems
        • Gateway Channels
        • Gateway Services
        • Gateway Tokens
      • APIs
        • OpenAPI Specification
        • Response Formats
    • Administration
      • Managing Deployments
      • Sending Commands
      • Streaming Messages
      • Migrating Assets
    • Batch Tasks
      • Python Processes
      • Python Iterators
      • Python Processors
    • Pro-Code
      • Custom Handlers
      • Custom State Managers
      • Custom Query Managers
      • Custom CDC Managers
  • Design
    • Overview
    • User Interface
      • Apps
      • UIs
        • Listers
        • Widgets
          • Value Widgets
          • Array Widgets
          • Object Widgets
          • Indirect Widgets
          • Atom Widgets
        • Menus
          • Lister Menu Actions
          • Selection Menu Actions
          • Editor Menu Actions
          • Widget Menu Actions
          • Custom Menu Actions
          • RAI Menu Actions
        • Extended Scope
          • Conditional Display
          • Data Context
          • Extra Data
          • Default Item
          • Extra Events
      • Options
      • Translations
      • Icons
      • Styles
      • Components
    • API Mapping
    • Data Schema
      • Common Data
  • Configuration
    • Overview
    • Queries
      • Query Types
      • Query Platforms
        • MongoDB Queries
        • Odata Queries
        • SQL Queries
        • Elasticsearch Queries
        • Lucene Queries
        • Siddhi Queries
    • Business Rules
      • Drools Rules
    • Dynamic Handlers
  • Data Science
    • Overview
    • ML Models
      • Scheduler Platforms
        • Airflow Scheduler
    • GenAI Models
    • MCP Servers
    • Complex Event Processing
      • Siddhi Data Flows
    • Data Visualizations
    • Customizations
  • EXTENSIONS
    • JMESPath
    • Handlebars
Powered by GitBook

© Rierino Software Inc. 2025. All rights reserved.

On this page
  • Real-Time CDC Sync
  • Caching with TTL
  • Periodical Tracked Reload
  • Periodical Full Reload
  • Static Reload
  1. Devops
  2. Microservices
  3. Elements
  4. State Managers

Loading Strategies

It is possible to synchronize different state managers using different methods, based on the use case.

State managers can be written on to directly using certain event handlers such as the "write" event handler, which translates API requests into create, update, delete, etc. actions.

However, certain use cases (such as cache, search engine, read states) require synchronization between the master write state manager and other state managers (configured as the "loader.state"). State synchronization is achieved in a number of ways:

Real-Time CDC Sync

This strategy uses Rierino's built-in change data capture capabilities, which automatically publish pulse / journal records when a record is updated in a source state. When a state manager is set-up to listen to these publications (e.g. Kafka topics), it automatically updates its records based on the received notification.

CDC based loading provides the lowest latency in data synchronization with real-time loading of updated records in milliseconds.

While this strategy is the optimal option for faster synchronization while enabling additional triggered events (e.g. webhook calls to 3rd party systems) on data updates, it is more complex to configure than the other strategies as it requires setting up runners for producing change data streams. Hence, it is typically recommended for managing state of business assets that have change more frequently or need to be synchronized across a variety of systems (such as product data).

Caching with TTL

This strategy uses cache state managers and assigns a time-to-live value (e.g. 15 seconds) to each record. When a record is read and is discovered to be "too old", it is automatically reloaded.

This strategy is relatively simple to set-up, as it only requires configuring cache state managers. It is especially recommended for cases where records don't change often and using old versions of these records for a few seconds does not have important impact (e.g. query, variable data).

The only limitation to this approach is record updates do not trigger any state listeners, so if the users of these states expect notifications on record updates (e.g. saga, model), it should not be preferred.

Periodical Tracked Reload

This strategy performs regular checks (e.g. every 30 seconds) on the loader state to identify any new and updated records (basedon updateTime or any other preferred field). Then, these identified records are updated on the target state manager.

These updates can trigger single or bulk notifications on state listeners. It is also quite simple to set-up this approach, using loader parameters for any state manager, making it ideal for small data sets which are used by handlers taking actions upon their updates (e.g. saga, model, rule, code data).

Periodical Full Reload

Similar to previous strategy, this approach performs regular reloads from the loader state. Instead of checking whether records are updated, it performs full reload of the records.

The main downside of using this approach is it forces reload of all records, so if there are any state listeners taking actions based on such updates, it would force them to execute on each cycle. So, this strategy is typically during development and testing.

Static Reload

This strategy loads records once when the runner is initialized and only performs reloads if there is a rebuild / restart / reload command received. This strategy is typically used during development and testing when records are not expected to change.

PreviousWrite thru CoordinatorNextID Generators

Last updated 7 months ago