DATABASES Relationship Databases - 2 types -- Multi AZ - For disaster recover -- Read Replicas - For performance -- 6 flavours: Oracle, MsSQL, MySQL, Aurora, MariaDB, PostgresQL - Runs on VM (cannot SSH) - Patching is Amazon's responsibility due to above - Is not serversless except for Aurora Serverless) Eventual consistent reads - consistency reached within a second. Strongly consistent reads - returns a result that reflects all writes until the request AMAZON DYNAMODB - stored on SSD - Serverless - Spread across 3 geographically distinct data centers - Eventual Consistent Reads (default) - fast and flexible NoSQL DB service for all applications tht need coiinsistent, single digit millisecond latency at any scale - Fully managed DB supports both document and klet value data models - great for mobile, web, gaming, ad-tech, IoT and many other applications AURORA - MySQL and PostgreSQL compatible - up to 5x better than MySQL, 3x better than PostgreSQL - starts with 10GB and scales at 10GB increments (up to 64TB) - Compute can scale up to 32 vCPUs and 244GB of Memory - 2 copies in each AZ, with minimum of 3 AZ. (6 copies) - Transparently handle loss of upto 2 copies of Data without affecting write availability; and upto 3 copies without affecting read availability - Is self-healing (scans data block and disks continuously for errors and repairs automatically) - can have up to 15 replicas - backups automatically enabled, does not impact performance - can take snapshots AWS Aurora Serverless is an on-demand autoscaling configuration for the compatible editions of Aurora -- Provides relatively simple cost effictive option for infrequent intermittent or unpredictable workloads RDS BACKUPS - Automated backups - Snapshots Automated backups - take full daily backups - can recover down to a second - enabled by default - stored in S3 (free) Snapshots - Taken Manually - User initiated - can keep after RDS instance is deleted Restoring backups - Will be on a new instance with new endpoint Encryption is supported - Backups read-replicas and snapshots will also be encrypted Multi AZ - allows you to have exact copy of prod DB in another Availability Zone - encryption done using AMAZON KMS service - will fall over to standby DB - all automatic - Is for Disaster recovery only (uses only 1 db, but quickly falls over to copy if neede) - Available for SQL Server, Oracle, MySQL, PostgreSQL, MariaDB - can force failover to another instance by rebooting with failover Read Replica - can be Multi AZ - can be different regions - Has one db that takes input (Read-only copies) - replicates it onto replicas, which instances use for read - Achieved by Asynchronous replication from Primary RDS instance to read replicas - used for very read-heavy DB workloads - example, massive blogs. - used for scaling/increase performance, not disaster recovery - can have up to 5 copies - each replica have separate endpoint - (this or elasticache?) - mush have backups turned on to create replicas - can be mysql, postgreSQL, aurora, mariadb, Oracle What is data warehousing - Data warehousing use different type of databases architecture ( database perspective and infrastructure layer) - Used for business intelligence. tools like cognos, sql server reporting services used to pull in very large and complex data sets. Usually used by management to do queries on data (such as current performance vs targets ets..) OnLine Transaction Processing (OLTP) - order number XXXX - pulls a row of data such as name, date, address, delivery status - Used Relational or Non-relational DB OnLine Analytical Processing (OLAP) - Net profit for Europe and Australia - get sum of each sales - unit cost Of radio in each region - sales price of each radio - sales cross - unit cost (minus) -- basically large quantity of data processing REDSHIFT - Databases used for online processing - Fully managed Petabyte scale data warehouse service - Running many/large queries of huge data - Can be single or multi node (leader and compute node - up to 128 compute nodes) - Default 1 day retention backup (max 35 days) - Attempts to maintain 3 copies (original, replica on the computer nodes , and backup in s3) - Only charged for compute node hours (not leader node) - Encrypted in transit using SSL - Encrypted at rest using AES-256 encryption - Takes care of key management by default - Can manage own keys via HSM (HKS) - only available in one AZ - can restore snapshots to another AZ ELASTICACHE - service makes it east to deploy operate and scale an in-memory cache in the cloud - improves performance of web apps by allowing you to retrieve information from fast managed in-memory caches instead of relying entirely on slower disk based databases. - Supports 2 open-source in-memory caching engines -- Memcached (MULTI-THREADED, HORIZONTALLY SCALES) -- Redis (ADVANCED DATA TYPES, MULTI AZ, BACKUP RESTORES) - Used to increased DB and web app performance - Database is overloaded. use elasticache, or add read-replica