Amazonrds 简明教程
Amazon RDS - MariaDB Features
MariaDB 是一个受欢迎的开源关系型 DB,可通过其社区版功能在亚马逊 RDS 服务中获得。MariaDB 的几乎每个功能都可以在 RDS 平台中使用。以下是 RDS 平台中 MariaDB 主要功能的简要说明。
MariaDB is a popular open Source Relational DB which is available in the amazon RDS services with its community edition features. Almost every feature of MariaDB can be leveraged in the RDS platform. Below is a brief description on MariaDB’s major features in the RDS platform.
Supported Versions
RDS 平台中支持的主要版本是 10.0、10.1 和 10.2。如果在创建 DB 期间未提及版本,则它默认为当时最更新的版本。以下是一个使用 Python SDK 程序中的 AWS API 获取所有受支持的 DB 引擎版本的示例。
The versions 10.0, 10.1,10.2 are the major versions supported in the RDS platform. If no version is mentioned during the DB creation, it defaults to the most recent version at that point in time. Below is an example of how to get all supported DB Engine versions using AWS API in a python SDK program.
import boto3
client = boto3.client('rds')
response = client.describe_db_engine_versions(
DBParameterGroupFamily='',
DefaultOnly=True,
Engine='mariadb',
EngineVersion='',
ListSupportedCharacterSets=False, #True,
)
print(response)
当我们运行以上程序时,我们得到以下输出:
When we run the above program, we get the following output −
{
"ResponseMetadata": {
"RetryAttempts": 0,
"HTTPStatusCode": 200,
"RequestId": "16179fbd-9d07-425b-9b86-cc61359ce7b4",
"HTTPHeaders": {
"x-amzn-requestid": "16179fbd-9d07-425b-9b86-cc61359ce7b4",
"date": "Fri, 14 Sep 2018 06:45:52 GMT",
"content-length": "1658",
"content-type": "text/xml"
}
},
"u'DBEngineVersions'": [
{
"u'Engine'": "mariadb",
"u'DBParameterGroupFamily'": "mariadb10.2",
"u'SupportsLogExportsToCloudwatchLogs'": true,
"u'SupportsReadReplica'": true,
"u'DBEngineDescription'": "MariaDb Community Edition",
"u'EngineVersion'": "10.2.12",
"u'DBEngineVersionDescription'": "mariadb 10.2.12",
"u'ExportableLogTypes'": [
"audit",
"error",
"general",
"slowquery"
],
"u'ValidUpgradeTarget'": [
{
"u'Engine'": "mariadb",
"u'IsMajorVersionUpgrade'": false,
"u'AutoUpgrade'": false,
"u'Description'": "MariaDB 10.2.15",
"u'EngineVersion'": "10.2.15"
}
]
}
]
}
Database Security
RDS MariaDB 的安全性在三个层面上进行管理。
The security for RDS MariaDB is managed at three layers.
Using IAM
在这种方法中,IAM 用户应该有适当的策略和权限。授予此类权限取决于授予这些权限的帐户持有者或超级用户。
In this approach the IAM user should have appropriate policies and permissions. Granting of such permissions is decided by the account holder or the super user who grants these permissions.
Using VPC
您可以使用 VPC 安全组或 DB 安全组来决定哪些 EC2 实例可以打开连接到 DB 实例的端点和端口。这些连接还可以使用 SSL 建立。
You either use a VPC security group or DB security group to decide which EC2 instances can open connections to the endpoint and port of a DB instance. These connections can also be made using SSL.
Using IAM Database Authentication
在这种方法中,您使用 IAM 角色和身份验证令牌。身份验证令牌生成一个唯一值,该值与访问过程中使用的 IAM 角色相关。在这里,数据库以及其他亚马逊网络服务资源(如 EC2 和 S3 等)使用同一组凭证。
In this approach you use a IAM role and an authentication token. The authentication token generates a unique value which is relevant to the IAM role that is used in the access process. Here the same set of credentials are used for database as well as other aws resources, like EC2 and S3 etc.
Cache Warming
缓存预热可以通过在 DB 实例关闭时保存缓冲池的当前状态,然后在 DB 实例启动时从已保存信息重新加载缓冲池,从而为您的 MariaDB DB 实例提供性能提升。此方法无需缓冲池从正常数据库使用中“预热”,而是使用已知常见查询的页面预加载缓冲池。
Cache warming can provide performance gains for your MariaDB DB instance by saving the current state of the buffer pool when the DB instance is shut down, and then reloading the buffer pool from the saved information when the DB instance starts up. This approach bypasses the need for the buffer pool to "warm up" from normal database use and instead preloads the buffer pool with the pages for known common queries.
缓存预热主要为使用标准存储的 DB 实例提供性能优势。
Cache warming primarily provides a performance benefit for DB instances that use standard storage.
您可以创建事件以自动且定期地转储缓冲池。例如,以下语句创建一个名为 periodic_buffer_pool_dump 的事件,该事件每小时转储一次缓冲池。
You can create an event to dump the buffer pool automatically and at a regular interval. For example, the following statement creates an event named periodic_buffer_pool_dump that dumps the buffer pool every hour.
CREATE EVENT periodic_buffer_pool_dump
ON SCHEDULE EVERY 1 HOUR
DO CALL mysql.rds_innodb_buffer_pool_dump_now();