<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Rajdwip Chaki</title>
    <description>The latest articles on Forem by Rajdwip Chaki (@rajdwipchaki).</description>
    <link>https://forem.com/rajdwipchaki</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F516086%2F545df1c2-ec1d-4f0c-a6d7-a2d9d019e1aa.jpeg</url>
      <title>Forem: Rajdwip Chaki</title>
      <link>https://forem.com/rajdwipchaki</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/rajdwipchaki"/>
    <language>en</language>
    <item>
      <title>Playing with AWS RDS (#2)</title>
      <dc:creator>Rajdwip Chaki</dc:creator>
      <pubDate>Tue, 27 Dec 2022 12:19:57 +0000</pubDate>
      <link>https://forem.com/rajdwipchaki/playing-with-aws-rds-2-3kd0</link>
      <guid>https://forem.com/rajdwipchaki/playing-with-aws-rds-2-3kd0</guid>
      <description>&lt;p&gt;Ok, let's start from the previous post in this series..&lt;br&gt;
&lt;a href="https://dev.to/rajdwipchaki/playing-with-aws-rds-1-578c"&gt;Playing with AWS RDS (#1)&lt;/a&gt;&lt;br&gt;
Quick recap of what we have done..&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a RDS instance&lt;/li&gt;
&lt;li&gt;Connect from pgadmin&lt;/li&gt;
&lt;li&gt;Change the instance class (resizing)&lt;/li&gt;
&lt;li&gt;Multi-AZ Failover&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this post, we'll focus on read-replicas.&lt;/p&gt;

&lt;p&gt;As per AWS documentations, Amazon RDS Read Replicas provide enhanced performance and durability for Amazon RDS database (DB) instances. They make it easy to elastically scale out beyond the capacity constraints of a single DB instance for read-heavy database workloads. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzied5a8ccjfnw4g7xcwx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzied5a8ccjfnw4g7xcwx.png" alt="Read-replica" width="654" height="596"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;a) You can create one or more replicas of a given source DB Instance and serve high-volume application read traffic from multiple copies of your data, thereby increasing aggregate read throughput. &lt;br&gt;
b) Read replicas can also be promoted when needed to become standalone DB instances.&lt;/p&gt;

&lt;p&gt;So let's first create a read-replica and test out the replication. Click on the primary DB instance identifier in the RDS console. From actions, select 'Create read replica'.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fylhvlvxobwgl6alhwaa1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fylhvlvxobwgl6alhwaa1.png" alt="Create RR" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set Multi-AZ to 'No', Publicly accessible to 'Yes'.&lt;br&gt;
Give a name to the replica DB instance (e.g., mydbinstancerr). Leave other attributes to their default values and click on the 'Create read replica' button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzrjfyvn07wsoi10j9vjb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzrjfyvn07wsoi10j9vjb.png" alt="RR attributes" width="800" height="1043"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It would take some time for the new instance (yes, read-replica will be a new DB instance) to be up and running.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92u39qpl007k13xn2dyf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92u39qpl007k13xn2dyf.png" alt="RR status" width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While it's still being created, let us quickly see what is being shown in the replication status. &lt;br&gt;
Select the primary DB instance (which is 'mydbinstance' for my case) and go to the 'Replication' card. You can find that the replication state and replication lag information is not yet populated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz0whzx2c59d6ugmh78yo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz0whzx2c59d6ugmh78yo.png" alt="RR state" width="800" height="121"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wait until the read-replica instance is available..&lt;/p&gt;

&lt;p&gt;Now, let's test out the replication.&lt;br&gt;
For this, we would create a table with random data in primary DB instance and then check in the replica DB instance if the data gets replicated. Here is our sample SQL.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    CREATE TABLE Results (
    rollno NUMERIC NOT NULL,
    marks NUMERIC NOT NULL);

    insert into Results (rollno, marks) 
    SELECT  num.*,ceil (random()*100)
    FROM    generate_series(1000,1500) num;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's execute this SQL query in pgadmin.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodi11ywwv49rdhau1opp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodi11ywwv49rdhau1opp.png" alt="exe query1" width="800" height="523"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Query is successful. The 'Results' table is created with 501 records.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdtectgpkcnrjjttphab9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdtectgpkcnrjjttphab9.png" alt="all rows" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now check in the replica DB instance to find out if this information is replicated or not. First, create a DB connection in pgadmin (follow the post#1 in this series) and then search for the 'Results' table.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fifdyso2rm1ox34vtgljm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fifdyso2rm1ox34vtgljm.png" alt="rr all rows" width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is great, we can find the records have already been replicated in the replica DB instance.&lt;/p&gt;

&lt;p&gt;At this point, let's go back to the 'Replication' card in the RDS console to find out the replication state and lag information.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5wpbqwoaoe095hob3jq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5wpbqwoaoe095hob3jq.png" alt="rr state current" width="800" height="122"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that the read-replica can also be promoted to a standalone database instance, but you can't use it as a replication target. So the replication would stop. Let's test this out now.&lt;/p&gt;

&lt;p&gt;Promote read-replica&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fajt1sn8ossxj2x0lv3ko.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fajt1sn8ossxj2x0lv3ko.png" alt="prmote rr" width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ignoring backup for time-being.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpe3a1gl96nifsdes26p9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpe3a1gl96nifsdes26p9.png" alt="promote rr final" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See both the DB instances are being shown in the same level now..&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8hcw6uyhq8iol0dlvm8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8hcw6uyhq8iol0dlvm8.png" alt="prmote in prgs" width="800" height="131"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to the 'replication' card.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdghcb9c9l126sb1jykn7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdghcb9c9l126sb1jykn7.png" alt="rep card after promote" width="800" height="104"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;'mydbinstancerr' instance is not there anymore. You can try out the sample SQL query (change the table name to 'Results1') again and check yourself through pgadmin whether replication is still happening or not.&lt;/p&gt;

</description>
      <category>programming</category>
    </item>
    <item>
      <title>Playing with AWS RDS (#1)</title>
      <dc:creator>Rajdwip Chaki</dc:creator>
      <pubDate>Mon, 26 Dec 2022 08:05:33 +0000</pubDate>
      <link>https://forem.com/rajdwipchaki/playing-with-aws-rds-1-578c</link>
      <guid>https://forem.com/rajdwipchaki/playing-with-aws-rds-1-578c</guid>
      <description>&lt;p&gt;Let's start by creating our own VPC first.&lt;br&gt;
It's quite easy with the new UI.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IBRxAPmF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/49kqh3d94zrxw5u2gx1i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IBRxAPmF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/49kqh3d94zrxw5u2gx1i.png" alt="New create VPC experience" width="880" height="489"&gt;&lt;/a&gt;&lt;br&gt;
Use the 'Name tag auto-generation' feature to generate the name tag for all resources. For example, if I enter the value 'myvpc' as a Name tag, then each of the vpc resources would contain this phrase 'myvpc' in each their respective name tags.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IHws6NeI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8srxtnlmeikvihcm9j6d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IHws6NeI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8srxtnlmeikvihcm9j6d.png" alt="Name tags of VPC resources" width="880" height="219"&gt;&lt;/a&gt;&lt;br&gt;
Let's keep the no. of AZs, public and private subnets to 2 (as defaulted), NAT gateway in 1 AZ, and leave other attributes to their default values.&lt;br&gt;
Click on the 'Create VPC' button now.&lt;br&gt;
With this new create VPC UI experience, you can see the progress of each steps.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wL8t7H4r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3d2iblr10t3ym7iappeg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wL8t7H4r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3d2iblr10t3ym7iappeg.png" alt="Create vpc workflow" width="880" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now as the VPC is created, let's move to the RDS part.&lt;br&gt;
I'm selecting postgres for this example.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XsDkljOW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wshojdbpj7el5noazagx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XsDkljOW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wshojdbpj7el5noazagx.png" alt="RDS Console" width="880" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on the 'Create database' button.&lt;/li&gt;
&lt;li&gt;Select 'PostgreSQL' as the DB engine. Let's use the default engine version populated (13.7-R1 for me).&lt;/li&gt;
&lt;li&gt;Select Dev/Test as a template.&lt;/li&gt;
&lt;li&gt;Select 'Single DB Instance' as deployment option which would create a single DB instance with no standby instances.&lt;/li&gt;
&lt;li&gt;Now select the DB instance attributes like DB instance name, master username &amp;amp; password, DB instance class etc. &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vp0HV4vG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/929yurquanecoq33mnie.png" alt="DB instance attributes" width="867" height="1155"&gt;
&lt;/li&gt;
&lt;li&gt;Select general SSD (gp2) as storage class with a 25 GB storage.&lt;/li&gt;
&lt;li&gt;In the connectivity section, select the VPC that you created. Also, keep the 'Public access' to 'Yes' for us to connect to the DB through internet. &lt;/li&gt;
&lt;li&gt;Select 'Create new' for the VPC security group and provide a name for the new security group.&lt;/li&gt;
&lt;li&gt;Lastly, provide a name for the initial database in the 'Additional configuration' section.&lt;/li&gt;
&lt;li&gt;Leave other options to their default values, and click on the 'Create database' button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now the database is being created, it would take some time for up and running.&lt;/p&gt;

&lt;p&gt;Meanwhile, let's download pgadmin (postgres admin tool) from &lt;a href="https://www.pgadmin.org/download/"&gt;https://www.pgadmin.org/download/&lt;/a&gt;. We would test the connectivity to our AWS RDS database using this pgadmin tool.&lt;br&gt;
After the installation is completed, start the pgadmin tool. It would look something like the following.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JoKlXIGa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/96c57zrfk051iefopa02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JoKlXIGa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/96c57zrfk051iefopa02.png" alt="pgadmin" width="880" height="158"&gt;&lt;/a&gt;&lt;br&gt;
We intend to setup the connection to our RDS database using pgadmin. For this, we first new our RDS endpoint. &lt;br&gt;
Hopefully, the RDS configuration is completed by this time and it is up and running. Go to the AWS RDS console, and check the status of the RDS instance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4lXRxMeF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfpqflhcc52eplxf9886.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4lXRxMeF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfpqflhcc52eplxf9886.png" alt="database instance status" width="880" height="123"&gt;&lt;/a&gt;&lt;br&gt;
Click on the DB identifier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n32g4id4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ene6cg3e3vn46yh5aesn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n32g4id4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ene6cg3e3vn46yh5aesn.png" alt="database instance details" width="880" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy the endpoint shown under 'Connectivity &amp;amp; security' section.&lt;br&gt;
Go to pgadmin. Right-click 'Servers'. Select Register-&amp;gt;Server..&lt;br&gt;
Provide a name to this connection.&lt;br&gt;
Paste the endpoint information (copied earlier) in the 'Hostname/address' edit box and click on save.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qXM10TmI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5jr72xp5ya17v1inxdwd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qXM10TmI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5jr72xp5ya17v1inxdwd.png" alt="pgadmin endpoint" width="628" height="690"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the connection is established, you can find the initial database that you created your postgres DB instance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7rtc7mtz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bb8m9wmys01e5wa14qq7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7rtc7mtz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bb8m9wmys01e5wa14qq7.png" alt="postgres db" width="658" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Check the events created in RDS console
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ApVdXYEj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v01te7rs3q3352psnr47.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ApVdXYEj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v01te7rs3q3352psnr47.png" alt="rds events" width="880" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What would happen if we change the instance type for this Single AZ deployment
&lt;/h2&gt;

&lt;p&gt;Changing instance type from db.t3.micro to db.t3.small.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AWa1Y1Lt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n44pgri4hxosst703zx9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AWa1Y1Lt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n44pgri4hxosst703zx9.png" alt="modify instance type" width="874" height="663"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Modification is in progress..&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--r9udXELt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j6puaa3ew32egi8uh9q8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r9udXELt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j6puaa3ew32egi8uh9q8.png" alt="modification in progress" width="880" height="124"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The corresponding events get logged and can be seen in the 'Logs &amp;amp; events' section. Note that DB instance was shut down and restarted after the change was applied. It generally takes 2-5 mins (based on my experience) for the DB instance to be up and running after the modification.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rYeR1M-R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qygyec11mc9dqt3xdl58.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rYeR1M-R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qygyec11mc9dqt3xdl58.png" alt="db instance change" width="880" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What would happen if we change the instance type for a multi-AZ deployment
&lt;/h2&gt;

&lt;p&gt;Let's first make our DB instance multi-AZ.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UwrZvGGd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9ysh975yplvh4qe1gdf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UwrZvGGd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9ysh975yplvh4qe1gdf.png" alt="multi-az" width="868" height="812"&gt;&lt;/a&gt;&lt;br&gt;
Wait till the multi-AZ conversion is completed. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M1p_fIwk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dy1a6k1wg7flm80nhyuc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M1p_fIwk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dy1a6k1wg7flm80nhyuc.png" alt="muti az status" width="880" height="122"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XAFaD7ge--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqtwchv41biiapt0k3g5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XAFaD7ge--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqtwchv41biiapt0k3g5.png" alt="muti-az events" width="880" height="221"&gt;&lt;/a&gt;&lt;br&gt;
Now, let's change back the instance type from db.t3.small to db.t3.micro.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5rFHVQBl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nlbe69fllg4g8qlpy47v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5rFHVQBl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nlbe69fllg4g8qlpy47v.png" alt="db instance type change" width="870" height="648"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that the moment the DB instance was shut down, Multi-AZ instance failover started. And hence the DB instance came back to a running state quite fast.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7riFv8vo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bbu7qu7p3v5391pcufz6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7riFv8vo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bbu7qu7p3v5391pcufz6.png" alt="db ins type change events" width="880" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>postgres</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
