{"id":223,"date":"2023-06-26T12:44:02","date_gmt":"2023-06-26T10:44:02","guid":{"rendered":"https:\/\/www.mutareb.com\/?p=223"},"modified":"2023-06-26T13:20:32","modified_gmt":"2023-06-26T11:20:32","slug":"databases-on-aws","status":"publish","type":"post","link":"https:\/\/www.mutareb.com\/index.php\/2023\/06\/26\/databases-on-aws\/","title":{"rendered":"Databases on AWS"},"content":{"rendered":"\n<p><div id=\"rendered-content\"><div class=\"rc-MetatagsWrapper\"><div class=\"rc-Course\" role=\"none\"><div class=\"rc-LegacyDataFetch\"><section class=\"cds-199 css-kt8aw0 cds-200 cds-203\"><div class=\"cds-199 css-0 cds-200 cds-201 cds-grid-item cds-206 cds-209\"><div class=\"cds-199 css-1fsmhyl cds-200 cds-201 cds-grid-item cds-203 cds-206\" id=\"main-container\"><div class=\"cds-199 css-12jam8y cds-201 cds-grid-item cds-246\"><main class=\"item-page-content css-b5no2e\" id=\"main\"><div class=\"rc-ReadingItem css-1htsf2o\"><div class=\"css-jgflq0\"><div><div class=\"rc-CML\" dir=\"auto\"><div><div data-track=\"true\" data-track-app=\"open_course_home\" data-track-page=\"item_layout\" data-track-action=\"click\" data-track-component=\"cml\" role=\"presentation\"><div data-track=\"true\" data-track-app=\"open_course_home\" data-track-page=\"item_layout\" data-track-action=\"click\" data-track-component=\"cml_link\"><div data-testid=\"cml-viewer\" class=\"css-1k5v0wb\"><p data-text-variant=\"body1\"><span><span>If you want to run a relational database on AWS, you first need to select how you want to run it: the unmanaged way or the managed way.The paradigm of managed versus unmanaged services is similar to the Shared Responsibility Model. The Shared Responsibility Model distinguishes between AWS\u2019s and the customer\u2019s security responsibility over a service. Similarly, managed versus unmanaged can be understood as a tradeoff between convenience and control.<\/span><\/span><\/p><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/main><\/div><\/div><\/div><\/section><\/div><\/div><\/div><\/div><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Unmanaged Databases<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/d3c33hcgiwev3.cloudfront.net\/imageAssetProxy.v1\/OonHLsR5RQif5MJkTfbIMw_0aa67d834275415d80ddd2de009c5ef1_image.png?expiry=1687910400000&amp;hmac=_Dcpg-OPa__r-5G75khYzPr4h0aFP0xP_cNdC562eQw\" alt=\"\"\/><\/figure>\n\n\n\n<p>If you host a database on Amazon EC2, AWS takes care of implementing and maintaining the physical infrastructure and hardware and installing the operating system of the EC2 instance. However, you\u2019re still responsible for managing the EC2 instance, managing the database on that host, optimizing queries, and managing customer data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Managed Database<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/d3c33hcgiwev3.cloudfront.net\/imageAssetProxy.v1\/aSMN48saSWKSPaVJaQ7pow_922b2935f3dd441cb37409c4562a64f1_image.png?expiry=1687910400000&amp;hmac=H47ZAMylh--2XMSEovEPBDQHhMY-iV2D97qWEhBCwgM\" alt=\"\"\/><\/figure>\n\n\n\n<p>These services provide the setup of both the EC2 instance and the database, and they provide systems for high availability, scalability, patching, and backups. However, you\u2019re still responsible for database tuning, query optimization, and of course, ensuring that your customer data is secure.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Amazon RDS<\/h2>\n\n\n\n<p>Amazon RDS enables you to create and manage relational databases in the cloud without the operational burden of traditional database management. <\/p>\n\n\n\n<p>Amazon RDS supports most of the popular relational database management systems, ranging from commercial options, open source options, and even an AWS-specific option. Here are the supported Amazon RDS engines.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Commercial:<\/strong> Oracle, SQL Server<\/li>\n\n\n\n<li><strong>Open Source:<\/strong> MySQL, PostgreSQL, MariaDB<\/li>\n\n\n\n<li><strong>Cloud Native:<\/strong> Amazon Aurora (a MySQL and PostgreSQL-compatible database built for the cloud. It is more durable, more available, and provides faster performance than the Amazon RDS version of MySQL and PostgreSQL)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">DB Instances<\/h3>\n\n\n\n<p><span><span>A DB instance can contain multiple databases with the same engine, and each database can contain multiple tables.  Underneath the DB instance is an EC2 instance. However, this instance is managed through the Amazon RDS console instead of the Amazon EC2 console. <\/span><\/span>When you create your DB instance, you choose the instance type and size. Amazon RDS supports three instance families.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Standard<\/strong>, which include general-purpose instances<\/li>\n\n\n\n<li><strong>Memory Optimized<\/strong>, which are optimized for memory-intensive applications<\/li>\n\n\n\n<li><strong>Burstable Performance<\/strong>, which provides a baseline performance level, with the ability to burst to full CPU usage.<\/li>\n<\/ul>\n\n\n\n<p>The DB instance you choose affects how much processing power and memory it has. Not all of the options are available to you, depending on the engine that you choose. You can find more information about the DB instance types in the resources section of this unit. Much like a regular EC2 instance, the DB instance uses Amazon Elastic Block Store (EBS) volumes as its storage layer. You can choose between three types of EBS volume storage.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>General purpose (SSD)<\/li>\n\n\n\n<li>Provisioned IOPS (SSD)<\/li>\n\n\n\n<li>Magnetic storage (not recommended)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Secure Amazon RDs<\/h3>\n\n\n\n<p>When you create a DB instance, you select the Amazon Virtual Private Cloud (VPC) that your databases will live in. Then, you select the subnets that you want the DB instances to be placed in. The subnets you add should be private so they don\u2019t have a route to the internet gateway. This ensures your DB instance, and the data inside of it, can only be reached by the backend.<br>Access to the DB instance can be further restricted by using network access control lists (ACLs) and security groups. With these firewalls, you can control, at a granular level, what type of traffic you want to allow into your database. Using these controls provide layers of security for your infrastructure.<\/p>\n\n\n\n<p>Network ACLs and security groups allow you to dictate the flow of traffic. If you want to restrict what actions and resources your employees can access, you can use IAM policies.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Back Up of your Data<\/h3>\n\n\n\n<p><strong>Automatic Backups<\/strong><\/p>\n\n\n\n<p>Automated backups are turned on by default. This backs up your entire DB instance, and your transaction logs. When you create your DB instance, you set a backup window that is the period of time that automatic backups occur. You can retain your automated backups between 0 and 35 days.<\/p>\n\n\n\n<p><strong>Manual Snapshots<\/strong><\/p>\n\n\n\n<p>If you want to keep your automated backups longer than 35 days, use manual snapshots. Manual snapshots are similar to taking EBS snapshots, except you manage them in the RDS console. These are backups that you can initiate at any time, that exist until you delete them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Amazon DynamoDB<\/h2>\n\n\n\n<p>Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. DynamoDB lets you offload the administrative burdens of operating and scaling a distributed database so that you don&#8217;t have to worry about hardware provisioning, setup and configuration, replication, software patching, or cluster scaling.<\/p>\n\n\n\n<p>DynamoDB automatically spreads the data and traffic for your tables over a sufficient number of servers to handle your throughput and storage requirements, while maintaining consistent and fast performance. All of your data is stored on solid-state disks (SSDs) and is automatically replicated across multiple Availability Zones in an AWS Region, providing built-in high availability and data durability.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Core Components of Amazon DynamoDB<\/h3>\n\n\n\n<p>In DynamoDB, tables, items, and attributes are the core components that you work with. A <em>table<\/em> is a collection of <em>items<\/em>, and each item is a collection of <em>attributes<\/em>. DynamoDB uses primary keys to uniquely identify each item in a table and secondary indexes to provide more querying flexibility.<\/p>\n\n\n\n<p>The following are the basic DynamoDB components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Tables<\/strong> \u2013 Similar to other database systems, DynamoDB stores data in tables.<\/li>\n\n\n\n<li><strong>Items<\/strong> \u2013 Each table contains zero or more items. An <em>item<\/em> is a group of attributes that is uniquely identifiable among all of the other items.<\/li>\n\n\n\n<li><strong>Attributes<\/strong> \u2013 Each item is composed of one or more attributes. An <em>attribute<\/em> is a fundamental data element, something that does not need to be broken down any further. <\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Overview of AWS Database Services<\/h2>\n\n\n\n<p>AWS has a variety of different database options for different use cases. Use the table below to get a quick look at the AWS database portfolio.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>DB Type<\/th><th>Use Cases<\/th><th>AWS Service<\/th><\/tr><\/thead><tbody><tr><td>Relational<\/td><td>Traditional applications, ERP, CRM, e-commerce<\/td><td>Amazon RDS, Amazon Aurora, Amazon Redshift<\/td><\/tr><tr><td>Key-value<\/td><td>High-traffic web apps, e-commerce systems, gaming applications<\/td><td>Amazon DynamoDB<\/td><\/tr><tr><td>In-memory<\/td><td>Caching, session management, gaming leaderboards, geospatial applications<\/td><td>Amazon ElastiCache for Memcached, Amazon ElastiCache for Redis<\/td><\/tr><tr><td>Document<\/td><td>Content management, catalogs, user profiles<\/td><td>Amazon DocumentDB (with MongoDB compatibility)<\/td><\/tr><tr><td>Wide column<\/td><td>High-scale industrial apps for equipment maintenance, fleet management, and route optimization<\/td><td>Amazon Keyspaces (for Apache Cassandra)<\/td><\/tr><tr><td>Graph<\/td><td>Fraud detection, social networking, recommendation engines<\/td><td>Amazon Neptune<\/td><\/tr><tr><td>Time series<\/td><td>IoT applications, DevOps, industrial telemetry<\/td><td>Amazon Timestream<\/td><\/tr><tr><td>Ledger<\/td><td>Systems of record, supply chain, registrations, banking transactions<\/td><td>Amazon QLDB<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">different database options on AWS<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>If you want to run a relational database on AWS, you first need to select how you want to run it: the unmanaged way or the managed way.The paradigm of managed versus unmanaged services is similar to the Shared Responsibility Model. The Shared Responsibility Model distinguishes between AWS\u2019s and the customer\u2019s security responsibility over a&hellip; <a class=\"more-link\" href=\"https:\/\/www.mutareb.com\/index.php\/2023\/06\/26\/databases-on-aws\/\">Continue reading <span class=\"screen-reader-text\">Databases on AWS<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[32,45],"series":[],"class_list":["post-223","post","type-post","status-publish","format-standard","hentry","category-cloud-computing","tag-aws","tag-databases","entry"],"_links":{"self":[{"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/posts\/223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/comments?post=223"}],"version-history":[{"count":4,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/posts\/223\/revisions"}],"predecessor-version":[{"id":229,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/posts\/223\/revisions\/229"}],"wp:attachment":[{"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/media?parent=223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/categories?post=223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/tags?post=223"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/series?post=223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}