25/04/2017
Understanding Database Architecture!
Database-as-a-Service (DBaaS) is a PaaS component that simplifies the use of databases by improving developer agility, DBA productivity, application reliability, performance and security. An overview of DBaaS architectures can be found in this article.
DBaaS solutions deliver this value proposition through the following.
1. Standardized abstractions and unified APIs.
2. Stateless components for a scalable, stable and reliable service.
3. Implement database capabilities for scalability and availability.
4. Automation that improves safety and security.
Let us now look at each of these in turn.
Standardized abstractions and unified API’s
Databases typically offer programmatic and command line interfaces for a variety of activities like installation, configuration, management, and query processing (sometimes also called DDL and DML). Even databases that offer ‘standards-based’ interfaces vary widely in their individual implementations leading to a very wide variety of abstractions and API’s.
It is hard to master many different databases, and for this reason many IT organizations seek to standardize on one. Yet, with databases, a “one-size-fits-all” approach does not work, and developers legitimately require the use of a number of different database technologies in their applications.
Yet, no matter what database one wishes to use, there are numerous popular operations that are common to all of them. Consider for example, the operation of creating a database instance; one needs to do this no matter whether it is MySQL, MongoDB or Redis. Similarly, changing a configuration parameter is something one often does to any database. While the details of how each operation is performed is different, the semantics for both are very similar.
A DBaaS solution standardizes these and offers a common API to both of them; a mechanism that is database agnostic. Consider this example for creating a database instance in Amazon RDS.
https://rds.us-east-1.amazonaws.com/
?Action=CreateDBInstance
&AllocatedStorage=15
&DBInstanceClass=db.m1.large
&DBInstanceIdentifier=myawsuser-dbi01
&Engine=MySQL
[…]
Most databases require you to specify how much space you need, and some information about the machine. This is standardized in the CreateDBInstance call using the various parameters shown above, and the Engine parameter decides what kind of database you want; you could choose from among MySQL, MariaDB, Oracle, … and many other common database technologies.
As you can clearly see, this common abstraction hiding the details of the database specific steps that are required to actually launch an instance, will dramatically improve the productivity of a developer, and the agility of the DBA.
The modern DBA – learn how to remain relevant in the age of DBaaS.
Stateless components allow for a scalable, stable, and reliable service
An important aspect of operating a reliable service that is scalable is ensuring that it is not monolithic in design. Monolithic systems tend to be mostly “totally operational” or “totally down” and most often involve downtime even for simple maintenance. Loosely coupled, largely stateless systems typically provide smaller failure domains. They and also tend to be both scalable and elastic while offering better uptime during regular maintenance activities. Finally, they also provide better overall uptime characteristics in the face of failures.
Well designed DBaaS systems tend to adopt a stateless, loosely coupled architecture, with efficient message passing to produce a scalable, stable and reliable service. Different functions are isolated into their own servers. These servers provide an external API (API Service), policy management (Policy Manager), configuration management (Configuration Manager), reporting and events, and interfaces with the underlying infrastructure (Orchestration).
In a stateless architecture like the one depicted above, each component can be scaled individually. Message passing allows the components to reside on different virtual, or physical machines to provide service resiliency. Individual services can be upgraded independent of each other, and where persistent data is maintained, it is strictly versioned. A service designed in this manner can be highly available and scalable, with no single points of failure.
Implement database capabilities for scalability and availability
Different database technologies offer different methods for delivering scalability and availability and these solutions are broadly classified into replication and clustering. This involves operating multiple database servers and/or partitioning the data amongst those servers to improve query performance and ensure that the system as a whole remains responsive during transient outages. These techniques are analogous to RAID for storage.
Operating replication or clustering leaves absolutely no room for error. DBaaS systems ensure that databases are properly configured and that the health of the replica or the cluster is constantly monitored. They also include mechanisms for automated self-healing that detect a problems and automatically take corrective actions.
DBaaS systems abstract away the underlying complexities and expose simple database-agnostic APIs for managing complex topologies. Consider, for example, the following single API call which allows you to provision an Aurora cluster in AWS.
https://rds.us-east-1.amazonaws.com/
?Action=CreateDBCluster
&DBClusterIdentifier=sample-cluster
&Engine=aurora
&MasterUserPassword=
This single API call provisions a managed, self-healing, and scalable cluster. The DBA is freed up to focus on optimizing schema and queries, and application performance while leaving the system to handle the finer details of the cluster.
Another very popular example of this mechanism is the creation of a read-replica. Regardless of whether one is addressing a MariaDB, MySQL or PostgreSQL database, the same API call CreateDBInstanceReadReplica will create a read replica.
https://rds.us-east-1.amazonaws.com/
?Action=CreateDBInstanceReadReplica
&DBInstanceIdentifier=mysqldb-rr
&SourceDBInstanceIdentifier=mysqldb
Check out this guide: IaaS, PaaS and SaaS – The Good, the bad and the Ugly.
Automation improves safety and security
The illustrations above show how automation improves developer agility and DBA productivity, but it doesn’t stop there.
DBaaS systems also provide automation around other common database management activities like upgrades and patch management.
Consider again the case of the CreateDBInstance API call that allows a requestor to specify a MonitoringInterval, a PreferredBackupWindow, and a PreferredMaintenanceWindow. The DBaaS will continually monitor the database instances at the specified frequency, and schedule automated maintenance activities within the assigned windows.
Database backups sometimes affect performance. Scheduling backups during a low period of activity is a good way to balance data integrity with application performance. Similarly, some database operations may degrade performance or require downtime so DBaaS also can schedule these operations within assigned maintenance windows.
In the case of clustered databases, the DBaaS will arrange for failovers to route queries to active servers while other servers are updated/upgraded. Through this automation, a DBaaS can perform rolling upgrades and perform major updates with little or no downtime.
The activities involved here are not necessarily complex but it is essential that they are performed in a strictly orchestrated manner, in a specific order, and without missing any steps. When managing a fleet of hundreds or thousands of databases, it is practically infeasible to do this in a cost effective way, without automation.
Upgrades are sometimes required for an operating system regardless of the database being operated. These updates are sometimes require specific versions of a database software or changes to specific configuration parameters. These too are virtually impossible to manage without automation.
After creating a database parameter group (using CreateDBParameterGroup), a DBA could update it with specific parameters that were required for some database instance(s) as shown below.
https://rds.us-east-1.amazonaws.com/
?Action=ModifyDBParameterGroup
&DBParameterGroupName=mydbparametergroup01
&Parameters.member.1.ApplyMethod=immediate
&Parameters.member.1.ParameterName=binlog_cache_size
&Parameters.member.1.ParameterValue=65536
This operation would cause all database instances within the specified parameter group to see an immediate change for the configuration parameter ‘binlog_cache_size’ to 65,536. Consider for an instant the enormous benefit of a system like this when a DBA is responsible for hundreds or thousands of database instances.
Conclusion
Databases are complex, high maintenance, and demanding for those who must administer them. Without automation in the form of DBaaS, developer agility and DBA productivity can be severely impacted. As we have shown above, DBaaS solutions enhances productivity while also improving application reliability, scalability, performance and security.
IT organizations can reap the benefits of a DBaaS through the use of hyper-converged solutions that encapsulate DBaaS software tuned for optimum database performance.
DBA. IkeGod Cito.