Understanding Deployment Types¶
The deployment type of a service determines many different facets of how the service functions, including performance, memory usage, and access to files or volumes. Liferay Cloud provides two deployment types for its services: Deployment
and StatefulSet
.
Differences Between Deployment Types¶
The Deployment type features the following:
Network File System (NFS) is mounted onto a directory available to this service
Network identifiers are random (e.g.,
liferay-89f9f559
,liferay-d1267401
)Deployment and scaling are unordered
Automated rolling updates are unordered
Meanwhile, the StatefulSet type features the following:
Service is allocated a dedicated SSD
Network identifiers are stable and unique (e.g.,
search-0
,search-1
)Deployment and scaling are ordered
Automated rolling updates are ordered
The following summarizes some distinguishing characteristics between the Deployment
and StatefulSet
types:
Type |
Purpose |
Resource Usage and Startup Time |
Dedicated SSD for Local Volumes |
Access to NFS |
Ordered Startup / Scaling |
---|---|---|---|---|---|
Deployment |
Stateless applications with the use of NFS |
Consumes less resources and starts up faster than |
X |
✓ |
X |
StatefulSet |
Stateful applications |
Consumes more resources and starts up slower than |
✓ |
X |
✓ |
In general, the Deployment
type is more lightweight and allows for faster deployments, as well as shared volumes between services (for shared files, like the document library). The StatefulSet
type is more costly for deployments and resource usage (including the total memory and CPUs allocated for your project), but persists data through deployments and gains improved file access performance by using a dedicated SSD.
How Liferay Cloud’s Services are Configured¶
The following details how the services in Liferay Cloud are pre-configured out-of-the-box:
The Liferay and Backup services use the Deployment type, so that they can share access to the document library, which is stored in NFS.
The Database and Web Server services also use the Deployment type, so that they can remain lightweight and start up quickly.
The CI service uses the StatefulSet type, so that it can take advantage of the extra file access speed from having a dedicated SSD.
The Search service also uses the StatefulSet type, so that it can take advantage of extra speed for searches, and so that search indices stored on the SSD are not lost if the service restarts.
Configuring Deployment Types¶
By default, the services in Liferay Cloud are pre-configured in order to fit a majority of use cases. However, the deployment type for each service is configurable via the kind
variable in the service’s LCP.json
:
{
"id": "search",
"kind": "StatefulSet"
}
Note
The deployment type of the services in Liferay Cloud must only be changed with caution, as it may result in data loss or impacted performance.