<?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>DEV Community: Ashwin Sharma</title>
    <description>The latest articles on DEV Community by Ashwin Sharma (@ashwin_sharma).</description>
    <link>https://dev.to/ashwin_sharma</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%2F2216287%2F2ea06a00-1b7a-49cb-b66e-084d4d5bc14d.jpg</url>
      <title>DEV Community: Ashwin Sharma</title>
      <link>https://dev.to/ashwin_sharma</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ashwin_sharma"/>
    <language>en</language>
    <item>
      <title>Amazon S3 Introduces Account-Regional Namespaces for Buckets</title>
      <dc:creator>Ashwin Sharma</dc:creator>
      <pubDate>Sat, 14 Mar 2026 19:29:31 +0000</pubDate>
      <link>https://dev.to/aws-builders/amazon-s3-introduces-account-regional-namespaces-for-buckets-4m2c</link>
      <guid>https://dev.to/aws-builders/amazon-s3-introduces-account-regional-namespaces-for-buckets-4m2c</guid>
      <description>&lt;p&gt;Amazon Web Services (AWS) recently introduced a new feature for &lt;strong&gt;Amazon S3 general purpose buckets&lt;/strong&gt; called &lt;strong&gt;Account-Regional Namespaces.&lt;/strong&gt; This update changes how bucket names are managed and significantly simplifies S3 architecture for organizations.&lt;/p&gt;

&lt;p&gt;To understand the importance of this update, we first need to look at how S3 bucket naming worked previously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. How S3 Bucket Naming Worked Earlier&lt;/strong&gt;&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%2Fdmjytkk7itk7jiro98tx.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%2Fdmjytkk7itk7jiro98tx.png" alt=" "&gt;&lt;/a&gt;&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%2Fw03gze89552bn1p5gesc.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%2Fw03gze89552bn1p5gesc.png" alt=" "&gt;&lt;/a&gt;&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%2F9awrt7vzov5g5p2y52qb.jpg" 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%2F9awrt7vzov5g5p2y52qb.jpg" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Previously, &lt;strong&gt;Amazon S3 used a global namespace for bucket names.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This meant that every bucket name had to be &lt;strong&gt;unique across all AWS accounts worldwide&lt;/strong&gt;, regardless of region.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
| AWS Account | Region     | Bucket Name | Result        |&lt;br&gt;
| ----------- | ---------- | ----------- | ------------- |&lt;br&gt;
| Account A   | us-east-1  | logs        | ✅ Allowed     |&lt;br&gt;
| Account B   | ap-south-1 | logs        | ❌ Not Allowed |&lt;/p&gt;

&lt;p&gt;Even if the buckets were in completely different AWS accounts or regions, the name still had to be globally unique.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenges with Global Namespace&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because of this restriction, organizations had to create long and complicated bucket names such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- company-prod-logs-aws123
- dev-backups-us-east-1
- analytics-storage-companyname
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For large companies using &lt;strong&gt;multiple AWS accounts and environments,&lt;/strong&gt; this created unnecessary complexity&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Introducing Account-Regional Namespaces&lt;/strong&gt;&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%2F610scp7thb4copafrha6.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%2F610scp7thb4copafrha6.png" alt=" "&gt;&lt;/a&gt;&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%2F6luoxag1e5xli3rw6o8u.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%2F6luoxag1e5xli3rw6o8u.png" alt=" "&gt;&lt;/a&gt;&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%2Fx5x2h9vgm114omyozj2i.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%2Fx5x2h9vgm114omyozj2i.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AWS has now introduced &lt;strong&gt;Account-Regional Namespaces,&lt;/strong&gt; which changes the bucket naming model.&lt;/p&gt;

&lt;p&gt;With this new approach:&lt;br&gt;
Bucket names only need to be unique &lt;strong&gt;within an AWS account and region,&lt;/strong&gt; not globally.&lt;/p&gt;

&lt;p&gt;This means the same bucket name can now exist across different accounts or regions without conflicts.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
| Account   | Region     | Bucket Name |&lt;br&gt;
| --------- | ---------- | ----------- |&lt;br&gt;
| Account A | us-east-1  | logs        |&lt;br&gt;
| Account B | us-east-1  | logs        |&lt;br&gt;
| Account A | ap-south-1 | logs        |&lt;/p&gt;

&lt;p&gt;All of these buckets can now exist simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Old vs New Naming Model&lt;/strong&gt;&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%2F2sbbckeal4pe79ambkem.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%2F2sbbckeal4pe79ambkem.png" alt=" "&gt;&lt;/a&gt;&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%2Fwflw54lnu2yyru00tnk2.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%2Fwflw54lnu2yyru00tnk2.png" alt=" "&gt;&lt;/a&gt;&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%2Fsmqsjpemihj0eagzkhno.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%2Fsmqsjpemihj0eagzkhno.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Old Model&lt;/th&gt;
&lt;th&gt;New Model&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Namespace scope&lt;/td&gt;
&lt;td&gt;Global&lt;/td&gt;
&lt;td&gt;Account + Region&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Naming conflicts&lt;/td&gt;
&lt;td&gt;Very common&lt;/td&gt;
&lt;td&gt;Much lower&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bucket naming&lt;/td&gt;
&lt;td&gt;Complex&lt;/td&gt;
&lt;td&gt;Simple&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-account environments&lt;/td&gt;
&lt;td&gt;Difficult&lt;/td&gt;
&lt;td&gt;Easy&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Now organizations can maintain &lt;strong&gt;consistent bucket naming across environments.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Example architecture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Development Account
logs
backups
data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Production Account&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;logs
backups
data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This was not possible earlier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Benefits for Cloud Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simpler Naming&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Teams can now use clean bucket names like:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;plaintext&lt;br&gt;
logs&lt;br&gt;
images&lt;br&gt;
backups&lt;br&gt;
dat&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;instead of complex identifiers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Better Multi-Account Strategy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Many companies use separate AWS accounts for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Development
- Testing
- Staging
- Production
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Account-regional namespaces allow all these environments to use the same bucket names.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Easier Infrastructure Automation&lt;/strong&gt;&lt;br&gt;
Tools like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Terraform
- AWS CloudFormation
- AWS CDK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can now create predictable bucket names without worrying about global availability conflicts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Improved Organizational Standards&lt;/strong&gt;&lt;br&gt;
Cloud teams can standardize naming conventions across the entire organization.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;plaintext
logs
application-data
backups
analytics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each environment can reuse the same naming structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Impact on Existing S3 Buckets&lt;/strong&gt;&lt;br&gt;
Existing S3 buckets will continue to function normally.&lt;/p&gt;

&lt;p&gt;AWS is &lt;strong&gt;not forcing any migration.&lt;/strong&gt; This feature mainly improves &lt;strong&gt;future bucket creation and architecture design.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Organizations can adopt the new naming approach gradually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
The introduction of &lt;strong&gt;Account-Regional Namespaces&lt;/strong&gt; is a significant improvement for Amazon S3. By removing the requirement for globally unique bucket names, AWS has simplified resource management and made S3 architecture more scalable.&lt;/p&gt;

&lt;p&gt;For organizations operating multiple AWS accounts and regions, this change will reduce complexity, improve automation, and enable better infrastructure standardization.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>aws</category>
      <category>cloud</category>
      <category>news</category>
    </item>
    <item>
      <title>Enable, Download, and Archive MySQL Binlogs from Amazon RDS to S3. What They Are, Why They Matter, and How to Use Them</title>
      <dc:creator>Ashwin Sharma</dc:creator>
      <pubDate>Mon, 16 Jun 2025 20:25:50 +0000</pubDate>
      <link>https://dev.to/aws-builders/enable-download-and-archive-mysql-binlogs-from-amazon-rds-to-s3-what-they-are-why-they-matter-34hp</link>
      <guid>https://dev.to/aws-builders/enable-download-and-archive-mysql-binlogs-from-amazon-rds-to-s3-what-they-are-why-they-matter-34hp</guid>
      <description>&lt;p&gt;&lt;strong&gt;What Are MySQL Binlogs?&lt;/strong&gt;&lt;br&gt;
Binary logs, or simply &lt;strong&gt;binlogs&lt;/strong&gt;, are a special type of log file in MySQL that records every data-changing operation performed on the database. whether it's an INSERT, UPDATE, DELETE, or DDL changes.&lt;/p&gt;

&lt;p&gt;They act like a &lt;strong&gt;complete transaction history&lt;/strong&gt; of your database, which makes them extremely useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Replication&lt;/li&gt;
&lt;li&gt;Point-in-time recovery&lt;/li&gt;
&lt;li&gt;Auditing&lt;/li&gt;
&lt;li&gt;Troubleshooting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In Amazon RDS, enabling binlogs allows you to capture these changes for multiple purposes like compliance, disaster recovery, and operational visibility.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why They Matter&lt;/strong&gt;&lt;br&gt;
Binlogs are crucial because they provide a complete and chronological record of all data changes in your database. This level of detail helps in several important ways:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Auditing and Compliance:&lt;/strong&gt; You can track exactly who changed what and when, which is essential for security audits and regulatory requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Troubleshooting:&lt;/strong&gt; When something goes wrong, binlogs let you identify and understand the changes that led to the issue.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Point-in-Time Recovery:&lt;/strong&gt; In case of accidental data loss or corruption, binlogs enable you to restore your database to a specific moment in time, minimizing downtime and data loss.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Replication:&lt;/strong&gt; Binlogs are the backbone of MySQL replication, allowing you to maintain standby or read-only copies of your database for load balancing or disaster recovery.&lt;/p&gt;

&lt;p&gt;By archiving and analyzing binlogs, you gain greater control and visibility over your data, making them an indispensable tool for any production environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to Use Them&lt;/strong&gt;&lt;br&gt;
Using MySQL binlogs effectively starts with enabling binary logging on your Amazon RDS instance. Once enabled, these logs are automatically generated and can be downloaded or streamed for further analysis. To keep a long-term record and enable detailed auditing, you can archive the binlogs by exporting them to Amazon S3. From there, you can process the logs using tools like mysqlbinlog to read and interpret the changes, or integrate them into auditing and monitoring systems. Additionally, these archived binlogs can be used for point-in-time recovery or to replicate data to other database instances. Automating this process with scheduled scripts or AWS Lambda functions ensures your logs are safely stored and easily accessible when needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now, let’s get practical! Follow these step-by-step instructions to set up and manage MySQL binlogs on Amazon RDS and archive them to S3.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First: Understand RDS MySQL limitation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You cannot directly control MySQL server my.cnf on RDS.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Binlog can be enabled via RDS Parameter Groups.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Saving binlog directly to S3 is not natively supported out of box but you can extract binlogs periodically and upload them to S3.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Second Enable Binary Logging on RDS MySQL&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Go to RDS Console &amp;gt; your DB instance &amp;gt; Configuration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check current parameter group attached.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Foy1hd0wevp7ob076nj19.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%2Foy1hd0wevp7ob076nj19.png" alt=" " width="800" height="563"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modify or create a new parameter group for MySQL (make sure it matches your version).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;- In the parameter group, set:&lt;/strong&gt;&lt;br&gt;
binlog_format value ROW (or MIXED or STATEMENT depending on your use case)&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%2Fnrd1on2az466uf8bw83i.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%2Fnrd1on2az466uf8bw83i.png" alt=" " width="800" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;binlog_row_image value is FULL (or minimal if you want smaller binlogs)&lt;/li&gt;
&lt;/ul&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%2Frbsxiugixy5lxhaq4p9b.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%2Frbsxiugixy5lxhaq4p9b.png" alt=" " width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;log_bin value is 1 (for MySQL 5.7; for MySQL 8+ RDS manages log_bin automatically if binary logging is enabled)&lt;/li&gt;
&lt;/ul&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%2Fxqioh1efvzdtk2if3iot.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%2Fxqioh1efvzdtk2if3iot.png" alt=" " width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Apply parameter group (may require reboot).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Verify binlog is enabled&lt;/strong&gt;&lt;br&gt;
Login to MySQL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mysql -h &amp;lt;rds-endpoint&amp;gt; -u &amp;lt;user&amp;gt; -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SHOW VARIABLES LIKE 'log_bin';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SHOW BINARY LOGS;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fonme114s79fv7cym55bc.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%2Fonme114s79fv7cym55bc.png" alt=" " width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;** Setup automated export to S3 **&lt;br&gt;
Unfortunately:&lt;br&gt;
RDS doesn't automatically export binlogs to S3.&lt;br&gt;
We need to implement binlog extraction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Use mysqlbinlog tool from external EC2 or local machine&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install necessary tools:&lt;/strong&gt;&lt;br&gt;
For Ubuntu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install mysql-client awscli -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Create directory structure&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mkdir -p /opt/binlog_sync/binlogs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown -R ec2-user:ec2-user /opt/binlog_sync
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Use your actual user instead of ec2-user if different)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create binlog puller script&lt;/strong&gt;&lt;br&gt;
Create file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /opt/binlog_sync/binlog_fetch.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste the following (modify accordingly):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

# Config
RDS_HOST="your-rds-endpoint"
MYSQL_USER="repl"
MYSQL_PASS="your-replication-password"
BINLOG_DIR="/opt/binlog_sync/binlogs"
S3_BUCKET="s3://your-bucket-name/binlogs"

cd $BINLOG_DIR

# Get the latest binlog file from RDS
LATEST_FILE=$(ls -1 | sort | tail -n 1)

if [ -z "$LATEST_FILE" ]; then
    START_BINLOG="mysql-bin.000001"
else
    START_BINLOG=$LATEST_FILE
fi

# Fetch binlogs using mysqlbinlog
mysqlbinlog \
  --read-from-remote-server \
  --host=$RDS_HOST \
  --user=$MYSQL_USER \
  --password=$MYSQL_PASS \
  --raw \
  --stop-never \
  --result-file=$BINLOG_DIR/ \
  $START_BINLOG &amp;amp;

# Background upload to S3 every 60 seconds
while true; do
  aws s3 sync $BINLOG_DIR $S3_BUCKET
  sleep 60
done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Replace all placeholders (your-rds-endpoint, etc.)&lt;/li&gt;
&lt;li&gt;This will continuously stream binlogs and sync every 60 seconds to S3.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Make it executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chmod +x /opt/binlog_sync/binlog_fetch.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;- Create systemd service&lt;/strong&gt;&lt;br&gt;
Create:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/systemd/system/binlog-sync.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Unit]
Description=MySQL Binlog Sync to S3
After=network.target

[Service]
Type=simple
User=ec2-user
ExecStart=/opt/binlog_sync/binlog_fetch.sh
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;- Start and enable service&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl daemon-reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl enable binlog-sync.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start binlog-sync.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status binlog-sync.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Verify
Check files in /opt/binlog_sync/binlogs/
Check files in S3: aws s3 ls s3://your-bucket-name/binlogs/&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;br&gt;
In this guide, we successfully enabled MySQL binary logging on AWS RDS and built a fully automated solution to continuously stream binlogs to Amazon S3 using mysqlbinlog, systemd, and AWS CLI. This approach allows you to securely archive binary logs for long-term retention, point-in-time recovery, and advanced auditing all while keeping full control and automation within your own AWS environment.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Happy Learning&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>rds</category>
      <category>s3bucket</category>
      <category>binlog</category>
    </item>
  </channel>
</rss>
