This post is a walkthrough guide on how to keep your cloud environment database usage under control and within the size limits that we’ve put in place to properly manage the overall experience of our cloud.
OutSystems Platform uses a shared database to store both system and application data.
System data is comprised of all the application’s definition metadata, including the data model definitions, module configurations, system and application logs, module versions, and much more, which usually grows with continuous application development and deployment.
Application data is the data your applications generate and manipulate, which usually grows with application usage.
All this data occupies database storage and can consume quite a bit in large development environments or highly used systems.
How to check the database usage in my personal environment
With Platform 9 Amsterdam, we’ve included more database usage information in our free public cloud. You can now verify your global database usage levels and identify how much is being used as system and as application data.
You can view your global database usage by accessing the Environments tab (https://<yourpersonalenvironmentname>.outsystemscloud.com) as shown below.
If you access the View details link in the Database section, you’ll be able to determine the amount of database storage usage for both system and application data, as shown in the image below.
The values shown in the database usage are updated hourly, thus any change in the occupation values may be reflected only after an hour.
How to free up System data
OutSystems Platform provides built-in capabilities to cleanup old system data. The most common cause for database usage growth is old versions of your applications.
Starting with Amsterdam, OutSystems Platform will periodically clean up old module versions from the database. Nevertheless, it’s possible that you might need to perform this cleanup yourself, by executing the described procedure below.
Deleting old module (eSpace) versions from your system is handled under the Factory section of your environment management console (https://<yourpersonalenvironmentname>.outsystemscloud.com/ServiceCenter). On the eSpaces subtab, you’ll find the Check Old eSpace Versions to Delete link, which will allow you to view the eSpace versions older than a specific period (1 week, 2 weeks, 1 month, etc), and select them for deletion.
Select the period, press the Check Versions to Delete button, and you’ll get a list of old eSpace versions that you can safely delete. These versions aren’t the currently published version, nor associated with existing Solution versions. By pressing the Delete Displayed Versions button, all listed eSpace versions will be remove from the database repository, freeing up significant database storage.
How to free up Application data
Application data is basically all the information that your applications store in their own entities/tables. This means that you control the amount of data that is stored in the application data model. So our recommendation to control that application data usage, is to have your applications keep a clean data model.
For instance, if you store files or large chunks of data in your application entities that you will use only once but never again, you might want to delete them from the data model. On the other hand, if you’re considering using the data model to store files or large chunks of data, you might want to consider pushing that information to external storage services, like Amazon S3, Box.com, Google Drive or Dropbox, using available connectors.
It’s also possible that during your development cycles, you may delete applications or entities. To prevent irreversible loss of data, OutSystems Platform doesn’t actually delete the data from the database. This can present another problem, which is that you lose the ability to delete the entity's data from within your applications. We provide an API to allow you to delete entities and columns from the data model, and free up some more espace. This is called the DB Cleaner API.
Hope this information helps you to keep your cloud environment database usage in check, to improve the stability and performance of your applications in the cloud.