Service components are the set of templates that encapsulates everything that’s needed to build your PaaS/SaaS. Your PaaS/SaaS may have 1 or more service components. Here are different elements of a service component:
- Input parameters - Input parameters define a set of parameters that you want to take from your customers. You can define the type, constraints, limits and we will make sure that those properties are honored in your generated control plane.
- Output parameters - Output parameters define a set of parameters that you want to return when your customers describe this service component.
- Environment variables - Environment variables define a set of environment variables to configure your docker image. These environment variables can be static values or could be dynamic values based on the Input parameters. In addition, we have also defined some dynamic system parameters for your convenience.
- Configuration - Configuration defines a configuration needed to run your docker image. Like environment variables, configuration can have static values or also dynamic values based on the Input parameters.
- Action hooks - these are custom logic that you may want to run at different stages of your service component. As an example, if you want to install an extension to your PostgreSQL cluster, you can simply run an extension command on the post CLUSTER_INIT stage. Another example could be to run a rebalance command on adding a new node or removing a node. We will make sure that these commands are run reliably or alert you if we find any issues.
Each service template can have a maximum of 1 image and 1 infrastructure attached to it. If there is no image or infrastructure attached, we will treat that service component as a metadata object to store information from your customers and configure other service components. As an example, if you are building PostgreSQL SaaS and want to allow your users to input some of the PostgreSQL configuration, you can define a parameter component and let them use an instance of parameter component to configure different PostgreSQL clusters.
You can also combine different service components to build more complex PaaS/SaaS, ex - if you are building Kafka SaaS, you may have 1 service component to represent Kafka brokers and another service component to represent Zookeeper. Similarly, if you are building PostgreSQL HA SaaS, you may have 1 service component to represent Master and another service component to represent Replicas to configure Master and Replicas separately. You can also combine your service components to build a higher-level application SaaS. Let’s say you want to build a LAMP stack based SaaS, you can define Memcached as your caching component, MySQL as a database service component and an application server to host your PHP application as a third service component. You can then combine them by marking caching and database service components as dependency to an application service component. We will use this information to provision, scale, recover, patch different service components accordingly.
A service component can be internal or external. In your PaaS/SaaS stack, there might be some components that you may want to directly expose to your customers while others may be technical details that you don’t want to expose to your customers. Omnistrate platform will build a SaaS experience such that only external components will be exposed to your customers, ex - in the above example, you can mark caching, database service components as internal, and an application service component as external that takes PHP application directory stored in S3 as an input. In this case, Omnistrate will only expose 1 service component while generating the SaaS experience and taking the S3 URL as an input to run a corresponding PHP application. We also allow mapping input parameters to configure dependent internal components through dependency mapping. As an example, you can also take "enable read-replica" as an input parameter in the above example and use that to configure a MySQL service component accordingly for your customers.