Database Service

The database service is a proxy in Liferay Cloud to the Cloud SQL service in the Google Cloud Platform where the database itself resides. The database service provides tools for managing and monitoring the Cloud SQL instances. It simplifies the setup, operation, and scaling of your applications. It’s a private service inside your application environment and it can only communicate with your other services, not the public internet. The database in Liferay Cloud has case-sensitive table and column names. Liferay Cloud projects are provisioned with PostgreSQL 16 as their default database.

The database service is one of several services available in Liferay Cloud.

See the Database service limitations for more information.

Important

The resources consumed by the database service in Liferay Cloud are separate from the resources consumed on Cloud SQL.

Core Database Settings and User Management Variables

These environment variables influence core settings for the database and the main users that access it. They are already created for you during project provisioning. Change them only if you have specific requirements.

Values starting with LCP_SECRET are secret variables exposed to the Liferay, backup, and database services.

Warning

Changing the database name, default character set, or collation requires you to drop the existing database and restart the service with the new values, which involves application downtime.

For more information, see Changing Your Database Username and Changing Your Database Password.

NameDefault ValueWhere to SetDescription
LCP_GCP_DATABASE_CHARSETPostgreSQL: UTF8; MySQL: utf8mb4LCP.jsonDatabase character set. This generally should not be changed.
LCP_GCP_DATABASE_COLLATIONPostgreSQL: en_US.UTF-8; MySQL: utf8mb4_unicode_ciLCP.jsonDatabase collation. This should only be changed for specific requirements for the sorting order.
LCP_SECRET_DATABASE_NAMElportalSecrets (lcp-secret-database-name)Database name.
LCP_SECRET_DATABASE_PASSWORD(Random value)Secrets (lcp-secret-database-password)Master password.
LCP_SECRET_DATABASE_READONLY_USER(Environment name)Secrets lcp-secret-database-readonly-userRead-only username (for database client connection).
LCP_SECRET_DATABASE_READONLY_USER_PASSWORD(Random value)Secrets lcp-secret-database-readonly-user-passwordRead-only user password.
LCP_SECRET_DATABASE_USERdxpcloudSecrets (lcp-secret-database-user)Master username.
LCP_DATABASE_USER_WHITELISTNoneLCP.jsonAdd any extra users to the whitelist to prevent the database service from removing them automatically.
LCP_SERVICE_LOG_LEVELINFOLCP.jsonThe lowest priority level of log messages to display. Set to the log level’s name or a numerical value. See Log Levels for more information.

Database Maintenance Window Variables

Your Liferay Cloud environment’s database service occasionally requires downtime for scheduled maintenance, typically for about two minutes. You can configure a preferred window for this maintenance to take place to reduce the downtime’s impact. By default, no specific time preference is defined.

NameAcceptable ValuesDescription
LCP_GCP_MW_DAY1 through 7Preferred day of the week (Monday (1) through Sunday (7), in UTC time).
LCP_GCP_MW_HOUR0 through 23Preferred hour of the day (in UTC time).
LCP_GCP_MW_UPDATE_TRACKcanary, stableSet canary to update earlier, up to a week before other environments.

Google Cloud PostgreSQL Flags

You can pass MySQL flags in as environment variables. The available flags appear in the Google Cloud documentation. Each flag must be pre-pended with LCP_GCP_DATABASE_FLAG_ to work in Liferay Cloud. Below are common flags that can be useful for debugging in a development environment, but should NOT be used in a production environment as they have significant performance costs.

Warning

As noted in Google’s documentation, some database flag settings can affect instance availability or stability. Be careful when using these flags and follow Google’s Operational Guidelines.

Google Cloud MySQL Flags

You can pass MySQL flags in as environment variables. The available flags appear in the Google Cloud documentation. Each flag must be pre-pended with LCP_GCP_DATABASE_FLAG_ to work in Liferay Cloud. Here are common flags useful for debugging in a development environment. They should NOT be used in a production environment because they have significant performance costs.

NameAcceptable ValuesDefault Value
LCP_GCP_DATABASE_FLAG_GENERAL_LOGon, offoff
LCP_GCP_DATABASE_FLAG_SLOW_QUERY_LOGon, offoff

You can also use the max_allowed_packet property to limit the size of payloads. Setting it too high might consume more memory. Setting it too low might result in failed queries and lost connections for larger payloads.

NameAcceptable ValuesDefault Value
LCP_GCP_DATABASE_FLAG_MAX_ALLOWED_PACKETMultiples of 1024268435456
Warning

As Google’s documentation notes, some database flag settings can affect instance availability or stability. Be careful when using these flags and follow Google’s Operational Guidelines.

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy