<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Bharathi Batthula on Medium]]></title>
        <description><![CDATA[Stories by Bharathi Batthula on Medium]]></description>
        <link>https://medium.com/@bharathi-batthula6?source=rss-67827b410cbe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*8ZPmvGw3bvsLvBXw.jpg</url>
            <title>Stories by Bharathi Batthula on Medium</title>
            <link>https://medium.com/@bharathi-batthula6?source=rss-67827b410cbe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 21:52:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bharathi-batthula6/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AWS AUDITING, MONITORING AND NOTIFICATION SERVICES 2nd Part]]></title>
            <link>https://bharathi-batthula6.medium.com/aws-auditing-monitoring-and-notification-services-2nd-part-9ee1181edd93?source=rss-67827b410cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ee1181edd93</guid>
            <dc:creator><![CDATA[Bharathi Batthula]]></dc:creator>
            <pubDate>Sat, 28 Nov 2020 06:46:13 GMT</pubDate>
            <atom:updated>2020-11-28T06:46:13.459Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>AWS AUDITING, MONITORING AND NOTIFICATION SERVICES 2nd Part</strong></p><p><strong>AWS Cloud Trail</strong></p><p>AWS CloudTrail is an AWS service that helps you enable governance, compliance, and operational and risk auditing of your AWS account.</p><p>Actions taken by a user, role, or an AWS service are recorded as events in CloudTrail.</p><ul><li>Events include actions taken in the AWS Management Console, AWS Command Line Interface, and AWS SDKs and APIs.</li></ul><p>CloudTrail is enabled on your AWS account when you create it. (but not cloud Trail Logging)</p><p>When activity occurs in your AWS account, that activity is recorded in a Cloud Trail event.</p><ul><li>You can easily view events in the CloudTrail console by going to Event history.</li></ul><p><strong>Cloud Trail Benefits</strong></p><p><strong>You can identify:</strong></p><ul><li>Who or what took which action,</li><li>What resources were acted upon,</li><li>When the event occurred, and other details to help you analyze and respond to activity in your AWS account.</li></ul><p><strong>This can benefit in the following areas</strong></p><ul><li><strong>Security</strong></li></ul><p>Visibility into your AWS account activity is a key aspect of security best practices.</p><ul><li>Tracking changes in an AWS environment</li></ul><p>You can use Cloud Trail to view, search, download, archive, analyze and respond to account activity across your AWS infrastructure.</p><p><strong>Cloud Trail Event History and Trails</strong></p><p>Event history allows you to view, search and sownload the past 90 days of activity in your account.</p><p>You can create a CloudTrail trail to archive, analyze and respond to change in your AWS resources</p><p>Cloud Trail logging, which is basically, sending the Cloud Trail events to a bucket is not enabled by default.</p><ul><li>You need to create a Trail and define a bucket, then Cloud Trail will send events to this bucket, i.e will start logging the identified/selected events.</li></ul><p>A trail is a configuration that enables delivery of events to an Amazon S3 bucket that you specify.</p><p>You can deliver analyze events in a trail with Amazon CloudWatch Logs and CW Events.</p><p>You can create a trail with the CloudTrail console, the AWS CLI, or the CloudTrail API.</p><p>You can create 2 types of trails:</p><ul><li><strong>A trail that applies to all regions (Recommended by AWS)</strong></li></ul><p>When you create a trail that applies to all regions,</p><ul><li>CloudTrail records events in each region and delivers the cloudTraul event log files to an S3 bucket that you specify.</li></ul><p>This is effectively like creating the trail in each of these regions.</p><p>If a region is added after you create a trail that applies to all regions,</p><ul><li>That new region is automatically included, and events in that region are logged.</li></ul><p>This is default option when you create a trail in the cloud Trail console.</p><p><strong>Advantages of All Regions Trails</strong></p><p>A trail that applies to all regions has the following advantages:</p><ul><li>The configuration settings for the trail apply consistently across all regions.</li><li>Receiving CloudTrail events from all regions in a single S3 bucket and, optionally in a CloudWatch Logs log group.</li><li>Managing trail configuration for all regions from one location.</li><li>Immediately receiving CloudTrail events from a new region when launched.</li><li>Ability to create trails in regions that you don’t use often to monitor for unusual activity.</li></ul><p><strong>Trail limits per Region</strong></p><ul><li>If you have different but related user groups, such as developers, security personnel, and IT auditors, you can create multiple trails per region.</li></ul><p>This allows each group to receive its own copy of the log files.</p><ul><li>CloudTrail supports five trails per region.</li></ul><p>A trail that regions counts as one trail in every region.</p><p><strong>Cloud Trail Event History and Trails</strong></p><p>The second type of Trail you can create,</p><ul><li>A trail that applies to one region</li></ul><p>When you create a trail that applies to one region,</p><ul><li>CloudTrail records the events in that region only.</li><li>It then delivers the CloudTrail event log files to an Amazon S3 bucket that you specify.</li></ul><p>If you create additional single trails, you can have those trails deliver CloudTrail event log files to the same Amazon S3 bucket or to seperate buckets.</p><p>This is the default option when you create a trail using the AWS CLI or the CloudTrail API.</p><p><strong>CloudTrail Events Logging</strong></p><p>You can store your log files in your bucket for as long as you wnat.</p><ul><li>You can also define Amazon S3 lifecycle rules to archieve or delete log files automatically.</li></ul><p>CloudTrail typically delivers log files within 15 minutes of account activity.</p><ul><li>In addition, Cloud Trail publishes log files multiple times an hour, about every five minutes.</li><li>These log files contain API calls services in the account that support CloudTrail.</li></ul><p><strong>CloudTrail Log File Integrity Validation- What is it</strong></p><p>Is the ability of Amazon CloudTrail to determine whether a log file was modified, deleted, or unchanged after Cloud trail trail has delivered it to your S3 bucket.</p><p>This feature is built using industry standard algorithms: SHA-256 for hashing and SHA-256 with RSA for digital.</p><ul><li>This makes it computationally infeasible to modify, delete or forge CloudTrail log files without detection.</li></ul><p>You can use the AWS CLI to validate the files in the location where CloudTrail delivered them.</p><p><strong>Benefits of this feature:</strong></p><ul><li>Validated log files are invaluable in security and forensic investigations.</li><li>A validated log file enables you to assert positively that the log file itself has not changed, or</li><li>Whether a particular user credentials performed specific API activity.</li></ul><p><strong>Cloud Trail Log File Integrity Validation- How It Works:</strong></p><p>When the validation feature is enabled</p><ul><li>Cloud Trail creates a hash for every log file that it delivers.</li><li>Every hour. CloudTrail creates and delivers a file that reference the log files for the last hour and contains a hash of each.</li></ul><p>*This file is called a digest file.</p><p>*Cloud Trail signs each digest file using the private key of a public and private key pair.</p><p>*After delivery, the public key can be used to validate the digest file.</p><p>*Cloud Trail uses different key pairs for each AWS region.</p><p>The digest files are delivered to the same Amazon S3 bucket associated with the trail as your CloudTrail log files.</p><p>Each digest file also contains the digit signature of the previous digest file if one exists.</p><p>The signature for the current digest file is in the metadata properties of the digest file Amazon S3 object.</p><p>If the log files are delivered from all regions or from multiple accounts into a single Amazon S3 bucket,</p><ul><li>CloudTrail will deliver the digest files from those regions or from multiple accounts into a single Amazon S3 bucket</li><li>CloudTrail will deliver the digest files from those regions and accounts into the same bucket.</li><li>The digest files are put into a folder separate from the log files.</li></ul><p>This separation of digest files and log files enables you to enforce granular security policies and permits existing long processing solutions to continue to operate without modification.</p><p>The CloudTrail log files and digest files stored in Amazon S3, you can use Amazon S3 MFA Delete protection.</p><p>AWS Management Console, APIs or CLI can be used to enable the feature.</p><p><strong>Validating Log Files Integrity</strong></p><p>To validate the integrity of Cloud Trail log files the AWS CLI or create 3rd party solution can be used.</p><p>The AWS CLI will validate files in the location where CloudTrail delivered them.</p><p>Validation for logs that have been moved to a different location, either in Amazon s3 or elsewhere,</p><ul><li>Customers need to create their own validation tools.</li></ul><p>I will continue with CloudWatch in next blog.</p><p>Bharathi.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ee1181edd93" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS AUDITING, MONITORING AND NOTIFICATION SERVICES]]></title>
            <link>https://bharathi-batthula6.medium.com/aws-auditing-monitoring-and-notification-services-dfc839c09ec7?source=rss-67827b410cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfc839c09ec7</guid>
            <dc:creator><![CDATA[Bharathi Batthula]]></dc:creator>
            <pubDate>Wed, 16 Sep 2020 11:51:40 GMT</pubDate>
            <atom:updated>2020-09-16T11:51:40.326Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>AWS AUDITING, MONITORING AND NOTIFICATION SERVICES</strong></p><p><strong>AWS SNS</strong></p><p>SNS is a fast, flexibility, fully managed push notification service</p><p>Its a web service that coordinates and manages the delivery or sending of messages (from the cloud) to subscribing endpoints or clients.</p><p>It allows for sending individual messages or fan-out messages to a large number of recipients or other distributed AWS services.</p><ul><li>Messages published to an SNS topics will be delivered to the subscribers immediately.</li></ul><p><strong>SNS allows you to:</strong></p><ul><li>Send push messages ( not poll messages like SQS)</li><li>Scale as your needs grow</li><li>Engage audiences directly or all at once</li><li>Deliver messages worldwide and across multiple transport protocols</li><li>Easily connect with other AWS services such as Cloud Watch, SQS, Lambda, S3</li><li>Message delivery analysis</li><li>Usage based pricing</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*PnmoSYRGbbU1b0JI0s89Fw.png" /></figure><p>In Amazon SNS, there are two types of clients-publishers and subscribers- also referred to as producers and consumers</p><ul><li>Publishers communicate asynchronously with subscribers by producing and sending a message to a topic,</li><li>Subscribers (web servers, email addresses, Amazon SQS, HTTP/S, email, SMS, Lambda, Application) when they are subscribed to the topic.</li></ul><p><strong>SNS Topic:</strong></p><p>It is a logical access point and communication channel.</p><p>Each topic has a unique name</p><ul><li>A topic name is limited to 256 alphanumeric characters</li><li>The topic name must be unique within the AWS account</li><li>Each topic is assigned an AWS ARN (Amazon Resource Name) once it gets created</li><li>A topic can support subscribers and notification deliveries over multiple protocols</li></ul><p>Messages/requests to a single topic can be delivered over multiple protocols as configured when creating each subscriber</p><p><strong>Delivery formats/transport protocols (end points)</strong></p><ul><li>SMS</li><li>Email</li><li>Email-JSON</li><li>HTTP/HTTPs</li><li>SQS</li><li>AWS Lambda</li></ul><p>When using Amazon SNS, you create a topic and control access to it by defining access policies that determine which publishers and subscribers can communicate with the topic.</p><p>Instead of including a specific destination address in each message, a publisher sends a message to the topic. A publisher sends messages to topics that they have created or to topics they have permission to publish to.</p><ul><li>Amazon SNS matches the topic to alist of subscribers who have subscribed to that topic and delivers the message to each of those subscribers.</li><li>Each topic has a unique name that identifies the Amazon SNS endpoint for publishers to post messages and subscribers to register for notifications.</li><li>Subscribers receive all messages published to the topics to which they subscribe, and all subscribers to a topic receive the same messages.</li></ul><p><strong>SNS Reliability</strong></p><p>Amazon SNS stores all topic and message information within Amazon’s proven network infrastructure and data centers.</p><ul><li>At least three copies of the data are stored across multiple availability zones,</li></ul><p>This means that no single computer or network failure renders Amazon SNS inaccessible.</p><p><strong>Securing messages to topics:</strong></p><ul><li>All API calls made to Amazon SNS are validated for the users AWS ID and the signature.</li><li>AWS recommends that users secure their data over the wire by connecting to the secure SSL end-points</li></ul><p><strong>Authenticating API Calls:</strong></p><p>All API calls made to Amazon SNS will validate authenticity by requiring that:</p><ul><li>Request be signed with the secret key of the AWS ID account</li><li>And verifying the signature included in the requests.</li></ul><p>Amazon SNS require publishers with AWS IDs to validate their messages by singing messages with their secret AWS key; the signature is then validated by Amazon SNS.</p><p><strong>SNS- Security- Publishing/Subscribers to an SNS Topic</strong></p><ul><li>By default, only the topic owner can publish to the SNS topic</li><li>The owner can set/change permissions to one or more users to publish to his topic</li><li>Only the owner of the topic can grant/change permissions for the topic.</li><li>Subscribers can be those with/without AWS IDs</li></ul><p>Only subscribers with AWS ID can request subscriptions</p><ul><li>Both publishers and subscribers can use SSL to help secure the channel to send and receive messages.</li></ul><p><strong>SNS Mobile Push Notifications</strong></p><p>SNS Mobile Push lets you use Simple Notification Service (SNS) to deliver push notifications to Apple, Google, Fire OS and Windows devices</p><p>With Push notifications, an installed mobile application can notify its users immediately by popping a notification about an event, without opening the application.</p><p>Push notifications can only be sent to devices that have your app installed, and whose users have opted in to receive them.</p><p>SNS Mobile Push does not require explicit opt in for sending push notifications, but IOS, Android and Kindly Fire operating systems do require it.</p><p>In order to send push notifications with SNS, you must also register your app and each installed device with SNS.</p><p><strong>SNS Mobile Push Notifications</strong></p><p>Supported push notification platforms: Currently, the following notifications platforms are supported:</p><ul><li>Amazon Device Messaging (ADM)</li><li>Apple Push Notification Service (APNS)</li><li>Google Cloud Messaging (GCM)</li></ul><p><strong>SNS Mobile Push Notifications</strong></p><p>SNS topics can have subscribers from any supported push notifications platform, as well as any other endpoint type such as SMS or email.</p><p>When you publish a notification to a topic, SNS will send identical copies of that message to each endpoint subscribed to the topic.</p><p><strong>AWS SNS &amp; AWS CloudTrail</strong></p><p>You can get the history for SNS API calls made to your account by enabling Cloudtrail</p><ul><li>Cloudtrail will delivery log files for your SNS API Calls</li></ul><p>Cloudtrail logs will provide:</p><p>SNS API Caller</p><p>Source IP address</p><p>Time of the API call</p><p>Request parameters</p><p>Response elements returned by SNS</p><ul><li>This would be handy for security analysis, auditing, and operating/troubleshooting purposes</li><li>Cloudtrail logs for SNS are available for authenticated API calls only.</li></ul><p>This would be handy for security analysis, auditing, and operational/troubleshooting purposes.</p><p>Cloudtrail logs for SNS are available for authenticated API calls only.</p><p>In next blog, we will discuss much on other monitoring services.</p><p>Happy Day!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfc839c09ec7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS: Amazon Aurora 2nd Part]]></title>
            <link>https://bharathi-batthula6.medium.com/aws-amazon-aurora-979f104424f3?source=rss-67827b410cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/979f104424f3</guid>
            <dc:creator><![CDATA[Bharathi Batthula]]></dc:creator>
            <pubDate>Tue, 18 Aug 2020 11:03:03 GMT</pubDate>
            <atom:updated>2020-09-16T11:53:19.661Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>AWS: Amazon Aurora</strong></p><p><strong>Aurora Read Replicas</strong></p><p>Up to 15 Aurora Replicas can be distributed across the Availability Zones</p><ul><li>DB cluster volume is made up of multiple copies of the data for the DB cluster</li><li>The data in the cluster volume is represented as a single, logical volume to the primary instance and to Aurora Replicas in the DB cluster</li></ul><p>Due to this cluster volumes architecture, Aurora Replicas can return the same data for query results with minimal replica lag</p><ul><li>Usually much less than 100 milliseconds after the primary instance has written an update.</li><li>Because the cluster volume is shared among all instances, to additional work is required to replicate a copy of the data for each aurora replica.</li></ul><p>In contrast to Amazon RDS MySQL, Read Replicas must replay, on a single thread, all write operations from the master DB instance to their local data store.</p><ul><li>This affects the ability of the Read Replica to support large volumes of reads.</li></ul><p><strong>Auto Scaling with Aurora Replicas</strong></p><p>Aurora Auto Scaling dynamically adjusts the number of Aurora Replicas provisioned for an Aurora DB cluster using single master replication.</p><p>Aurora Auto Scaling enables Aurora DB clusters to handle sudden increase in connectivity or workload.</p><ul><li>When the connectivity or workload decreases, Aurora Auto Scaling removes unnecessary Aurora Replicas so that no change will be incured for unused provisioned DB instances.</li></ul><p>Define and apply a scaling policy to an Aurora DB cluster. The scaling policy defines the minimum and maximum number of Aurora Replicas that Aurora Auto Scaling can manage.</p><ul><li>Based on the policy, Aurora Auto Scaling adjusts the number of Aurora Replicas up or down in response to actual workloads, determined by using Amazon Cloud Watch metrics and target values.</li><li>Aurora Auto Scaling is available for both Aurora MySQL and Aurora PostgreSQL.</li><li>Although Aurora Auto Scaling manages Aurora Replicas, the Aurora DB cluster must start with at least one Aurora Replica.</li></ul><p><strong>Amazon Aurora-Primary Fail over</strong></p><p>If the primary DB instance of a DB cluster fails, Aurora automatically fails over to a new primary DB instance.</p><ul><li>It does so by either promoting an existing Aurora Replica to a new primary DB instance OR creating a new primary DB instance.</li></ul><p>During a failover, the reader endpoint might direct connections to the new primary DB instance of a DB cluster for a short time after an Aurora Replica is promoted to the new primary DB instance.</p><p>If the primary instance fails, an Aurora Replica is promoted to the primary instance.</p><ul><li>There is brief interruption during which read and write requests to the primary instance fail with an exception, and the Aurora Replica are rebooted.</li></ul><p>If your Aurora DB cluster doesn&#39;t include any Aurora Replicas then your DB cluster will be unavailable for the duration it takes your DB instance to recover from the failure event.</p><ul><li>Promoting an Aurora Replica is much faster than recreating the primary instance.</li><li>For high availability scenarios, AWS recommends creating one or more Aurora Replicas of the same DB instance class as the primary instance and in different Availability Zones for your DB cluster.</li></ul><p><strong>Amazon Aurora-Failover, Cluster Endpoint, and DNS</strong></p><p>Rebooting the primary instance of an Amazon Aurora DB cluster also automatically reboots the Aurora Replicas for that DB cluster, in order to re-establish an entry point that guarantees read/write consistency across the DB cluster.</p><p>The physical IP address pointed to by the cluster endpoint changes when the fail over mechanism promotes a new DB instance to be the read write primary instance for the cluster.</p><p><strong>Amazon Aurora-Storage and Reliability</strong></p><p>Aurora’s distributed and storage architecture is an important factor in performance, scalability and reliability for Aurora clusters.</p><ul><li>Aurora data is stored in solid state drives.</li></ul><p>Aurora maintains multiple (at least 2) copies of your data three availability zones, in a single AWS region.</p><ul><li>This makes Aurora cluster volume highly durable and hence, the change of losing data as a result of a disk failure is greatly minimized.</li></ul><p>This replication also ensures that your database is more available during a failover.</p><ul><li>It does so because the data copies already exist in the other Availability Zones and continue to serve data requests to the DB instances in your DB cluster.</li><li>The amount of replication is independent of DB instances in your cluster.</li></ul><p>This Aurora shared storage architecture makes:</p><ul><li>Adding and Removing DB instance becomes quicker since there is no need for Aurora to copy data to the new DB instance.</li><li>Removing a DB instance from a cluster without removing any of the underlying data from the cluster.</li></ul><p><strong>Amazon Aurora- Storage and Reliability</strong></p><p>Aurora cluster volumes automatically grow as the amount of data in your database increases.</p><p>An Aurora cluster volume can grow to a maximum size of 64 tebibytes</p><ul><li>Table size is limited to the size of the cluster volume, so it can be upto 64 TiB</li></ul><p>Customers are only charged for the space used in an Aurora cluster volume.</p><p>When Aurora data is removed, such as by dropping a table or partition, the overall allocated space remains the same.</p><ul><li>The free space is reused automatically when data volume increases in the future.</li></ul><p><strong>Amazon Aurora_ High Availability</strong></p><p>In an Aurora cluster single master replication when creating reader instances across Availability Zones, Amazon RDS automatically provisions and maintains them synchronously.</p><p><strong>Amazon Aurora -Security</strong></p><p>Security for Amazon Aurora is managed in different levels:</p><ul><li>IAM is used to control who can perform Amazon RDS management actions on Aurora DB clusters and DB instances.</li></ul><p>Aurora DB cluster must be created in an Amazon Virtual Private Cloud (VPC)</p><ul><li>An Amazon VPC endpoint for Amazon Aurora is a logical entity within a VPC that allows connectivity only to Amazon Aurora.</li><li>The Amazon VPC routes intra VPC requests to Amazon Aurora and routes responses back to the VPC through the vpc endpoint.</li></ul><p>To control which devices and Amazon EC2 instances can open connections to the endpoint and port of the DB instance for Aurora DB cluster in a VPC, a VPC security group is used.</p><p><strong>Amazon Aurora-Encryption</strong></p><p>SSL can be used from the client application to encrypt a connection to a DB cluster running Aurora MySQL or Aurora PostgreSQL.</p><p>Encrypt Amazon Aurora DB clusters and snapshots at rest by enabling the encryption option for Aurora DB clusters.</p><ul><li>Data that is encrypted at rest includes the underlying storage for DB clusters, its automated backups, Read Replicas and snapshots.</li><li>Database clients need not to be modified to use encryption.</li></ul><p>Amazon Aurora encrypted DB clusters use the industry standard AES256 encryption algorithm.</p><p>You can’t convert an unencrypted DB cluster to an encrypted one.</p><ul><li>You can, however, restore an unencrypted Aurora DB cluster snapshot to an encrypted Aurora DB cluster.</li></ul><p>To do this specify a KMS encryption key when you restore from the unencrypted DB cluster snapshot.</p><ul><li>DB clusters that are encrypted cant be modified to disable encryption.</li></ul><p>As of now, an encrypted Aurora Replica cant be created from an unencrypted Aurora DB cluster and</p><ul><li>An unencrypted Aurora Replica cant be created from an encrypted Aurora DB cluster.</li></ul><p><strong>Amazon Aurora Global Data Base</strong></p><p>An Aurora global database consists of one primary AWS Region where data is mastered, and one read-only, secondary AWS Region.</p><ul><li>The Aurora cluster in the primary AWS Region performs both read and write operations.</li><li>The cluster in the secondary region enables low-latency reads</li><li>The secondary cluster can be scaled up independently by adding one or more (up to 16) Aurora Replicas to serve read only workloads.</li></ul><p>Aurora replicates data to the secondary AWS Region with typical latency of under a second.</p><ul><li>An Aurora global database uses dedicated infrastructure to replicate your data, leaving database resources available entirely to serve application workloads.</li></ul><p>If you have an existing Aurora cluster, you can take a snapshot and restore it to a new Aurora global database.</p><p>You can manually activate the failover mechanism if a cluster in a different AWS Region is a better choice to be primary cluster.</p><p><strong>Amazon Aurora with other AWS Services</strong></p><p>You can use Aurora MySQL DB native function or stored to invoke Lambda functions.</p><p>Loading data into a table from text files in an Amazon S3 bucket is available for Amazon Aurora MySQL.</p><p>It is possible to query data from an Amazon Arora MySQL DB cluster and save it directly into text files stored in an Amazon S3 bucket.</p><ul><li>This functionality can be used to skip bringing the data down to the client first, and then copying it from the client to Amazon S3.</li></ul><p><strong>Amazon Aurora MySQL Replication- Across AWS Regions</strong></p><p>An Amazon Aurora MySQL DB cluster can be created as a Read Replica in a different AWS Region than the source DB cluster:</p><p>This approach can:</p><ul><li>Improve your disaster recovery capabilities,</li><li>Allows for scaling read operations into an AWS Region that is closer to your users and</li><li>Can make it easier to migrate from one AWS Region to another.</li></ul><p>You can create Read Replicas of both encrypted and unencrypted DB clusters.</p><ul><li>The Read Replica must be encrypted if the source DB cluster is encrypted</li></ul><p>For each source DB cluster, you can have up to five cross region DB clusters that are Read Replicas.</p><p>When creating the Read Replica, Amazon RDS takes a snapshot of the source cluster and transfers the snapshot to the Read Replica region.</p><p>In a cross-region scenario, there is more lag time between the source DB cluster and the Read Replica due to the longer network channels between regions.</p><p>You can promote an Aurora MySQL Read Replica to a standalone DB cluster.</p><ul><li>When you promote an Aurora MySQL Read Replica, its DB instances are rebooted before they become available.</li><li>The promotion process can take several minutes or longer to complete, depending on the size of the Read Replica.</li></ul><p>Typically, you promote an Aurora Read Replica to a standalone DB cluster as a data recovery scheme if the source DB cluster fails.</p><p><strong>Amazon RDS MySQL DB to Aurora MySQL Replication</strong></p><p>Since Amazon Aurora MySQL is compatible with RDS MySQL,</p><ul><li>Replication between a RDS MySQL database and an Amazon MySQL DB cluster can be achieved,</li></ul><p>This requires InnoDB engine</p><p>AWS recommends that the RDS MySQL database run MySQL version 5.5 or later.</p><p>You can set up replication such that the Aurora MySQL DB cluster is the replication master or the replica.</p><ul><li>You can replicate with:</li></ul><p>An Amazon RDS MySQL DB instance,</p><p>A MySQL database external to Amazon RDS, or</p><p>Another Aurora MySQL DB cluster.</p><ul><li>You can also replicate with an Amazon RDS MySQL DB instance or Aurora MySQL DB cluster in another AWS Region.</li><li>When you are performing replication across AWS regions, ensure that your DB clusters and DB instances are publicly accessible.</li></ul><p>This means Aurora MySQL DB clusters must be part of a public subnet in your VPC.</p><ul><li>In addition to Aurora Replicas in Aurora PostgreSQL cluster, you can setup replication between an Amazon RDS PostgreSQL DB instance as the master and an Aurora PostgreSQL DB cluster.</li><li>You do by creating an Aurora Read Replica of an Amazon RDS PostgreSQL DB instance.</li></ul><p><strong>Amazon Aurora-Automatic Backup and Manual Snapshots</strong></p><p>Aurora backs up your cluster volume automatically and retains restore data for the length of the backup retention period.</p><p>Aurora backups are continuous and incremental so you can quickly restore to any point within the backup retention period.</p><ul><li>Recover your data to any given time during the retention period by creating a new Aurora DB cluster from the backup data that Aurora retains.</li></ul><p>No performance impact or interruption of database service as backup data is being written.</p><p>Manual snapshots of the data can also be created for cluster volume to retain a backup retention period. A new DB cluster cab be created from these snapshots.</p><p><strong>Amazon Aurora- Sharing DB Cluster Snapshots</strong></p><p>Using Amazon RDS, a manual DB cluster snapshot can be shared in the following ways:</p><ul><li>Whether the shared snapshot is encrypted, or unencrypted, authorized AWS accounts can copy the snapshot.</li><li>Whether encrypted or unencrypted authorized AWS accounts can directly restore a DB cluster from the snapshot instead of taking a copy of it and restoring from that.</li></ul><p>To share an automated DB cluster snapshot, create a manual DB cluster snapshot by copying the automated snapshot and then share that copy.</p><p>You can share a manual snapshot with up to 20 other AWS accounts.</p><p>An encrypted manual snapshot can be shared as public, it will be available to all AWS accounts.</p><p>DB cluster snapshot that have been encrypted “at rest” can be shared,</p><ul><li>The account this is shared with need to be given access (by sharing) the KMS encryption key used to encrypt the snapshot.</li></ul><p><strong>Amazon Aurora- Backtrack</strong></p><p>Backtracking “rewinds” the DB cluster to the time specified.</p><p>Backtracking provides the following advantages over traditional backup and restore:</p><ul><li>You can easily undo mistakes, if you mistakenly perform a destructive action, you can backtrack the DB cluster to a time before the destructive action with minimal interruption of service.</li><li>You can backtrack a DB cluster quickly</li><li>Unlike restoring the DB cluster to a point in time, Back tracking a DB cluster doesn&#39;t require a new DB cluster and rewinds the DB cluster in minutes.</li><li>It allows for exploring earlier data changes.</li></ul><p>DB cluster can be backtracked back and forth in time to help determine when a particular data change occurred.</p><p><strong>Amazon Aurora Server less- What it is</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/1*bSXdok4OhrFX5iao6ljj3g.png" /></figure><p>It is an on demand, auto scaling configuration for Amazon Aurora.</p><p>Aurora Serverless provides a relatively simple, cost effective operation for infrequent, or unpredictable workloads.</p><p>It can provide this because it automatically starts up, scales compute capacity to match your application’s usage and shuts down when its not in use.</p><p>A non-Server less DB cluster for Aurora is calls a provisioned DB cluster.</p><p>Aurora Server less clusters and provisioned clusters both have the same kind of high capacity, distributed and highly available storage volume.</p><p>You can connect to Aurora server less cluster using the TLS/SSL protocol.</p><p><strong>Amazon Aurora Server less-How it works</strong></p><p>With Aurora serverless, creating a database endpoint without specifying the DB instance class size can be done.</p><p>Set the minimum and maximum capacity in terms of Aurora Capacity Units</p><ul><li>Each ACU is a combination of processing and memory capacity</li></ul><p>Database storage automatcally scales from 10 GiB TO 64 TiB</p><p>With Aurora Serverless, the database endpoint connects to a proxy fleet that routes the workload to a fleet of resources that are automatically scaled.</p><ul><li>Because of the proxy fleet, connections are continuous as Aurora Serverless scales the resources automatically based on the minimum and maximum capacity specifications.</li></ul><p>Database client application dont need to change to use the proxy fleet.</p><ul><li>Aurora serverless manages the connections automatically.</li><li>Scaling is rapid because it uses a pool of “warm” resources that are always ready to service requests.</li><li>Storage and compute are seperate such that it cans cale down to zero compute processing and charge will be only for storage.</li><li>Aurora serverless manages the warm pool of resources in an AWS Region to minimize scaling time.</li><li>When new resources are added to the Aurora DB cluster, Aurora Serverless uses the proxy fleet to switch active client connection to the new resources.</li><li>At any specific time, charges are only for the ACUs that are being used.</li><li>It scales to zero capacity when there are no connections for a 5 minute period actively used in your Aurora DB cluster.</li></ul><p><strong>Amazon Aurora Serverless — Failover</strong></p><p>Currently the DB isntance in an Aurora Serverless DB cluster is created in a single Availability Zone.</p><p>If either the DB instance or the AZ becomes unavailable, Aurora re-creates the DB instance in a different AZ.</p><ul><li>This referred to as automatic multi AZ failover.</li></ul><p>This failover mechanism takes longer time than in an Aurora provisioned cluster</p><ul><li>The reason why the Aurora Serverless failover time is currently undefined is because it depends on demand and capacity availability in other AZs within the given AWS Region.</li></ul><p><strong>Amazon Aurora Serverless — Snapshots</strong></p><p>You can create an Aurora Serverless cluster when restoring from snapshot of an Aurora provisioned DB cluster</p><p>You can take a snapshot of the Aurora Serverless DB cluster</p><p>The cluster volume for an Aurora Serverless cluster is always encrypted</p><ul><li>You can choose the encryption key, but not turn off encryption</li></ul><p>To copy or share a snapshot of an Aurora Serverless cluster you encrypt the snapshot using your own KMS Key.</p><p>Thankyou,</p><p>Bharathi.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=979f104424f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS: Amazon Aurora]]></title>
            <link>https://bharathi-batthula6.medium.com/aws-amazon-aurora-6928aa1bc2b5?source=rss-67827b410cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/6928aa1bc2b5</guid>
            <dc:creator><![CDATA[Bharathi Batthula]]></dc:creator>
            <pubDate>Tue, 18 Aug 2020 05:38:03 GMT</pubDate>
            <atom:updated>2020-08-18T05:38:03.720Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>AWS: Amazon Aurora</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*vwD9L0Y-dbxZbKEXgoGGFQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*zdY2cCA56zOjlkjGZFOLvg.png" /></figure><p>Amazon Aurora is a part of the Amazon RDS family</p><p>It is fully managed relational database engine that compatible with MySQL and PostgreSQL</p><ul><li>The code, tools, and applications you use today with your existing MySQL and PostgreSQL databases can be used with Aurora</li></ul><p>Aurora can deliver up to 5 times the throughput of MySQL and up to 3 times the throughput of PostgreSQL, without requiring changes to most of your existing applications.</p><p>Its MySQL and PostgreSQL compatible database engines are customized to take advantage of the fast distributed storage.</p><p>The underlying storage grows automatically as needed, up to 64 TiB</p><p>An Amazon Aurora DB cluster consists of one or more DB instances and a cluster volume that manages the data for those DB instances.</p><p>The Aurora cluster volume is a virtual database storage volume that spans multiple Availability zone having 2 copies of the DB cluster data.</p><p>The Aurora cluster illustrates the separation of compute capacity and storage</p><ul><li>An Aurora configuration with only a single DB instance is still a cluster</li><li>Since the underlying storage volume involves multiple storage nodes distributed across multiple Availability Zones.</li></ul><p>Two types of DB instances make up an Aurora single Master DB cluster:</p><p><strong>Primary DB instances</strong></p><p>It supports read and write operations and performs all of the data modifications to the cluster volume.</p><p>Each Aurora DB cluster has one primary DB instance.</p><p><strong>Aurora Replica</strong></p><p>It connects to the same storage volume as the primary DB instance and supports only read operations</p><p>Each Aurora DB cluster can have up to 15 Aurora Replicas in addition to the primary DB instance</p><p>Maintain high availability by locating Aurora Replicas in separate Availability zones</p><p>Aurora automatically fails over to Aurora Replica in case the primary DB instance becomes unavailable.</p><ul><li>You can specify the failover priority for Aurora Replicas.</li><li>Aurora Replicas can also offload read workloads from the primary DB instance.</li><li>Aurora automates and standardizes database clustering and replication,</li></ul><p>_These are usually among the most challenging aspects of database administration and configuration.</p><p>Aurora features like automatic clustering, replication, and storage allocation make it cost effective and simple to set up, operate and scale large MySQL and Postgre SQL deployment.</p><p>Data can be migrated from Amazon RDS for MySQL and Amazon RDS for postgreSQL into Aurora to do this</p><ul><li>Create RDS snapshot and restore it to Aurora, or by setting up one-way replication</li></ul><p>Push-button migration tools can be used to convert existing Amazon RDS for MySQL and Amazon RDS for PostgreSQL application to Aurora.</p><p><strong>Amazon Aurora Connection Management and Endpoints</strong></p><p>When connecting to an Aurora cluster, the host name and port that specified point to an intermediate handler called an endpoint.</p><ul><li>An endpoint is represented as an Aurora-specific URL that contains a host address and a port.</li></ul><p>Aurora uses the endpoint mechanism to abstract these connections</p><ul><li>Thus, hard coding all the host names or writing own logic for load balancing and rerouting connections when some DB instances arenot available is not required</li></ul><p>Using endpoints, each connection can be mapped to the appropriate instance or group of instances based on the use case.</p><ul><li>Connecting to whichever instance is the primary instance</li><li>Connecting to the reader endpoint, with Aurora automatically performing load balancing among all the Aurora replica</li><li>Connecting to custom endpoints associate with different subnets of DB instances</li><li>Connecting to a specific instance endpoint to examine details about a epcific DB instance.</li></ul><p>The following types of endpoints are available from an Aurora DB cluster</p><p><strong>Cluster endpoint:</strong></p><p>A cluster endpoint for an Aurora DB cluster that connects to the current primary DB instance for that DB cluster.</p><ul><li>This endpoint is the only one that can perform write operations.</li><li>The cluster endpoint is the one that needs to connect to when first setting up a cluster or when the cluster only contains a single DB instance.</li><li>This endpoint cant be changed, deleted or altered.</li></ul><p>The cluster endpoint provides fail over support for read/write connections to the DB cluster.</p><p>If the current primary DB instance of a DB cluster fails. Aurora automatically fails over to anew primary DB instance.</p><p>During a fail over, the DB cluster continues to serve connection requests to the cluster endpoint from the new primary DB instance, with the minimal interruption of service.</p><p><strong>Reader endpoint:</strong></p><ul><li>A reader endpoint for an Aurora DB cluster connects to one of the available Aurora Replica for that DB cluster.</li></ul><p>Each Aurora DB cluster has only one reader endpoint. built in and whose name and attributed are manged by Aurora.</p><p>If there is more than one Aurora Replica, the reader endpoint directs each connection requests to one of the Aurora Replicas</p><p>Use the reader endpoint for read operations, such as queries.</p><p>It cant be used for write operations.</p><p>The reader endpoint provides loas balancing support for read-only connections to the DB cluster.</p><ul><li>This type of endpoint, like the cluster endpoint, cant be created , deleted or modifies.</li><li>If the DB cluster contains only a primary DB instance, the reader endpoint serves connection requests from the primary DB instance.</li></ul><p><strong>Instance Endpoints</strong></p><p>An instance endpoint connects to a specific DB instance within a Aurora cluster</p><ul><li>Each DB instance in a DB cluster has its own unique instance endpoint.</li></ul><p>The instance endpoint provides direct control connections to the DB cluster.</p><p><strong>Custom Endpoints</strong></p><p>A custom endpoint for an Aurora cluster represents a set of DB instances that you choose.</p><ul><li>An Aurora DB cluster has no custom endpoint until you create one.</li></ul><p>When you connect to the endpoint, Aurora performs load balancing and choose one of the instances in the group to handle the connection.</p><ul><li>You define which instance this endpoint refers to, and you decide what purpose the endpoint serves.</li></ul><p>You can create up to five custom endpoints for each provisioned Aurora cluster</p><p>You cant use custom endpoints for Aurora Server less clusters.</p><p>Thankyou,</p><p>Bharathi.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6928aa1bc2b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS: RDS (Relational Database Service)]]></title>
            <link>https://bharathi-batthula6.medium.com/aws-rds-relational-database-service-e5140053d662?source=rss-67827b410cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5140053d662</guid>
            <dc:creator><![CDATA[Bharathi Batthula]]></dc:creator>
            <pubDate>Sat, 08 Aug 2020 10:26:07 GMT</pubDate>
            <atom:updated>2020-08-08T10:26:07.647Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>AWS: RDS (Relational Database Service)</strong></p><p><strong>Manual Backup (Snapshots)</strong></p><p>Are not used for point in time recovery</p><p>Are user initiated, not RDS service initiated</p><p>Stored in Amazon S3</p><p>They are not deleted automatically when you delete your RDS instance, rather, they wills tay on S3 until you go ahead and delete them.</p><p>It is recommended to take a final snapshot before deleting your RDS DB instance</p><ul><li>It comes in handy if you want to restore your DB instance in the future.</li></ul><p>Can be shared with other AWS accounts directly.</p><p><strong>DB Automated Backups- Restore/Recovery</strong></p><p>You can specify a point-in-time restore to any given second during the retention period.</p><p>When you initiate a point-in-time recovery, transaction logs are applied to the most appropriate daily backup to restore your DB to that point-in-time.</p><p>When you restore a DB instance, only the default DB parameters &amp; security groups are associated with the restored instance.</p><ul><li>Once the restore is complete, you need to associate/apply the customer DB parameters and security group settings.</li></ul><p><strong>Restoring from a DB snapshots</strong></p><p>You can NOT restore from a DB snapshot into an existing DB instance, rather it has to create a new DB instance</p><p>Then new DB instance will have a new endpoint.</p><p>Restoring from a backup or a DB snapshot changes the RDS instance endpoint</p><p>A new DB instance will be created when you perform a restore</p><ul><li>This new DB instance have a new RDS endpoint.</li></ul><p>You can change the storage type (magnetic,provisioned IOPS, General purpose) during a restore process.</p><p><strong>Multi-AZ RDS-Event Notifications</strong></p><p>You will be alerted by a DB instance event when a failover occurs.</p><p>AWS RDS uses AWS SNS to send RDS event via SNS notifications</p><ul><li>You can use API calls to the AWS RDS service to list the RDS events in the past 14 days (Describe Events API)</li><li>You can view past 14 days events using CLI</li><li>Using AWS Console, you can only view RDS events for the last 1 days (24 hours)</li></ul><p><strong>Processes that happen on Standby first</strong></p><p>The following procedures are done on standby first, then on primary</p><ul><li>OS patching</li><li>System upgrades</li><li>DB Scaling</li></ul><p>In Multi-AZ, Snapshots and Automated backups are done on Standby instance to avoid I/O suspension on Primary instance.</p><p><strong>RDS Multi-AZ deployment-Maintenance</strong></p><p>The sequence is done as follows:</p><p>Maintenance on Standby is performed</p><p>Standby promoted to primary</p><p>Maintenance performed on old primary (current standby)</p><p><strong>Version Upgrade</strong></p><p>You can manually upgrade a DB instance to a supported DB engine version from AWS console as follows:</p><ul><li>RDS&gt; DB instances&gt; Modify instance&gt; Set DB Engine version</li></ul><p>By default, Changes will take effect during the next maintenance window</p><p>OR</p><p>You can force an immediate upgrade if you need to</p><p>In Multi-AZ deployments:</p><ul><li>Version upgrade will be conducted on both primary and Standby at the same time, which will cause an outage (unavailable for both)</li><li>Advised to do it during change/maintenance windows.</li></ul><p><strong>Security Groups and N ACLs</strong></p><p>In a Multi-AZ scenario</p><p>Make sure that your security groups and NACLs will allow your APP servers to communicate with both primary and standby instances.</p><p>In case of a fail over the standby becomes the primary.</p><p><strong>Encryption of Existing Unencrypted RDS Instances</strong></p><p>You can not encrypt an existing un-encrypted DB instance</p><p>To do that, you need,</p><p>Create a new, encrypted instance and migrate your data to it (from the un-encrypted to the encrypted)</p><p>OR</p><p>Restore from a backup/snapshot into a new encrypted RDS instance.</p><p>App to DB Instance encryption</p><p>RDS supports SSL encryption for communication between the App Instances and the RDS DB instances</p><p>RDS generates a certificated for the instance which is used to encrypt this communication.</p><p>RDS service supports encryption at rest for all DB engines using AWS KMS.</p><p><strong>RDS DB Encryption at Rest</strong></p><p>For an encrypted at Rest DB instance:</p><ul><li>All its snapshots</li><li>Backups</li><li>Data storage</li><li>Read Replicas created from the DB instance</li></ul><p>Are all encrypted as well</p><p>Encryption and decryption is handled transparently</p><p><strong>RDS DB Instance_Security Best Practices</strong></p><p>Use AWS IAM accounts to control access to RDS API actions</p><p>Assign an individual IAM account to each person who manages RDS resources</p><p>Grant the least permissions required by each user to perform the assigned duties</p><p>Use IAM groups to manage/grant permissions to multiple users at one time.</p><p>Rotate your IAM credentials regularly</p><p><strong>Read Replicas</strong></p><p>When the required read I/O capacity is reached but still more I/O capacity is required for heavy/intensive read applications, read replicas can come in handy.</p><p>Read replica is a replica of the primary RDS DB instance, but they can only be used for read actions.</p><p>Primary DB instance becomes the source of the application to this read replica.</p><ul><li>The data is first written to the source, primary DB instance, then using asynchronous replication, it gets replicated to the read replica.</li></ul><p>Multi-AZ with read replicas can be combined in one deployment</p><ul><li>However, It is not possible to create Multi-AZ for your read replicas (i.e created standby read replica DB instances for your read replica instances)</li></ul><p>Read replicas can be created from the console or API</p><p>Automatic backups (retention period not zero) must be enabled and remain enabled for read replicas to work.</p><p>Is supported with transnational DB storage engines, and are supported on InnoDB engines not MyISAM (MyMAPo):</p><ul><li>MySQL</li><li>MariaDB</li><li>PostgreSQL</li><li>Oracle</li></ul><p>Each of these DB engines support up to 5 read replicas per source/primary DB instance</p><p><strong>Read Replicas-Use cases</strong></p><p>Shifting read intensive applications such as Business (or sales) reporting, or Data warehousing to read from read replicas as opposed to overload the primary DB.</p><p>Scaling beyond the I/O capacity of your main DB instance for read heavy workloads.</p><p>Service read traffic while the source is unavailable.</p><p><strong>Creating Read Replicas</strong></p><p>It can be done from API or AWS console</p><p>The AZ where you want the read replica to be can be specified</p><p>The read replicas storage type or instance class can be different from the source DB instance</p><p>DB engine type can not be change though, it is inherited from the source (primary) DB instance.</p><p>If you scale the source DB instance, you should also scale the Read Replicas.</p><p>You cannot have more than four instances involved in a replication chain</p><p>If the source instance of a Multi-AZ deployment fails over to the secondary, any associates Read Replicas are switched to use the secondary as their replication source</p><p>You must explicitly delete Read Replicas, using the same mechanisms for deleting a DB instance.</p><p>If you delete the source DB instance without deleting the replicas, ecah replica is promoted to a stand-alone, single AZ DB instance.</p><p>If you promote a MySQL or Maria-DB Read Replica that is in turn replicating to other Read Replicas, those Read Replicas remain active.</p><p>If replication is stopped for more than 30 consecutive days, either manually or due to a replication error, Amazon RDS terminates replication between the master DB instance and all Read Replicas.</p><p><strong>RDS Billing- Standalone DB Instance</strong></p><p>No up front costs</p><p>You Pay for:</p><ul><li>DB instance hours (partial hours charged as full hours)</li><li>Storage GB/mo</li><li>I/O requests/mo -for Magnetic RDS storage instance only</li><li>Provisioned IPS/mo. — For RDS Provisioned IOPS SSD instance</li><li>Internet data transfer</li><li>Backup Storage (DB backups, and Active manual Snapshots) :</li></ul><p>This increases by increasing DB backups retention period</p><p>Backup storage for automated RDS backups (not the manual snapshots) up to the provisioned RDS instance’s EBS volume size (EBS volume) is free of charge.</p><p><strong>RDS Billing</strong></p><p>The DB storage provisioned to your DB instance is in a single AWS AZ.</p><p>Since AWS backups your DB to multiple AZs for data durability</p><ul><li>AWS charges for the database storage above the free allocated DB storage for your instance</li><li>Free automated backup storage provided to the client/account is in single AZ.</li></ul><p>AWS will charge for the following (in addition to the single AZ DB instance charges)</p><ul><li>Multi-AZ DB hours</li><li>Provisioned Storage (Multi-AZ)</li><li>Double write I/Os (writing to the Active/Primary, and Replication from primary to Standby)</li></ul><p>You are not charged for DB data transfer during replication from primary to standby</p><p>Your DB storage does not change between standalone and Multi-AZ deployments (same DB and same AWS storage volume for that DB in multiple AZs for durability)</p><p><strong>RDS Storage Scaling</strong></p><p>You can scale an RDS storage up only, you can not decrease or scale down the storage size</p><ul><li>You can NOT decrease the allocated storage for an RDS instance</li></ul><p>You can scale storage and also change storage type for all supported DB engines, except MS SQL server</p><p><strong>Scaling: </strong>You can scale (UP only, not down) the compute and storage capacity of your existing RDS DB instances</p><p>Scaling storage can happen while the RDS instance is still running, available/ accessible</p><ul><li>This may cause some performance degradation during the change, but will result in enhanced I/O after</li></ul><p>Scaling compute will cause a downtime to your DB instance</p><p>You do the required scaling changes, then you can</p><p>Immediately have the changes take effect,</p><p>OR</p><p>Leave it to the default, which will make the changes take effect during the Maintenance window.</p><p><strong>Scaling- MS SQL Server</strong></p><p>You can NOT change the storage capacity nor type of storage of the MS SQL Server on windows-based RDS instances</p><ul><li>This is due to extensibility limitations of striped storage attached to windows server.</li></ul><p>To work around the baove, you can take a snapshot, use it to start a new DB instance with the desired storage type and capacity (must be an increase, not a decrease)</p><ul><li>Note that a new instance, will have a new RDS endpoint.</li></ul><p><strong>Scaling beyond RDS instance capabilities</strong></p><p>If you hit the largest RDS DB instance, and you still need to scale, you can:</p><p>Use portioning and split your RDS DB over multiple RDS instances.</p><p><strong>Cloud Trail</strong></p><p>Cloud trail logs all API calls to your RDS DB instances</p><p>Finally done with RDS and Amazon Aurora will be in my next blog.</p><p>Happy Weekend!</p><p>Bharathi.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5140053d662" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS: RDS (Relational Database Service)]]></title>
            <link>https://bharathi-batthula6.medium.com/aws-rds-relational-database-service-b614ed1fab53?source=rss-67827b410cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/b614ed1fab53</guid>
            <dc:creator><![CDATA[Bharathi Batthula]]></dc:creator>
            <pubDate>Wed, 05 Aug 2020 09:17:39 GMT</pubDate>
            <atom:updated>2020-08-05T09:17:39.844Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>AWS: RDS (Relational Database Service)</strong></p><p>It is an fully managed Relational DB Engine service where aws is responsible for:</p><p>Security and patching of the DB instance</p><p>Automated backup for your DB instances</p><p>Software updates for the DB engine</p><p>Easy scaling for storage and compute as required</p><p>If selected, Multi-AZ with synchronous replication between the active and standby DB instances</p><p>Automatic fail over if Multi-AZ was selected</p><p>Providing the ability to create DB read replicas for DB read scaling (intensive read deployments)</p><p>Every DB instance has a weekly maintenance window</p><p>If you did not specify one at the time you create the DB instance,</p><ul><li>AWS will choose one randomly for you (30 minutes long)</li></ul><p><strong>AWS is NOT responsible for:</strong></p><p>Managing DB settings</p><p>Building a relational DB schema</p><p>DB performance tuning</p><p><strong>Supported Relational DB engines</strong></p><ul><li>MS SQL Server</li><li>Oracle</li><li>PostgreSQL</li><li>Maria DB</li><li>AWS Aurora</li><li>MySQL</li></ul><p><strong>Licensing Models</strong></p><ul><li><strong>Two Licensing models:</strong></li></ul><p>_ Bring Your Own License (BYOL)</p><p>_License Included</p><p><strong>RDS Limits</strong></p><p>Up to 40 DB instances per account</p><ul><li>10 of this 40 can be ORACLE or MS SQL Server under License Included model.</li></ul><p>or</p><p>Under BYOL model, all 40 can be any DB engine you need.</p><p><strong>RDS instance storage</strong></p><p>Amazon RDS use EBS volumes (not instance-store) fro DB and Logs storage</p><p><strong>General Purpose RDS Storage:</strong></p><p>Use for</p><ul><li>DB workloads with moderate I/O requirements</li></ul><p><strong>Provisioned IOPS RDS Storage:</strong></p><p>Use for</p><ul><li>High performance OLTP workloads</li></ul><p><strong>Magnetic RDS Storage:</strong></p><p>Use for</p><ul><li>Small DB workloads</li></ul><p><strong>Maximum Storage Capacity for RDS DB instances</strong></p><p>Upto 4TB for MS SQL Server</p><p>Upto 6TB for the rest of supported RDS Engines</p><p><strong>Multi-AZ RDS option</strong></p><p>You can select the Multi-AZ option during RDS DB instance launch</p><p>RDS service creates a standby instance in a different AZ in the same region, and configures SYNCHRONOUS replication between the primary and standby.</p><p>You can NOT read and write to the standby RDS DB instance</p><p>You can not dictate/select which AZ in the region will be chosen to create the standby DB instance.</p><ul><li>You can however, which AZ is selected after the standby is created.</li></ul><p>Depending on the instance class it may take 1 to few minutes to failover to the standby instance</p><ul><li>Recommended is to implement DB connection retries into your application, to account for this few minutes required for failover</li><li>AWS recommends the use of provisioned IOPS instance for Multi-AZ instances</li></ul><p><strong>Multi-AZ RDS- Fail over trigger</strong></p><ul><li>Loss of primary AZ DB instance failure</li><li>Loss of Network connectivity to primary</li><li>Compute (EC2) unit failure on primary</li><li>Storage (EBS) unit failure on primary</li><li>The primary DB instance is changed</li><li>Patching the OS of the DB insyance</li></ul><p>Manual failover (reboot with failover on primary)</p><p><strong>Multi- AZ RDS — Failover Logistics</strong></p><p>During failover, the CNAME of the RDS DB instance is updated to map to the standby IP address</p><ul><li>This is why it is recommended to use the endpoint to reference your DB instances and not its IP address</li><li>The CNAME does not change, because the RDS endpoint does not change</li></ul><p><strong>Multi- AZ failover-Recommendation</strong></p><p>RDS endpoint does not change by selecting Multi-AZ option, how ever the primary and standby instances will have different IP addresses, given they are in different AZs.</p><ul><li>Hence it is always recommended that you do not use the IP address to point to your Multi-AZ RDS instances, rather use the endpoint\</li><li>This is very helpful in a failover scenario, since the primary will fail to the standby, i.e: IP address of RDS instance will change</li></ul><p>Referencing by endpoint means, there is no change (endpoint wise) when a fail over happens, so no disruptions or manual interventions to facilitate RDS DB instance access in a fail over scenario.</p><p><strong>Multi-AZ-Manual Fail over and Reboot</strong></p><p>In Multi-AZ deployment, you can only initiate a manual RDS DB instance failover (Primary to Standby) when rebooting</p><ul><li>This is by selecting the Reboot with fail over” reboot option on the primary RDS DB instance</li></ul><p>A DB instance is required for changes to take effect when you change the DB parameter group, or when you change a static DB parameter.</p><ul><li>This reboot restarts the DB engine</li><li>The DB parameter group, is a configuration container for the DB engine configuration.</li></ul><p><strong>RDS -Subnet Groups</strong></p><p>Is a collection of subnets in a VPC that you want to allocated for DB instances launched in the VPC</p><p>Each DB subnet group must have at least one subnet in each AZ in a region</p><p>Even if you are starting with standalone RDS instance, configure the subnet group with a subnet in each AZ in the region.</p><ul><li>This will facilitate launching your standby instance in the subnet group when you opt for the multi-AZ deployment</li></ul><p>During creating your RDS instance you can select a preferred AZ, and specify which subnet group, and subnet of that group, for your RDS DB instance.</p><ul><li>Then RDS service will allocate an IP address in that subnet to your RDS instance.</li><li>And then RDS service will create an ENI, attach it to the RDS instance, and assign the above IP address to it.</li></ul><p><strong>DB Automated Backups or Manual Snapshots</strong></p><p>These are two methods to backup and restore your RDS instances</p><ul><li><strong>AWS RDS automated backups</strong></li><li><strong>And, User initiated manual backups</strong></li></ul><p>Either one backs up the entire DB instance and not just the individual DBs.</p><p>Either one creates a storage volume snapshots of your entire DB isntance</p><ul><li>Not Just the individual databases</li></ul><p>You can make copies of automated backups and of manual snapshots</p><p><strong>AWS RDS Automated Backups</strong></p><p>Automated backups by AWS, back up your DB data to multiple AZs to provide for data durability.</p><p>Are labeled automated in AWS console (easily distinguishable).</p><p>Stored in amazon S3.</p><p>Multi-AZ automated backups will be taken from the standby instance not the primary.</p><p>The DB instance must be in “Active” state for the automated backups to happen,</p><ul><li>If in any other state, like storage-Full state, the automated backups will not happen.</li></ul><p>Automated backups (not the manual ones) are used for point-in time DB instance recovery.</p><p>It can restore the DB up to 5 minutes in time, using the DB transaction logs and the Automated snapshot.</p><p>RDS automatically backs up the DB instance daily, by creating a storage volume snapshot of your DB instance, including the DB transaction logs (modifications), which are critical to be able to restore uo to last 5 minutes in time.</p><ul><li>You can choose when during the day this is done (Backup window)</li><li>No additional charge for RDS backing up your DB instances</li></ul><p>During your daily backup window, your I/O may be suspended (for standalone RDS deployments)</p><p>For Multi-AZ deployment, backups are taken from the standby DB instance (True for Maria-DB, MySQL, Oracle, Postgre SQL)</p><p>Automated backups are deleted when you delete your RDS DB instance</p><p>An outage occurs if you change the backup retention period from Zero to Non-Zero value or the other way around</p><p>Automated backups are currently supported only for InnoDB storage engine for MySQL.<br>* Use of automated backups with other MySQL DB storage engines, including ISAM, may lead to unpredictable behavior during restoration.</p><p><strong>Sharing your Automated Snapshots</strong></p><p>Can not be shared directly</p><p><strong>DB Retention Period</strong></p><p>The period of time AWS keeps the automated backups before deleting them</p><p>By default : 7 days if configured from the AWS console for all DB engines (Except Aurora, default is one day regardless how it was configured)</p><p>Thankyou,</p><p>Bharathi.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b614ed1fab53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS:Introduction of Databases]]></title>
            <link>https://bharathi-batthula6.medium.com/aws-introduction-of-databases-6826e4c4b16c?source=rss-67827b410cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/6826e4c4b16c</guid>
            <dc:creator><![CDATA[Bharathi Batthula]]></dc:creator>
            <pubDate>Sat, 25 Jul 2020 11:30:00 GMT</pubDate>
            <atom:updated>2020-07-25T11:30:00.551Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>AWS:Introduction of Databases</strong></p><p>What is Database?</p><p>Data access (reads and writes) is needed on a recruiting basis.</p><p>It allows multiple user access for reads and writes</p><p>It safeguards against unintentional mistakes, or unexpected power or hardware failure, and can recover the last known state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*UXIkYiolr6rLNNbOziVoBQ.png" /></figure><p><strong>Relation Database:</strong></p><p>A relation database is a data structure that allows you to link information from different tables, or different types of data buckets.</p><p>It normalizes data into the structures.</p><p>A schema is used to strictly define, tables, columns, indexes, and relations between tables</p><ul><li>Same items in tables are stored in the same table locations (rows/columns)</li><li>Relational databases can save data in multiple-joined tables (rows and columns)</li></ul><p>Information about an entity can be stored distributed over multiple “Related” tables.</p><p>Virtually all relational DBs use Structured Query Language (SQL)</p><p>Are best suited for OLTP (On Line Transaction Processing)</p><ul><li>OLTP faciliates and manages transaction oriented applications.</li><li>An ATM machine transaction is an OLTP example.</li></ul><p>Relational DBs are usually used in Enterprise applications/scenarios</p><ul><li>Exception is MYSQL which is used for web applications.</li></ul><p><strong>Relational Databases-Disadvantages</strong></p><p>Inability to scale out (horizontally) to the needs of Web 2.0 &amp; Big Data Applications.</p><p>Requires expensive hardware to scale up (vertically), since its performance is dependent on that</p><p>Requires more investment to span a distributed system.</p><p><strong>Data Warehouse</strong></p><p>Is a collection of data integrated from Multiple sources, which then undergoes complex long queries for analytical and managaent reporting.</p><p><strong>Introduction to Non-Relational Databases</strong></p><p>In the simplest form, non relational databases store data without a structured mechanisms to link data from different tables to one another.</p><p>Are high performance databases that are non-schema based unlike relational DBs.</p><p>Use non-structured or semi-structured data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/287/1*MM57qzf8Gftktepz3Svt3A.png" /><figcaption>Non-Relational Databases(Dynamo DB)</figcaption></figure><p>Storage and retrieval of data is modeled without/away from tabular relations as in SQL DBs</p><ul><li>Non-Relational or No SQL databases use a variety of data models, including document, graph, key-value and columnar.</li></ul><p>They scale out (Horizontally) using distributed clusters to increase throughput without increasing latency.</p><ul><li>This meets today’s needs in social media, big data and IoT</li></ul><p>Require commodity (low cost) hardware</p><p>Much faster performance compared to Relational DBs</p><p>Easier to develop</p><p>Scalable in performance with high availability and resilience</p><p>Automatically spread the data over multiple servers</p><p>Multiple related values/ entries can be stored into one DB entry unlike RDBMS.</p><p>Best suited for On Line Analytical Processing (OLAP)</p><p>Examples use-cases are:</p><p>Business reporting for sales</p><p>Management reporting</p><p>Business process management</p><p>Financial reporting</p><p>Analytics</p><p>OLAP tools enables the multi-dimensional analysis of data from multiple/many perspectives.</p><p><strong>Non-Relational Databases-Types</strong></p><ul><li>Columnar databases</li><li>Document databases</li><li>Graph databases</li><li>In-memory key value databases</li><li><strong>Columnar Databases:</strong></li></ul><p>Optimized for redaing and writing columns not rows</p><p>Reduce the amount of data to be loaded from the disk</p><p>Scaleout using distributed clusters (low cost hardware)</p><p>Column-oriented storage drasticallty reduces the I/O requirements to read/write data</p><ul><li>On AWS you have a choice of running your own NOSQL DB using EC2 and EBS , or take advantage of the fully managed AWS Columnar databases such as:</li><li>Open Source databsses such as</li></ul><p>_ Apache Cassandra</p><p>_ Apache HBase</p><p><strong>NoSQL Databases-Document DBs</strong></p><p>Store semi-structured data as documents, typically in JSON or XML format</p><ul><li>This makes loading objects with relevant data and properties</li></ul><p>The schema for each NoSQL document can vary,</p><ul><li>More flexibility for developers, DB admin, IT Pros to organize and store data</li><li>Reduces storage needs for optional values</li></ul><p>Can scale “out” using distributed clusters of low-cost hardware to increase throughput without increasing latency.</p><p>On AWS you can run your own NoSQL document database or use the fully managed service from AWS</p><ul><li>DynamoDB is a fully managed document databse (it also supported key value)</li></ul><p><strong>DynamoDB:</strong></p><p>It is fully managed document database (it is also supported key value)</p><p>It is extremely fast and delivers predictable performance with seamless scalability</p><p>Use for applications that need consistent, single digit millisecond latency at any scale.</p><p>A fully manged AWS NoSQL database and supports both document and key-value data models</p><p>Is a grate fit for</p><ul><li>Mobile Apps</li><li>Web Apps</li><li>Gaming Apps</li><li>Ad-tech Apps</li><li>Internet of things (IoT)</li></ul><p><strong>NoSL Databases- In-memory Key Value Store DBs</strong></p><p>An in-memory key-va;ue store is NoSQL DB optimized for read-heavy application workloads.</p><ul><li>Examples are socail networking, gaming, media sharing and Q&amp;A portals</li></ul><p>It is also optimized for compute-intensive workloads</p><ul><li>They improve application performance by storing critical pieces of data in memory for low latency access.</li></ul><p>_ Cached information may include:</p><ul><li>Results of I/O intensive database queries or</li><li>Results of computationally intensive calculations</li></ul><p>On AWS you can use your own or take advantage of fully managed AWS offerings</p><p>Amazon Elastic Cache as an In-Memory Key-vALUE sTORES</p><ul><li>Is a web service that makes it easy to seploy, operate, and scale an in-memory cache</li><li>It improves the performance of web application by allowing for a faster retrieval of the information from managed, in-memory caches.</li></ul><p>Amazon ElasticCache automatically detects and replaces failed nodes</p><ul><li>No need to worry about node failures or replacement</li></ul><p>ElasticCache supports two open-source in-memory caching engines.</p><ul><li>Memcached</li><li>Redis</li></ul><p>In next blog, I will discuss on AWS RDS.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6826e4c4b16c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS: Auto Scaling 2nd Part]]></title>
            <link>https://bharathi-batthula6.medium.com/aws-auto-scaling-2nd-part-f77664f81136?source=rss-67827b410cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/f77664f81136</guid>
            <dc:creator><![CDATA[Bharathi Batthula]]></dc:creator>
            <pubDate>Tue, 21 Jul 2020 06:45:46 GMT</pubDate>
            <atom:updated>2020-07-21T06:45:46.759Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS: Auto Scaling 2nd Part</p><p><strong>ASG Health Checks</strong></p><p>Auto Scaling classifies its EC2 instances health status as either Healthy or Unhealthy.</p><p>By default, As uses EC2 Status Checks only to determince the health status of an instance.</p><p>When you hve one or more ELBs defined with the AS Group, you can configure Auto Scaling to use “both” the EC2 Health Checks and the ELB Health Checks to determine the Instances health status.</p><p>Health Check Grace period:</p><p>By default is 300 seconds</p><ul><li>Is the time Auto Scaling waits from the time an Instance comes into service (becomes In-Service) before checking its health status.</li></ul><p>A value of “zero” no grace period and the instance health is checked once it is in service.</p><p>Until the grace period timer expires, any unhealthy status reported by EC2 status checks or the ELB attached to the AS Group, will not be acted upon.</p><p>After Grace period expires, Auto Scaling would consider an instance unhealthy in any of the following cases:</p><p>EC2 status checks report to Auto Scaling an instance status other than running</p><ul><li>If the instance status is impaired due to a host Hardware or Software Problem.</li></ul><p>If ELB health checks are configured to be used by the Auto Scaling, then if the ELB reports the Instance as “Out-of-Service”</p><ul><li>If you have multiple ELBs attached to the AS Group, if any of them reports the EC2 instance status as “Out-of-Service”.</li></ul><p>One source reporting the instance as unhealthy is enough for Auto Scaling to mark it for replacement.</p><p><strong>AS- Unhealthy Instance Termination</strong></p><p>Once Auto Scaling identifies an instance as unhealthy, it gets schedules for termination</p><ul><li>The instance will never recover its health again automatically.</li></ul><p>During a very short time period, you can use the AWS Command (as-set-instance-health) to set the instance health back to healthy.</p><ul><li>If the Auto Scaling started terminating the Instance,you will get an error if you try to apply this command.</li></ul><p>Unlike AZ Rebalancing, termination of unhealthy instances happens first, then Auto Scaling attempts to launch new instances to replace the ones terminated.</p><p>Elastic IP and EBS volumes gets detached from the terminated instances, you need to manually attach them to the new instances.</p><p><strong>AS and Spot Instance</strong></p><p>You can choose to use Spot instances in your launch configuration, and specify your bid price.</p><p>Auto Scaling treats the spot instance the same way it treats on-demand instances.</p><p>You can NOT mix and match on-demand with Spot instances in your AS launch configuration.</p><p>If you want to change the bid price, you have to create a new launch configuration.</p><p>If the AS tries to launch spot instances in an AZ unsuccessfully because of the market price, it will try in another AZ if its market price drops below bis price,</p><ul><li>If the original AZ’s spot market price drops below the bis price, then the Auto scaling process will try to re balance between the two AZs.</li></ul><p><strong>AS and SNS Notifications</strong></p><p>You can configure Auto Scaling to send a SNS email notification whenever:</p><ul><li>An instance is launched</li><li>An instance is Terminated</li><li>An instance fails to launch</li><li>An instance fails to terminate</li></ul><p><strong>Merging Auto Scaling Groups</strong></p><p>Can only be done from the CLI (not AWS Console)</p><p>You can merge multiple, single AZ, Auto Scaling Groups into a single, one Multi-AZ, Auto Scaling group.</p><p>To do this:</p><ul><li>Re-zone one of the groups to cover/span the other AZs for the other ASGs</li><li>Delete the other ASGs</li></ul><p>This can be used in merging ASGs with/without ELB attached to them.</p><p>The resulting ASG must be one of the pre existing ASGs, not a new one.</p><p><strong>AS Policy Scaling actions</strong></p><p><strong>Scale-Out:</strong></p><ul><li>Is the process in which more EC2 instances are launched-by the scaling policy.</li></ul><p><strong>Scale-In:</strong></p><ul><li>Is the process in which EC2 instances are terminated by the scaling policy.</li></ul><p>It is always recommended to create a scale-in event for each scale-out event you create.</p><p><strong>Scaling Policies</strong></p><p><strong>Manual Scaling</strong></p><ul><li>Maintain a current number of instances all the time.</li><li>Manually change ASG’S min/desired/max, attach/detach instances.</li></ul><p><strong>Cyclic Scaling</strong></p><ul><li>Predictable load change.</li></ul><p><strong>On-demand/Dynamic Scaling</strong></p><ul><li>Scaling in response to an event/alarm.</li></ul><p>An ASG can have multiple policies attached to it at any time.</p><p><strong>ASG- Schedule/Cyclic Scaling</strong></p><p>Use for predictable load change (increase or decrease)</p><p>You need to configure a scheduled action(s) for a scale out at a specified date/time and to a required capacity.</p><p>You can configure this cation to happen once or at a recurring schedule.</p><p>A scheduled action must have aunique data/time,</p><ul><li>You can not configure two scheduled activities at the same date/time.</li><li>You can update/edit a scheduled action after you have created it.</li><li>You can use AWS Console or CLI for this.</li></ul><p><strong>ASG Dynamic/On-demand Scaling</strong></p><p>Is scaling out, or, in response to an alarm (demand)</p><p>An alarm is an object that watches over a single metric (CPU utilization, memory, network in/out… etc)</p><p>You need to have a scale-out and scale-in policy configured, which will instruct Auto Scaling what to do in response to Alarms.</p><p>You can use Cloud Watch to monitor and generate the Alarms.</p><p><strong>Simple scaling:</strong></p><ul><li>Single adjustment (up or down) in response to an alarm.</li><li>Waits for a cool down timer to expire before responding to more alarms.</li></ul><p><strong>Cool down Period:</strong></p><p>Is the period of time auto scaling waits after a scaling activity (launching a new instance or terminating one instance) until the effect of the scaling activity becomes visible</p><p>Default is 300 seconds, the time during which ASG will not respond to any additional alarms.</p><p>It is not supported for scheduled scaling or step on-demand scaling.</p><p><strong>Step Scaling:</strong></p><p>Multiple steps/ adjustments.</p><p>Does not support/wait for a cool down timer.</p><ul><li>Can respond to multiple alarms and initiate multiple scaling activities.</li></ul><p>Supports a warm-up timer</p><ul><li>The time it will take a newly launched instance to be ready and contribute to the watched metric</li></ul><p>Warm-up period:</p><ul><li>The period of time before which a newly created EC2 instance by ASG, using step scaling, is not considered/counted toward the ASG metrics.</li></ul><p>For Simple or Step scaling, a scaling adjustment can’t change the capacity of the group above the maximum group size or below the minimum group size.</p><p><strong>ASG Monitoring</strong></p><p>AWS EC2 service sends EC2 metrics to cloud watch about the ASG instances</p><ul><li>Basic Monitoring (Every 5 minutes enabled by efault- free of charge)</li><li>You can enable detailed monitoring (Every 1 minute- chargeable)</li></ul><p>When the launch configuration is done by AWS CLI, detailed monitoring for EC2 instances in enabled by default.</p><p>When enabled, Auto Scaling service sends to Cloud watch aggregate metrics about the AG Group itself.</p><ul><li>Every minute by default (once enabled)</li></ul><p>If you want to change the instance monitoring from basic to detailed (using AWS console), you have to create a new a new Launch configuration and use that for the AS Group</p><ul><li>newly launched instances will then use the updated monitoring settings</li></ul><p>You have now two settings that need to match:</p><p>AS policy alarm settings for cloud watch (CPU utilization cehcking for CPU utilization)</p><ul><li>Ex: If CPU utilization is above 75% for one min, then scale-out</li></ul><p>The actual Cloud Watch metric monitoring frequency for the EC2 service itself (Cloud Watch revieving EC2 Status Checks from the EC2 service)</p><ul><li>EC2 CPU metrics are sent to Cloud Watch every 5 minutes (via EC2 status checks)</li></ul><p>The above two need to match or else, Cloud Watch alarm monitoring will do 4 reads and will not find any data and with the 5th, it will find the metric information.</p><p>Ex: If the EC2 monitoring is set to default (basic or 5 min), then set your ASG Alarm period to 300 seconds.</p><p>If the EC2 monitoring is detailed (1 min), then set your ASG alarm to 60 seconds.</p><p>Avoid to have ASG alarm doing 60 seconds when the EC2 monitoring is set to basic.</p><p>Finally, done with ASG and In next blog, I will start with Database Services.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f77664f81136" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS: Auto Scaling]]></title>
            <link>https://bharathi-batthula6.medium.com/aws-auto-scaling-121f1261df0d?source=rss-67827b410cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/121f1261df0d</guid>
            <dc:creator><![CDATA[Bharathi Batthula]]></dc:creator>
            <pubDate>Sat, 04 Jul 2020 12:16:58 GMT</pubDate>
            <atom:updated>2020-07-04T12:16:58.523Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>AWS: Auto Scaling</strong></p><p>It is an AWS feature that allows your AWS component needs (EC2 instances fleet) to grow or shrink depending on your workload requirements.</p><p>Auto scaling ensures that you have the right number of AWS EC2 instances for your needs at all times.</p><p>Auto Scaling helps you save cost by cutting down the number of EC2 instances when not needed, and scaling out to add more instances only when it is required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*znGkJ4FjgPD0SJTpXqIWJQ.png" /><figcaption>Auto Scaling</figcaption></figure><p><strong>Components</strong></p><ul><li><strong>Launch Configuration</strong></li></ul><p>It is the configuration template used to create new EC2 instances for the ASG, defines parameters like : Instance family, Instance type, AMI, Key pair, Block devices and Sec groups are parameters defined in the launch configuration.</p><ul><li><strong>AS Group</strong></li></ul><p>Is a logical grouping of EC2 instances</p><ul><li><strong>Scaling Policy (Plan)</strong></li></ul><p>Determines whe/if and how the ASG scales or shrinks (on-demand/Dynamic scaling, Scheduled scaling)</p><p><strong>Launch Configuration</strong></p><p>It can be created from AWS console or CLI</p><p>You can create a launch configuration from scratch, or</p><p>You can use an existing/running EC2 instance to create the launch configuration</p><ul><li>This is provided that the AMI used to launch this instance does still exist in AWS</li><li>EC2 instance tags, and any additional block store volume created after the instance launch will not be taken into account.</li></ul><p>If you want to change your launch configurations, you have to create a new one, make the required changes, and use that with your auto scaling groups.</p><p><strong>Auto Scaling Features</strong></p><p>AS can be configured from Console, CLI, SDKs and APIs.</p><p>Auto Scaling can span Multi-AZs within the same region.Hence, it can be used to create Fault Tolerant designs on AWS.</p><p><strong>COST</strong></p><p>There is no additional cost for launching AS Groups. You pay for what you use of EC2 instances.</p><p>As can grow or shrink your EC2 instance base, according to your needs, hence, can play an important role in Cost Management.</p><ul><li>It works well with AWS ELB, Cloud Watch, and Cloud Trail</li><li>AS is compliant with PCI DSS</li><li>Auto Scaling can NOT span across multiple Regions</li><li>You can determine which subnets will AS Groups use to launch new instances in each AZ.</li><li>Auto Scaling always tries to distribute EC2 instance evenly across AZs where it is enabled.</li><li>If Auto Scaling fails to launch instances in an AZ, it will try in the other AZs Group until it succeeds.</li></ul><p><strong>AS- AZ Rebalance</strong></p><p>If AS finds that the number of EC2 instances launched by an ASG into subject AZs is not balanced, AS will initiate a Re balancing Activity.</p><ul><li>The target of the activity would be to reacg an even distribution of instances between AZs.</li><li>AS does that by launching new EC2 instances in the AZs that have less EC2 instances first then terminating EC2 instances from the AZs that had more EC2 instances.</li></ul><p>What can cause an Imbalance of EC2 instances:</p><ul><li>You manually change the AZs where your AS is in effect.</li><li>Manually requesting termination of EC2 instances from your ASG.</li><li>An AZ that didnot have enough EC2 capacity, now has enough capacity and it is one of your ASG AZs.</li><li>An AZ with Spot instances market price meeting your bid price.</li></ul><p>AS Group- Attaching a Running EC2 instance.</p><p>Using AWS Console or CLI, You can attach a running state (not stopped or terminated)</p><ul><li>Instance is in running state (not stopped or terminated)</li><li>AMI used to launch the instance still exists.</li><li>Instance is not part of another AS Group.</li><li>Instance is in the same AZs of the AS Group.</li></ul><p>If the existing EC2 instances under the AS group, plus the one to be added, exceed the maximum capacity of the ASG, the request will fail, EC2 instance won’t be added.</p><p><strong>AS Group- Detaching EC2 instances</strong></p><p>You can manually remove (Detach) EC2 instance from an AS Group using AWS Console or CLI</p><p>You can then manage the detached instances independently, or attach it to another AS Group.</p><p>When you detach an instance, you have the option to decrement the ASG’s desired capacity</p><ul><li>If you do not, the AS Group will launch another instance to replace the one detached</li></ul><p><strong>ASG — Standby State</strong></p><p>You can manually move an instance from an ASG and put it in standby state</p><ul><li>Instances in Standby are still managed by Auto Scaling</li><li>Instances in Standby state are charged as normal, In-service, instances</li><li>Auto Scaling does not perform Health Checks on instances in Standby state</li><li>You can troubleshoot the instance or make changes ins tandby mode, without having the Auto Scaling consider that as the instance being unhealthy.</li></ul><p><strong>Deleting an ASG</strong></p><p>When you delete an ASG, its parameters minimum, and desired capacity are all set to Zero, hence, it terminates all its EC2 instances.</p><p>If you want to keep the EC2 instances and manage them independently, you can manually detach them first, then delete the ASG.</p><p><strong>Adding an ELB to the ASG</strong></p><p>You can attach one or more classic ELBs to your existing AS Group</p><ul><li>The ELB(s) must be in the same region as the AS Group</li></ul><p>Once you do this, any EC2 instance existing or added by the AS Group will be automatically registered with the ASG defined ELBs</p><ul><li>You do not need to register those instance manaully on the ASG defined ELBs</li><li>The ELB will then become the focal point for any inbound traffic destined to the ASG EC2 instances</li></ul><p>Instance and the ELB(s) must be in the same VPC.</p><p><strong>AS Group- Registering/De-Registering EC2 instances to ELBs</strong></p><p>If an ELB is attached to the AS Group, then the ELB and instance must be in the same VPC, nad are in the smae Region as the AS Group.</p><p>Auto Scaling adds the Attached EC2 instances to the ELB(s) defined to the AS Group</p><ul><li>Once the EC2 instance is added to the AS Group, it will be automatically registered with the ELB(s) defined under the AS Group</li></ul><p>If the AS Group had an ELB defined, detcahing the instance will aso de-register it from the ELB</p><ul><li>If connection draining was enabled under the ELB, Auto Scaling will honor it.</li></ul><p>I will continue further about Auto Scaling in my next coming blog. Thank you.</p><p>Bharathi.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=121f1261df0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS: Network Load Balancer 2nd part]]></title>
            <link>https://bharathi-batthula6.medium.com/network-load-balancer-2nd-part-6d41b7d9821a?source=rss-67827b410cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d41b7d9821a</guid>
            <dc:creator><![CDATA[Bharathi Batthula]]></dc:creator>
            <pubDate>Tue, 23 Jun 2020 12:37:01 GMT</pubDate>
            <atom:updated>2020-06-23T12:37:57.992Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Network Load Balancer 2nd part</strong></p><p><strong>Client Source IP address Preservation</strong></p><p>If you use Instance ID as target type, NLB preserves the clients source IP addresses, and provide them to the targets.</p><p>On the other hand, If you use the IP address s the target, the source IP addresses are the private IP addresses of the load balancer nodes.</p><ul><li>In this case if your application require the clients source IP address, you can configure Proxy Protocol on the NLB.</li></ul><p>If you use Instance ID as target type, NLB preserves the clients source IP addresses, and provides them to the targets.</p><p>This will also facilitate controlling client access to target based on Client source IP addresses using normal firewall rules, including VPC Security Groups.</p><p>Since the packets will arrive at the Instances with the Clients IP address as the source IP in the packets.</p><ul><li>This implies that EC2 instances MUST have a route to the internet (for Internet-facing NLBs), this can be via a NAT instance/Gateway, or by having the instance in a public subnet with an Internet Gateway.</li></ul><p>If you have micro services on instances registered with a Network Load Balancer, you cannot use the load balancer to provide communication between them unless the load balancer is internet-facing or the instances are registered by IP address.</p><p>Two load balancers with a service layer sandwiched between them.</p><p>The services layer can have NGFWs, Proxies, or 3rd Party load balancers, or even a web tier.</p><p>This way you can scale this layer while using fewer Elastic IP addresses.</p><p><strong>Proxy Protocol</strong></p><p>NLB supports Proxy Protocol v2</p><ul><li>Is configured at the Target group level, and It is disabled by default.</li></ul><p>This comes in handy in case targets are referred by IP address and the clients source IP address is required for the applications.</p><ul><li>The applications however, must be able to parse that header from the packets.</li></ul><p>When enables, the NLB prepends a proxy protocol header to the TCP data.</p><ul><li>The NLB will not discard or overwrite any existing data, including any proxy protocol headers sent by the client or any other proxies, load balancers, or servers in the network path.</li><li>As in CLB, caution has to be exercised to not receive more than one proxy protocol header.</li></ul><p>If the traffic/requests are coming to the NLB from ELB service consumers through a VPC endpoint service.</p><ul><li>The source IP addresses provide to your applications is the NLB nodes private IP addresses.</li></ul><p><strong>Health Checks</strong></p><p>Network Load Balancers use active and passive health checks to determine whether a target is available to handle requests.</p><p>With active health checks, the load balancer periodically sends a request to each registered target to check its status.</p><ul><li>Each load balancer node checks the health of each target, using the health check settings for the target group with which the target is registered.</li><li>After each health check is completed, the load balancer node closes the connection that was established for the health check.</li></ul><p>With Passive (Network) health checks, the load balancer observes how targets respond to connections.</p><ul><li>Passive health checks enable the load balancer to detect an unhealthy target before it is reported as unhealthy by the active health checks.</li><li>You cannot disable, configure or monitor passive health checks.</li></ul><p>If there are no enabled Availability Zones with a healthy target group, request are routed to targets in all enabled Availability Zones.</p><p>If you add a TLS listener to your NLB, AWS ELB performs a listener connectivity test.</p><ul><li>As TLS termination also terminates a TCP connection, a new TCP connection is established between your load balancer and your targets.</li><li>This might be seen as TCP pings for this test from the NLB to the targets that are registered with that TLS listener.</li><li>These TCP pings can be identified, since their source IP address is the NLB’s IP address. Also, the connection do not contain data packets.</li></ul><p><strong>Monitoring the NLB- VPC Flow Logs</strong></p><p>VPC Flow Logs can be used to capture detailed information about the traffic going to and from your NLB.</p><p>Create a flow log for each interface for your load balancer.</p><ul><li>There is one network interface per load balancer subnet.</li><li>The NLB ENIs can be identified as the NLB name exist in their description field.</li></ul><p>If the target is registered by instance ID, the connection appears to the instance as a connection from the client.</p><ul><li>Flow logs would also show NACL and Security Group Accept/Reject messages for the different load balancer traffic.</li></ul><p><strong>Monitoring the NLB- Access Logs</strong></p><p>Access logs can be used to capture detailed information about TLS requests made to the NLB.</p><ul><li>The log files are stored in Amazon S3 buckets.</li><li>Access logs can be used to analyse traffic patterns and to troubleshoot issues with your targets.</li></ul><p>Access logs are created only if the load balancer has a TLS listener and they contain information only about TLS requests.</p><p>Access logs are disabled by default. You can enable it/disable it at anytime.</p><p>There is no additional charge for access logs. Only storage charges apply.</p><p>ELB publishes a log file for each load balancer node every 5 minutes.</p><ul><li>Log delivery is eventually consistent.</li></ul><p><strong>Cloud Trail</strong></p><p>AWS Cloud Trail can be used to capture detailed information about the calls made to the Elastic Load Balancing API and store them as log files in Amazon S3.</p><p>These Cloud Trail logs can be used to determine which calls were made, the source IP address where the call came from, who made the call, when the call was made and so on.</p><p>Thank you,</p><p>Bharathi.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d41b7d9821a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>