Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Top-level service vs dependency (or required service): A top-level service is the functionality that you intend to deploy.  A dependency or required service is one that is only used because your intended top-level service needs it.
  2. Stateful vs stateless service: A service is stateful when it retains or persists information from one invocation to the next.  A service is stateless when each invocation is independently sent all of the information it requires in each request.
  3. Singleton vs Multiple (sharable property in Service Definition file): "The value of this field determines how many instances of the service’s containers will be running on a node when the service is deployed more than once to the same node."  You might use the `singleton` value if your environment is resource-constrained and you cannot run more than one instance of a service.  Another reason to use `singleton` is if a service is stateful.  If the service is stateless and you have the available resources to run more than one copy, you should choose `multiple` instead of `singleton`.
  4. Service Definition and Deployment Policies vs Node (Deployment) Pattern: Use the former when you have one or more top-level services that have independent lifecycles.  This is the recommended approach.  Use the latter only when you have a single application composed of multiple top-level services that have interdependent lifecycles.

Docker Compose combines the Deployment and Initialization phases of the service software lifecycle, collectively described as load-time.  It implicitly attempts to determine which services are top-level services based on explicitly-described dependencies.  It also explicitly determines the sequence in which services should be run based on the order in which they appear in the Docker Compose file.  This means that two top-level services could be run before the first top-level service's dependencies if that is the sequence in which they are described in the file.

Open Horizon allows a developer to describe a top-level service in a standalone Service Definition file, which also contains explicitly-defined dependencies.  The sequence in which each service should be run is determined by both the deployment policy (or pattern), and what services are already running on the node.