在 Azure 中选择适当的 MariaDB 服务器选项Choose the right MariaDB Server option in Azure

在 Azure 中,MariaDB 服务器工作负荷可以在托管的虚拟机基础结构即服务 (IaaS) 中运行,或者作为托管的平台即服务 (PaaS) 运行。With Azure, your MariaDB server workloads can run in a hosted virtual machine infrastructure as a service (IaaS) or as a hosted platform as a service (PaaS). PaaS 提供多个部署选项,每个部署选项中有多个服务层级。PaaS has multiple deployment options, and there are service tiers within each deployment option. 在 IaaS 和 PaaS 之间选择时,必须决定是要管理数据库、应用修补程序并进行备份,还是要将这些操作委托给 Azure。When you choose between IaaS and PaaS, you must decide if you want to manage your database, apply patches, and make backups, or if you want to delegate these operations to Azure.

做出决策时,请考虑以下选项:When making your decision, consider the following two options:

  • Azure Database for MariaDB: 此选项是基于稳定 MariaDB 社区版的完全托管式 MariaDB 数据库引擎。Azure Database for MariaDB: This option is a fully managed MariaDB database engine based on the stable version of MariaDB community edition. 此关系数据库即服务 (DBaaS) 托管在 Azure 云平台中,属于 PaaS 行业类别。This relational database as a service (DBaaS), hosted on the Azure cloud platform, falls into the industry category of PaaS.

    借助 Azure 上的 MariaDB 托管实例,可以使用内置的功能,否则,如果 MariaDB 服务器位于本地或 Azure VM 中,需要进行大量的配置。With a managed instance of MariaDB on Azure, you can use built-in features that otherwise require extensive configuration when MariaDB Server is either on-premises or in an Azure VM.

    将 MariaDB 用作服务时,需要预先支付纵向或横向扩展选项的费用才能在不中断服务的情况下获得更高的控制度。When using MariaDB as a service, you pay in advance with options to scale up or scale out for greater control with no interruption. 与独立的 MariaDB 服务器不同,Azure Database for MariaDB 提供内置高可用性、智能和管理等附加功能。And unlike standalone MariaDB Server, Azure Database for MariaDB has additional features like built-in high availability, intelligence, and management.

  • Azure VM 上的 MariaDB: 此选项属于 IaaS 行业类别。MariaDB on Azure VMs: This option falls into the industry category of IaaS. 使用此服务可以在 Azure 云平台上的完全托管式虚拟机中运行 MariaDB 服务器。With this service, you can run MariaDB Server inside a fully managed virtual machine on the Azure cloud platform. 所有最新版本的 MariaDB 都可以安装在 IaaS 虚拟机上。All recent versions and editions of MariaDB can be installed on an IaaS virtual machine.

    与 Azure Database for MariaDB 相比,Azure VM 上的 MariaDB 的最重要差别在于提供对数据库引擎的控制。In the most significant difference from Azure Database for MariaDB, MariaDB on Azure VMs offers control over the database engine. 但是,获得这种控制的代价是需要自行管理 VM 和许多数据库管理 (DBA) 任务。However, this control comes at the cost of responsibility to manage the VMs and many database administration (DBA) tasks. 这些任务包括维护和修补数据库服务器、数据库恢复和高可用性设计。These tasks include maintaining and patching database servers, database recovery, and high-availability design.

下表列出了这些选项之间的主要差别:The main differences between these options are listed in the following table:

属性Attribute Azure Database for MariaDBAzure Database for MariaDB Azure VM 上的 MariaDBMariaDB on Azure VMs
服务级别协议 (SLA)Service-level agreement (SLA) 提供 99.99% 可用性 SLAOffers SLA of 99.99% availability 同一可用性集中的两个或更多个实例的可用性高达 99.95%。Up to 99.95% availability with two or more instances in the same availability set.

使用高级存储的单一实例 VM 的可用性为 99.9%。99.9% availability with a single instance VM using premium storage.

请参阅虚拟机 SLASee the Virtual Machines SLA.
操作系统修补Operating system patching 自动Automatic 由客户管理Managed by customers
MariaDB 修补MariaDB patching 自动Automatic 由客户管理Managed by customers
高可用性High availability 高可用性 (HA) 模型以节点级中断发生时的内置故障转移机制为依据。The high availability (HA) model is based on built-in failover mechanisms for when a node-level interruption occurs. 在这种情况下,服务将自动创建一个新实例,并将存储附加到此实例。In such cases, the service automatically creates a new instance and attaches storage to this instance. 客户建构、实施、测试和维护高可用性。Customers architect, implement, test, and maintain high availability. 功能可能包括不中断的故障转移群集、不中断的组复制、日志传送或事务复制。Capabilities might include always-on failover clustering, always-on group replication, log shipping, or transactional replication.
混合场景Hybrid scenarios 使用数据传入复制可将外部 MariaDB 服务器中的数据同步到 Azure Database for MariaDB 服务中。With Data-in Replication, you can synchronize data from an external MariaDB server into the Azure Database for MariaDB service. 外部服务器可以处于本地、虚拟机中或是其他云提供商托管的数据库服务。The external server can be on-premises, in virtual machines, or a database service hosted by other cloud providers.

使用只读副本功能可将 Azure Database for MariaDB 主服务器中的数据复制到最多五个只读副本服务器。With the read replica feature, you can replicate data from an Azure Database for MariaDB master server to up to five read-only replica servers. 副本位于同一个 Azure 区域中,或者跨不同的区域。The replicas are either within the same Azure region or across regions. 使用 binlog 复制技术异步更新只读副本。Read-only replicas are asynchronously updated using binlog replication technology.

跨区域读取复制目前为公共预览版。Cross-region read replication is currently in public preview.
由客户管理Managed by customers
备份和还原Backup and restoration 自动创建服务器备份并将其存储在用户配置的本地冗余或异地冗余存储中。Automatically creates server backups and stores them in user-configured storage that is either locally redundant or geo-redundant. 服务将创建完整备份、差异备份和事务日志备份The service takes full, differential, and transaction log backups 由客户管理Managed by customers
监视数据库操作Monitoring database operations 可让客户针对数据库操作设置警报,并在即将达到阈值时采取措施。Offers customers the ability to set alerts on the database operation and act upon reaching thresholds. 由客户管理Managed by customers
灾难恢复Disaster recovery 将自动创建的备份存储在用户配置的本地冗余存储或异地冗余存储中。Stores automated backups in user-configured locally redundant or geo-redundant storage. 备份还可以将服务器还原到某个时间点。Backups can also restore a server to a point in time. 保留期为 7 到 35 天。The retention period is anywhere from 7 to 35 days. 还原是使用 Azure 门户完成的。Restoration is accomplished by using the Azure portal. 完全由客户管理。Fully managed by customers. 责任包括但不限于计划、测试、存档、存储和保留。Responsibilities include but aren't limited to scheduling, testing, archiving, storage, and retention. 另一个选项是使用 Azure 恢复服务保管库备份 Azure VM 和 VM 上的数据库。An additional option is to use an Azure Recovery Services vault to back up Azure VMs and databases on VMs. 此选项目前为预览版。This option is in preview.
性能建议Performance recommendations 根据系统生成的使用日志文件为客户提供性能建议Provides customers with performance recommendations based on system-generated usage log files. 这些建议有助于优化工作负荷。The recommendations help to optimize workloads.

性能建议目前以公共预览版提供。Performance recommendations are currently in public preview.
由客户管理Managed by customers

选择 PaaS 或 IaaS 的业务动机Business motivations for choosing PaaS or IaaS

有多个因素可能会影响你决定选择 PaaS 或 IaaS 来托管 MariaDB 数据库。There are several factors that can influence your decision to choose PaaS or IaaS to host your MariaDB databases.

成本Cost

资金限制通常是确定数据库最佳托管解决方案的首要考虑因素。Limited funding is often the primary consideration that determines the best solution for hosting your databases. 无论你是现金不足的创业公司,或是在预算严格受限的情况下运作现有公司的团队,都存在这种情况。This is true whether you're a startup with little cash or a team in an established company that operates under tight budget constraints. 本部分介绍 Azure 中适用于 Azure VM 上的 MariaDB 和 Azure Database for MariaDB 的计费与许可基础知识。This section describes billing and licensing basics in Azure as they apply to Azure Database for MariaDB and MariaDB on Azure VMs.

计费Billing

Azure Database for MariaDB 目前在多个层级中以服务的形式提供,它资源价格各不相同。Azure Database for MariaDB is currently available as a service in several tiers with different prices for resources. 所有资源都按固定费率按小时计费。All resources are billed hourly at a fixed rate. 有关目前支持的服务层级、计算大小和存储量的最新信息,请参阅基于 vCore 的购买模型For the latest information on the currently supported service tiers, compute sizes, and storage amounts, see vCore-based purchasing model. 可以动态调整服务层级和计算大小,以满足应用程序的不同吞吐量需求。You can dynamically adjust service tiers and compute sizes to match your application's varied throughput needs. 你需要按一般的数据传输费率支付 Internet 流量传出费用。You're billed for outgoing Internet traffic at regular data transfer rates.

Azure 使用 Azure Database for MariaDB 自动配置、修补和升级数据库软件。With Azure Database for MariaDB, Azure automatically configures, patches, and upgrades the database software. 这些自动化操作可以降低管理成本。These automated actions reduce your administration costs. 此外,Azure Database for MariaDB 提供内置备份功能。Also, Azure Database for MariaDB has built-in backup capabilities. 这些功能可帮助你大幅节省成本,尤其是存在大量的数据库时。These capabilities help you achieve significant cost savings, especially when you have a large number of databases. 相比之下,对于 Azure VM 上的 MariaDB,可以选择并运行任何 MariaDB 版本。In contrast, with MariaDB on Azure VMs you can choose and run any MariaDB version. 无论使用何种 MariaDB 版本,都需要为预配的 VM 以及使用的特定 MariaDB 许可证类型付费。No matter what MariaDB version you use, you pay for the provisioned VM and the costs for the specific MariaDB license type used.

Azure Database for MariaDB 针对任何类型的节点级中断提供内置高可用性,同时仍可为服务维护 99.99% 的 SLA 保证。Azure Database for MariaDB provides built-in high availability for any kind of node-level interruption while still maintaining the 99.99% SLA guarantee for the service. 但是,对于 VM 中的数据库高可用性,客户应使用可对 MariaDB 数据库使用的高可用性选项,例如 MariaDB 复制However, for database high availability within VMs, customers should use the high availability options like MariaDB replication that are available on a MariaDB database. 使用支持的高可用性选项不会提供额外的 SLA。Using a supported high availability option doesn't provide an additional SLA. 但是,它可以让你凭借额外的成本和管理开销实现 99.99% 以上的数据库可用性。But it does let you achieve greater than 99.99% database availability at additional cost and administrative overhead.

有关定价的详细信息,请参阅以下文章:For more information on pricing, see the following articles:

管理Administration

对许多企业来说,决定过渡到到云服务的关键在于降低管理复杂度,因为这涉及到成本。For many businesses, the decision to transition to a cloud service is as much about offloading complexity of administration as it is about cost. 借助 IaaS 和 PaaS,Azure 可以:With IaaS and PaaS, Azure:

  • 管理底层基础结构。Administers the underlying infrastructure.
  • 自动复制所有数据以提供灾难恢复。Automatically replicates all data to provide disaster recovery.
  • 配置和升级数据库软件。Configures and upgrades the database software.
  • 管理负载均衡。Manages load balancing.
  • 发生服务器故障时执行透明的故障转移。Does transparent fail-over if there's a server failure.

以下列表描述了每个选项的管理注意事项:The following list describes administrative considerations for each option:

  • 使用 Azure Database for MariaDB 可以持续管理数据库。With Azure Database for MariaDB, you can continue to administer your database. 但是,不再需要管理数据库引擎、操作系统或硬件。But you no longer need to manage the database engine, the operating system, or the hardware. 可以持续管理的项的示例包括:Examples of items you can continue to administer include:

    • 数据库Databases
    • 登录Sign-in
    • 索引优化Index tuning
    • 查询优化Query tuning
    • 审核Auditing
    • 安全性Security

    此外,在另一个数据中心配置高可用性只需极少量的配置或管理,或者根本无需配置或管理。Additionally, configuring high availability to another data center requires minimal to no configuration or administration.

  • 使用 Azure VM 上的 MariaDB 可以完全控制操作系统和 MariaDB 服务器实例配置。With MariaDB on Azure VMs, you have full control over the operating system and the MariaDB server instance configuration. 在 VM 上,可以决定何时更新或升级操作系统与数据库软件。With a VM, you decide when to update or upgrade the operating system and database software. 还可以决定何时安装任何其他软件,例如防病毒应用程序。You also decide when to install any additional software such as an antivirus application. 提供的某些自动化功能可以大大简化修补、备份和高可用性。Some automated features are provided to greatly simplify patching, backup, and high availability. 可以控制 VM 的大小、磁盘数目及其存储配置。You can control the size of the VM, the number of disks, and their storage configurations. 有关详细信息,请参阅 Azure 的虚拟机和云服务大小For more information, see Virtual machine and cloud service sizes for Azure.

迁移到 Azure 的时机Time to move to Azure

  • 当开发人员工作效率和新解决方案的快速面市时间至关重要时,Azure Database for MariaDB 是面向云的应用程序的适当解决方案。Azure Database for MariaDB is the right solution for cloud-designed applications when developer productivity and fast time to market for new solutions are critical. 该服务提供类似于 DBA 的编程功能,非常适合云架构师和开发人员,因为它能降低管理底层操作系统和数据库的需求。With programmatic functionality that is like DBA, the service is suitable for cloud architects and developers because it lowers the need for managing the underlying operating system and database.

  • 如果你想要避免购置新本地硬件所要花费的时间和费用,Azure VM 上的 MariaDB 是适用于需要 MariaDB 数据库或者要访问 Windows 或 Linux 中的 MariaDB 功能的应用程序的适当解决方案。When you want to avoid the time and expense of acquiring new on-premises hardware, MariaDB on Azure VMs is the right solution for applications that require a MariaDB database or access to MariaDB features on Windows or Linux. 如果 Azure Database for MariaDB 不合适,则此解决方案也很适合将现有的本地应用程序和数据库按原样迁移到 Azure。This solution is also suitable for migrating existing on-premises applications and databases to Azure intact, for cases where Azure Database for MariaDB is a poor fit.

    由于无需更改呈现层、应用层和数据层,重新架构现有解决方案时可以节省时间和预算。Because there's no need to change the presentation, application, and data layers, you save time and budget on rearchitecting your existing solution. 你可以专注于将所有解决方案迁移到 Azure,并执行 Azure 平台可能需要的某些性能优化。Instead, you can focus on migrating all your solutions to Azure and addressing some performance optimizations that the Azure platform might require.

后续步骤Next steps