Documentation > Best Practices and Examples > Database as a Service

Implementing Database as a Service (DaaS)

CrownPeak offers a Database service for existing users of the Content Management System (CMS) and the Web Hosting environment. This database service will operate in the CrownPeak Hosting environment, which is based on Amazon Web Services (AWS). CrownPeak offers several deployment options.

Database Types / Versions

The CrownPeak Database service is available in two database types: Oracle MySQL on Linux versions (5.6.x) and MS SQL Server on MS Windows versions (2008 Standard, 2012 Standard, 2014 Standard). 

The database is on a pair of servers with the following specification: 2 vCPUs, 7.5 GB Memory, and up to 1 TB storage. Additional options are available if requested.

The CrownPeak Database service is highly available within a single AWS region by default. The environment is made up of a collection of virtualized hardware servers that are redundant with no single point of failure. 

Disaster Recovery is an extra level of protection where the CrownPeak DaaS service is deployed in two separate AWS Regions. Data is asynchronously replicated between these two locations. This capability can be provided if two DaaS platform subscriptions are purchased and located in separate AWS Regions

Database Server / Databases

Customers are free to construct and deploy as many databases as they wish on their CrownPeak DaaS platform.  The most common use case for this configuration is the support of multiple non-production software development lifecycle stages on a single DaaS deployment.

The CrownPeak database service is based on a production level support model and provides only the necessary levels of access required by the web servers and the privileged users that are required to add, update, or delete data in the database. 

Production & Non-Production Environments

The CrownPeak offers production database servers in a managed hosting environment. A production environment requires a specific set of hardware, infrastructure and change control procedures to ensure a high level of stability.

CrownPeak also offers non-production database servers to aid in the software development process. Most software development lifecycles promote code and data changes to a non-production environment for quality assurance testing and sign off.  The CrownPeak CMS has workflow stages that correspond to this lifecycle. 

Other Features

Maintenance and Support Updates

The CrownPeak database service includes regular maintenance and support updates such as the installation of service packs, security updates and other recommended vendor updates.  These updates are only applied at the request of customer and during a pre-arranged maintenance window.

Database Backups and Recovery

The CrownPeak Database service performs automatic database backups on a regular basis. Customers should submit a support request via the normal CrownPeak customer service process to request restoration or recovery services. The following are the standard database backup and recovery features:

  • Full backups – Daily
  • Transaction log backups – Every fifteen (15) minutes 
  • Return to Operation (RTO) – Backups can be recovered and applied within six (6) hours of the request
  • Recovery Point Objective (RPO) – Maximum data loss is limited to thirty (30) minutes.
  • Backup Retention – Backups are retained for thirty-five (35) days 

Note: Additional backup schedules and retention options can be added as needed.

Monitoring Support

The CrownPeak Database service is monitored 7 days a week and 24 hours a data by a set of tools that will alert the Database service team. The virtualized hardware servers and the corresponding disk storage is monitored and logged at several levels including:

  • Platform – CPU percentage, network traffic, disk reads, disk writes, 
  • Disk Storage – Current size, growth rates, large changes in size up or down
  • Database Service – Level of activity based on SQL queries

Capacity planning and Storage Management

The CrownPeak environmental monitors continuously track the size and grow of each database. The Database service team is alerted when the database size or actively level reaches a predetermined threshold. Additional server size or disk capacity is added to a client’s environment if needed to ensure ongoing stability. Server size may grow to one size larger and disk storage can be allocated up to 1 TB (1,099,511,627,776 bytes).

Backups and Data Extracts from the Database

CrownPeak DaaS is provided under the terms and conditions of the master subscription agreement in place between the customer and CrownPeak. At the conclusion of the subscription, CrownPeak is contractually obligated to return a copy of all Customer Data in the form of a database backup. During the lifetime of the service, backups are maintained for CrownPeak internal purposes only.  However, periodic extracts can be requested as part of a Professional Services engagement.

Frequently Asked Questions (FAQ)

Question: Are separate environments available for production and non-production? Answer: Yes, if these options are specified in your contract.

Question: Are regular update and service packs updates part of the database service? Answer: Yes, please see the Maintenance and Support Updates section above for details.

Question: Are High Availability (HA) and Disaster Recovery (DR) options available? Answer: Yes, please see the High Availability (HA) and Disaster Recovery (DR) section above for details.

Question: How are database design changes made? Answer:  All Data Definition Language (DDL) SQL requests must be scripted and submitted as a CrownPeak support request.

Question: How is data added and removed from the database? Answer: Apart from the normal course of data updates supported by the customer’s business application, data can be inserted into the database via an import script submitted as a CrownPeak support request. Similarly, data can be extracted and/or deleted from the database via a script submitted as a CrownPeak support request.

Question: During the development phase, could CrownPeak provide sufficient access to the database to allow users to connect with an administration tool such as MS SQL Server Management Studio? Answer: No.   For customers requiring this level of access during development, CrownPeak recommends that a separate environment be deployed locally to the developer.  CrownPeak provides technical specifications and Amazon Machine Images to assist developers in provisioning environments that match those provided by CrownPeak DaaS.

CMS Template API Examples

The CMS Template API library is your point of access to the CrownPeak platform. This collection of classes, methods and examples allow template developers to configure a custom content authoring experience in your instance.  Assets in the CMS can be managed through the use of the 16 template file types to edit, preview and control the deployment of your content. The following are a few examples to demonstrate the best way to access the Database in the most common template file types: 

Input Templates (input.aspx)

This template is used to define the authoring experience for a web page and enables the inline editing of web pages by overlaying a selection of control types such as: Text Boxes, Text Areas, WYSIWYG Editors, List Panels, and Carrousels. Each control requires an average of three lines of codes to bring the authoring to life. The content can also be accessed from a DaaS Instance instead of the CMS repository to populate one or more of these controls. For example:

Output Templates (output.aspx)

This template is used to present the content, layout, and styling of the web page. The page file is primarily made up of HTML, JavaScript, and CSS references. Content from the CMS repository or DaaS Instance is presented as embedded reference within the HTML code. For example:

Post Input, Post Save, Post Publish Templates (post_input.aspx)

These templates are used to validate and/or manipulate the content captured in the Input form, or automate certain tasks based on the captured content.  The Post Input is invoked when the user attempts to Save the asset, the Post Save is invoked after a successful Save, and the Post Publish is invoked upon Publishing the asset.   These events may provide ideal opportunities to communicate with a DaaS Instance to insert, update, or delete content stored in the database. For example:

CMS Access API Examples

Setting up forms for content entry is very quick, and they are beautiful and easy to use.  For API only content delivery, no output HTML formatting is required, making it very easy to get started.  Your content can be managed in any size parts you want, and later assembled into any size component you need.

Input template Example

connect_error) {    die("Connection failed: " . $conn->connect_error);} // sql to create table$sql = "CREATE TABLE MyGuests (id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, firstname VARCHAR(30) NOT NULL,lastname VARCHAR(30) NOT NULL,email VARCHAR(50),reg_date TIMESTAMP)";if ($conn->query($sql) === TRUE) {    echo "Table MyGuests created successfully";} else {    echo "Error creating table: " . $conn->error;}// insert statements$sql = "INSERT INTO MyGuests (firstname, lastname, email)VALUES ('John', 'Doe', '');";$sql .= "INSERT INTO MyGuests (firstname, lastname, email)VALUES ('Mary', 'Moe', '');";$sql .= "INSERT INTO MyGuests (firstname, lastname, email)VALUES ('Julie', 'Dooley', '')";if ($conn->multi_query($sql) === TRUE) {    echo "New records created successfully";} else {    echo "Error: " . $sql . "
" . $conn->error;}// select statement$sql = "SELECT id, firstname, lastname FROM MyGuests";$result = $conn->query($sql);if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "
"; }} else { echo "0 results";}$conn->close();?>

You can mix APIs and published content as needed.  You can publish HTML, JSON, XML etc. as files if you want, and/or use the API to access the content.

Connect with Crownpeak