Cloud Platform

Using MySQL stored procedures, triggers, and functions

This document contains information about the issues with using MySQL stored procedures, triggers, and functions.

Acquia recommends you don’t use stored procedures, triggers, or functions in your Drupal database on Cloud Platform. Using stored procedures, triggers or functions will break replication, backups, and even the database copy process. To avoid the issue, Cloud Platform Enterprise has disabled the use of stored procedures, triggers, and MySQL functions in all environments.

Having code in both your version control repository and database increases complexity and makes it harder for you to manage your code. This also undermines recovery and other high availability (HA) platform operational tasks. By default, the code in these objects isn’t maintained in version control, which makes it difficult to manage releases without risking mismatches between PHP and SQL code. Instead, you should implement your business logic in your Drupal application code and not directly in your database.

Note

Acquia Support doesn’t cover database triggers nor will Acquia Support troubleshoot any issues that may arise from their use. Acquia recommends moving any triggers functionality from the database to the codebase. To see the specific support services provided by Acquia see the Support Users Guide.