Skip to main content

Basics of Scaling

This chapter explains the basic concepts necessary for understanding and implementing the architectural recommendations for the OPC Router. It provides an introduction to the key topics that will be covered in detail later in this manual.

The OPC Router as a Central Platform​

The OPC Router is a central platform that enables communication between various industrial systems and devices. Thanks to its ability to seamlessly transmit and process data, it plays a crucial role in the modern Industry 4.0 landscape. The platform supports many different protocols and standards, ensuring a high degree of flexibility and interoperability.

Key Features of the OPC Router​

  • Protocol Support: Support for OPC UA, MQTT, REST, databases, SAP, and many other protocols.
  • Data Integration: Integration of data from various sources such as PLCs, databases, IoT devices, and cloud services.
  • Visualization and Monitoring: Real-time monitoring and visualization of data streams and flows.
  • Automation: Automation of processes through rule- and event-based workflows.

Configuration memory and project database​

The engineering configuration is stored in the Git-versioned configuration store, specifically as YAML files in the configuration directory. When published, the current state is saved to the local project database (MongoDB), which also stores the transfer protocol and status data. Whether this database runs within the runtime image or has an external database connection depends on the chosen architecture.

Fundamentals of Scalability: Vertical and Horizontal​

When operating the OPC Router, both vertical and horizontal scaling play a crucial role in meeting the requirements of businesses of various sizes. Here is a more detailed look at both scaling approaches in the specific context of OPC Router operation.

Vertical Scaling​

Definition: Vertical scaling (scale-up) refers to increasing the capacity of a single server or instance by adding more resources such as CPU capacity, RAM, or storage.

Use Cases: Vertical scaling is particularly suitable for smaller installations or scenarios where higher performance per instance is required. This could be the case when a single OPC Router processes many data points or handles complex data processing tasks.

Advantages of Vertical Scaling​

  • Easy Implementation: Requires no changes to the existing application architecture.
  • Low Complexity: Since only a single instance needs to be managed, administration and configuration are simpler.
  • Immediate Performance Boost: Performance can be improved immediately by adding resources.

Challenges of Vertical Scaling​

  • Limited Scalability: The capacity of a single server has physical limits. Performance measurement data shows where this limit roughly lies: In the setups documented there, a single instance performed the transfer of between 20,000 and just under 30,000 OPC data points per second—measured on servers with four to eight cores and 16 GB of RAM.
  • Single Point of Failure: If that single instance fails, it results in downtime.

Example: A medium-sized company operates a production facility with an OPC router that collects data from all machines. By adding more RAM and CPU capacity, the processing speed and the amount of data that can be processed can be increased without requiring an additional instance.

Horizontal Scaling​

Definition​

Horizontal scaling (scale-out) means adding additional servers or instances to distribute the load and increase capacity.

Use Cases​

Use Cases: Ideal for larger installations or scenarios where high availability and load balancing are required. Horizontal scaling is particularly useful in large production environments or across distributed locations.

Advantages of Horizontal Scaling​

  • Virtually Unlimited Scalability: By adding more instances, capacity can be expanded virtually without limit.
  • Improved fault tolerance: Redundancy allows individual instances to fail without affecting the overall system, thereby minimizing downtime.
  • Flexibility: New instances can be easily added or removed to respond to changing requirements.

Challenges in Horizontal Scaling​

  • Increased Administrative Overhead: Multiple instances must be managed and monitored.
  • Manual Distribution: Connections and flows are manually distributed across the instances. There is no automatic load balancing between multiple OPC routers.
  • Separate projects: Each instance runs its own project; a flow can only be moved to another instance via export and import.

Example: A large company operates multiple production facilities and locations. By setting up multiple OPC Router instances for each production hall or location, data processing can be performed locally, which distributes the load and increases system reliability. Additional instances can be added as needed to expand capacity.

Practical Implementation​

Vertical Scaling​

  1. Resource Analysis: Determine current resource requirements and identify bottlenecks.
  2. Upgrade: Add additional CPU capacity, RAM, or storage to the existing OPC Router instance.
  3. Monitoring: Monitor performance after the upgrade to ensure that the expected improvements are achieved.

Horizontal Scaling​

  1. Needs Analysis: Analyze the load and identify areas that would benefit from additional instances.
  2. Instance Deployment: Deploy additional OPC Router instances, configure them, and connect them to the existing network.
  3. Project Splitting: Export the project components from the existing OPC Router instance that are to be transferred to the additional instances.
  4. Commissioning: Import the exported project components into the new instances, and deactivate the flows in the original instance. Put the new instances into production and verify that they have been successfully integrated.
  5. Monitoring and Maintenance: Monitor the performance of all instances and perform regular maintenance.

This section refers to multiple instances. However, a single instance can of course also be added following these steps to scale horizontally.

Separation of Concerns in the OPC Router​

Definition and Significance of SoC​

Separation of Concerns (SoC) is an architectural principle that aims to clearly separate different responsibilities and areas of responsibility within a system. This results in a clearer structure and more efficient system operation.

In the context of the OPC Router, this means that the various “concerns” or responsibilities within an OPC Router instance are identified, grouped, and then distributed across multiple instances so that no dependencies exist. This significantly facilitates extensions and scaling.

Application of SoC in the OPC Router​

Modularization of “Concerns”​

  • Separate Instances for Different Responsibilities: In an OPC Router architecture, different responsibilities—such as connecting different production areas or facilities—should be grouped into separate instances. This means that each instance of the OPC Router is responsible for a specific task or area.
  • Example: One instance could be responsible for communicating with the machines in Hall A, while another instance processes the data from Hall B.

Advantages of Separating "Concerns"​

  • Simpler Extensions: When introducing a new plant, hall, or location, another OPC Router instance with the same or similar configuration can simply be added. This reduces the effort and complexity involved in expanding the system.
  • Scalability: Thanks to the clear separation of responsibilities, individual instances can be scaled independently of one another. If requirements increase in one area, the corresponding instance can be expanded in a targeted manner. This can be done by adding more hardware resources to the instance. Alternatively, horizontal scaling can be performed by adding additional instances.
  • Independent Updates: Security, software, and configuration updates can be performed more easily and in a targeted manner. Since the instances are separate from one another, updates can be carried out without simultaneously affecting multiple production departments or processes.
  • Fault Isolation: Problems in one instance (e.g., hardware failures or software crashes) do not affect the other instances. This increases the overall stability and reliability of the system.

Practical Implementation​

Setting Up Separate Instances​

  • Planning: Start by planning which areas or tasks should be separated. Identify the main responsibilities and distribute them across separate instances.
  • Implementation: Set up the OPC Router instances according to the planned division. Ensure that each instance has the necessary connections and configurations to perform its specific tasks.
  • Maintenance and Monitoring: Monitor the instances regularly and perform necessary maintenance tasks. Use the separation of instances to perform targeted updates and improvements.

Example of an Architecture​

  • Instance 1: Responsible for machine control and data acquisition in Hall A.
  • Instance 2: Responsible for quality control and inventory management in Hall B.
  • Instance 3: Responsible for energy monitoring and environmental controls throughout the entire plant.

Summary​

Understanding the fundamental concepts of vertical and horizontal scaling, as well as the principle of separation of concerns, is crucial for the successful implementation and use of the OPC Router in companies of various sizes. While vertical scaling offers a simple solution for smaller use cases, horizontal scaling enables virtually unlimited scalability and greater reliability. Separation of Concerns helps reduce complexity and increase the system’s efficiency. The following chapters explore these concepts in greater depth and present practical application examples.