Port sharing

Overview

The Ports section of the DeltaBlue Cloud Platform supports inter-application port sharing within the same environment. This allows applications to access ports across different applications within the same environment.

Additionally, you can setup internal traffic balancing options to manage how traffic is distributed across multiple instances of a stack item, such as databases.

Port sharing deactivated

When port sharing is not active, applications within an environment cannot access ports that were associated with stack items from other applications. Each application had isolated access to its own ports, meaning that if multiple applications within the same environment needed to interact, they could not directly access each other’s ports. This can lead to cumbersome configurations and limited flexibility when integrating multiple applications.

Port sharing activated

Ports can be shared across different applications within the same environment. This means that if a port is marked as shared, any application within the environment can access that port. This feature simplifies the integration process between applications, reducing the need for complex configurations.

Using the Ports Section

Accessing the Ports Section

Navigate to the config tab of an application and select PORTS in the left hand menu. There you will see a list of available services.

Sharing Ports Across Applications

The list of available services contains all the ports of the current environment.

  • Locate the Port: In the shared services section, identify the port associated with the stack item you want to share (e.g., a database or web server port).
  • Enable Sharing: To allow other applications within the same environment to access this port, toggle the switch next to the port labeled “Share with all other applications in this environment.”
    • Result: Once sharing is enabled, the selected port becomes accessible to any other application within the same environment. This is especially useful for inter-application communication, such as when a web application needs to connect to a shared database.

Managing Internal Traffic Balancing

If your application has multiple instances of a stack item (e.g., several database instances), you can control how internal traffic is routed between them using internal traffic balancing.

  • Identify the Stack Item: In the Shared services section, locate the stack item with multiple instances.
  • Select a Balancing Mode: You can choose between two internal traffic balancing modes:
    • Random Internal Balancing: Select this option if you want to distribute internal traffic randomly across all instances. This mode is ideal for balancing the load evenly across multiple instances.
    • Single Internal Balancing: Select this option if you want all traffic directed to a single instance. This mode is useful when consistency or reduced latency to a particular instance is required.
    • Result: Depending on your selection, the traffic within the environment will either be evenly distributed across the instances or funneled to a specific one, optimizing performance based on your needs.

Practical Scenarios

Example 1: Enabling Web Application and Database Communication

Suppose you have a web application and a database as separate applications within the same environment. To allow the web application to communicate with the database, you can share the database’s port. Simply go to the Ports section, find the database’s port, and toggle the sharing option. Now, the web application can access the database through this shared port.

Example 2: Load Balancing Across Multiple Databases

Imagine you have multiple instances of a database to handle high traffic. To ensure the load is distributed efficiently, go to the Shared services section and select Random Internal Balancing for the database stack item. This setting will distribute the queries randomly across all instances, ensuring no single instance is overwhelmed.

Alternatively, if one database instance needs to handle all traffic due to specific requirements, choose Single Internal Balancing to direct all internal traffic to that instance.

Best Practices

  • Port Sharing: Use port sharing to simplify the configuration of environments where multiple applications need to interact. This avoids the need for complex network setups and makes integration smoother.

  • Internal Traffic Balancing: Consider your application’s performance needs when selecting a balancing mode. Random balancing is great for load distribution, while single balancing is better for consistent access to a specific instance.