<?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: Kriangsak Sumthong (Puk)</title>
    <description>The latest articles on DEV Community by Kriangsak Sumthong (Puk) (@kriangsak_sumthong).</description>
    <link>https://dev.to/kriangsak_sumthong</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1907427%2F43a6f42a-2815-4b7b-be8b-15634d043520.jpg</url>
      <title>DEV Community: Kriangsak Sumthong (Puk)</title>
      <link>https://dev.to/kriangsak_sumthong</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kriangsak_sumthong"/>
    <language>en</language>
    <item>
      <title>Get Started with RPU | AWS Redshift Serverless</title>
      <dc:creator>Kriangsak Sumthong (Puk)</dc:creator>
      <pubDate>Sun, 23 Aug 2026 16:01:22 +0000</pubDate>
      <link>https://dev.to/aws-builders/get-started-with-rpu-aws-redshift-serverless-38oj</link>
      <guid>https://dev.to/aws-builders/get-started-with-rpu-aws-redshift-serverless-38oj</guid>
      <description>&lt;p&gt;A Beginner’s Guide to Understanding RPUs in AWS Redshift Serverless, Let’s go!&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhskthdgb06oab5kfhtc8.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhskthdgb06oab5kfhtc8.png" alt="Redshift Architecture" width="800" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When you open the AWS Redshift Serverless Pricing page, you see the term "RPU" everywhere, but you might not know how much to set it to fit your current workload, and what the final bill will look like. Today, let's decode this number together.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd69vpspysnur7y1z68ns.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd69vpspysnur7y1z68ns.png" alt="Redshift" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Normally, when using Provisioned Redshift, we have to choose the Node type and the number of nodes ourselves, which can be quite a headache. However, with Serverless, AWS eliminates all of that, leaving only one number we need to set: the RPU. It sounds much easier, but the follow-up question is, what exactly is this number, and how do we know how much to set so it's just right and we don't overpay unnecessarily?&lt;/p&gt;




&lt;h2&gt;
  
  
  What exactly is RPU?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Redshift Processing Unit (RPU)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Simply put, RPU is the unit of compute capacity that Redshift Serverless uses to measure processing power. 1 RPU provides 16 GB of memory, along with compute and I/O that scale proportionally. We don't have to configure memory and compute separately like in Provisioned mode. A single RPU number determines both simultaneously.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1q5rx1ylh0x10zma7wzl.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1q5rx1ylh0x10zma7wzl.png" alt="RPU meaning" width="798" height="81"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What we can actually set is called the "Base capacity," which is the RPU level our Workgroup runs at by default. When there's a query that requires more resources, Redshift will automatically scale up and then scale back down to the base once the job is done. Currently, the configurable range is very wide, from 4 up to 1024 RPUs (depending on the Region; some Regions don't yet support the lowest values, and if you are worried about RPUs scaling too much, you can set limits as well).&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F29g5gxevg53hp1i24i4x.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F29g5gxevg53hp1i24i4x.png" alt=" " width="800" height="296"&gt;&lt;/a&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqhz2vf12bwidbetnn7gs.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqhz2vf12bwidbetnn7gs.png" alt=" " width="800" height="303"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  A simple billing formula you must remember
&lt;/h2&gt;

&lt;p&gt;Serverless compute is billed per-second, with a minimum of 60 seconds every time the Warehouse is invoked. If no queries are running, you pay nothing. The formula behind everything is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Cost = RPU x Active hours x Rate per RPU-hour&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are in US East (N. Virginia), the On-demand rate is $0.375 per RPU-hour. This number can change depending on the Region and over time. I recommend checking the actual Pricing page before estimating a real budget; don't just use this number directly.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc39qsm1g0wx500ex0wbv.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc39qsm1g0wx500ex0wbv.png" alt=" " width="565" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's look at a real example from the AWS Pricing page itself. Suppose you have a job running with 128 RPUs 13 times a day, for 10 minutes and 30 seconds each time. The total active time for the day is 8,190 seconds (2.275 hours). Plugging this into the formula yields exactly $109.20 per day. Or consider a more complex example: a Dashboard app with a Base set to 64 RPUs, but during the morning and afternoon, heavy querying causes it to scale up to 192 RPUs and 128 RPUs respectively. Totalling the whole day gives 1,344 RPU-hours, amounting to $504 per day.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuxx69u4ixedptvodd9b8.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuxx69u4ixedptvodd9b8.png" alt=" " width="357" height="163"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The interesting point from the second example is that the number that truly determines the cost isn't just the Base RPU, but rather the “area under the curve” of RPUs multiplied by the active time. Two Workgroups with the exact same Base setting could have vastly different bills if they scale up differently.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7zvez7oeblb531dnkf19.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7zvez7oeblb531dnkf19.png" alt=" " width="490" height="484"&gt;&lt;/a&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpo6vgcqo5cdmq1ny1ww7.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpo6vgcqo5cdmq1ny1ww7.png" alt=" " width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  How do you know how many RPUs to set?
&lt;/h2&gt;

&lt;p&gt;This is where most people get stuck. AWS provides rough guidelines based on the project phase. If it's a new project and you don't yet know the exact usage pattern, it's recommended to start with the lowest Base RPU value in your zone (around 4 to 24 RPUs). Then, observe if queries are slow or if there's any spilling to disk. If you encounter issues, gradually increase the Base step-by-step.&lt;/p&gt;

&lt;p&gt;Once the project starts to grow, it's recommended to move to a Base of 32 RPUs and enable AI-driven scaling with a Price-performance target of 50, also known as Balanced, because AI-driven scaling requires a minimum Base of 32 RPUs to be enabled. For a stable workload that has been running for a while, it's recommended to start directly with AI-driven scaling at Target 50, then adjust it towards 75-100 if it's still slow, or down towards 25 if you feel you're paying more than necessary.&lt;/p&gt;

&lt;p&gt;If you want rough numbers based on the data size a query scans, AWS recommends the following: 32 RPUs can handle queries scanning around 100 GB, 64 RPUs can handle around 250 GB, and 128 RPUs can handle around 500 GB. But keep in mind that this is just a starting point for comparison, as real requirements also depend on the query pattern—including Joins, Aggregations, or the number of columns, not just the data size alone.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvr93uq8pp4yfmsq5v1ee.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvr93uq8pp4yfmsq5v1ee.png" alt=" " width="799" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Common misconception: Setting a high RPU doesn't always mean it's more expensive
&lt;/h2&gt;

&lt;p&gt;I think this is the point that confuses people the most 😆. Instinctively, we think that the higher the RPU is set, the more expensive it will be. But in reality, we pay based on RPUs multiplied by time, not just RPUs alone. Look at this example: The exact same query running at 32 RPUs takes 60 minutes, while running at 128 RPUs takes only 15 minutes. Both scenarios cost exactly the same: $11.52.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0x1n0v4atva0gdu80jc7.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0x1n0v4atva0gdu80jc7.png" alt=" " width="163" height="64"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Therefore, setting the RPU too low doesn't always mean you'll save money if it causes queries to take so long that the total RPU-hours are the same. Plus, you might encounter query spilling to disk, which is 5 to 10 times slower than operating in memory. Real savings only happen when the workload truly requires fewer resources, not just by arbitrarily setting a low value.&lt;/p&gt;




&lt;h2&gt;
  
  
  When should you use Provisioned Reserved Instances instead of Serverless?
&lt;/h2&gt;

&lt;p&gt;Serverless isn't always the cheapest option. If your workload is highly stable, processing the same volume 24 hours a day, 7 days a week with very little variability—like an IoT system continuously receiving data—a Provisioned cluster with a 3-year Reserved commitment might actually be cheaper than Serverless. This is because we aren't utilizing the on-demand flexibility of Serverless at all.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2an9i9xji3gknwm3a5x6.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2an9i9xji3gknwm3a5x6.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's look at a price comparison between an 8 RPU Serverless setup and a 4-Node Provisioned cluster that provides equivalent memory. If both use On-demand pricing, Serverless is about 50% cheaper. But if you reserve the Provisioned cluster for 1 year with No Upfront, the prices become very close, with only about a 5% difference. And if you reserve for a full 3 years, Provisioned becomes up to 35% cheaper than Serverless.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;But the main point is, a 3-year reservation is a very long-term commitment, and technology changes rapidly every year. Therefore, you should be absolutely certain that your workload will remain stable like this for a long time before making a decision.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Another point I'd like to bring up here is Cold starts. Even though Serverless doesn't charge during idle time, if the Workgroup is inactive until it scales down to zero, the Warehouse has to spin back up when a new query comes in. Tests from various sources often show an increased latency of about 10 to 30 seconds before it returns to normal speed (Note: this isn't an official number directly from AWS; it's from third-party testing). If it's a nightly batch job with no one waiting for the result, an extra 10-30 seconds is no big deal. But if it's a dashboard with people staring at a loading screen, you should test this thoroughly before fully committing to Serverless. Setting up small queries to run periodically to "keep warm" can help with this. A Provisioned cluster that runs constantly won't face this issue at all because it doesn't have an idle state that scales down to zero like Serverless.&lt;/p&gt;




&lt;h2&gt;
  
  
  In Summary
&lt;/h2&gt;

&lt;p&gt;If you are starting a new project or don't have a clear usage pattern yet, I recommend starting with Serverless and setting a low Base RPU first. Then, observe and adjust it upwards based on reality. There's no need to hastily guess a high RPU in advance, as you risk paying more than necessary for no reason. If the project has grown and you want consistent performance without having to manually adjust RPUs, AI-driven scaling at Target 50 is the best answer.&lt;/p&gt;

&lt;p&gt;However, if your workload is truly stable-running the exact same tasks 24/7 with no peaks or idle times, you should try comparing prices with a 3-year Reserved Provisioned instance first, as there's a high chance it will actually be cheaper than Serverless.&lt;/p&gt;

&lt;p&gt;Finally, don't forget that the rates and the configurable RPU ranges can change over time as AWS updates them. Before doing serious budget estimations, I recommend always going back to check the Pricing page again. 🚀&lt;/p&gt;




&lt;p&gt;ref:&lt;br&gt;
&lt;a href="https://aws.amazon.com/redshift/pricing/" rel="noopener noreferrer"&gt;https://aws.amazon.com/redshift/pricing/&lt;/a&gt; &lt;a href="https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-billing.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-billing.html&lt;/a&gt; &lt;a href="https://repost.aws/articles/ARPo2EYjL6ST-Cr9ysyPp07w/how-should-i-size-amazon-redshift-for-my-project" rel="noopener noreferrer"&gt;https://repost.aws/articles/ARPo2EYjL6ST-Cr9ysyPp07w/how-should-i-size-amazon-redshift-for-my-project&lt;/a&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq0uucobt3g3653r3tfs5.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq0uucobt3g3653r3tfs5.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>awsbigdata</category>
      <category>awsredshift</category>
      <category>clouddatalabor</category>
    </item>
    <item>
      <title>AWS MWAA Serverless: Is It Worth the Switch from Provisioned?</title>
      <dc:creator>Kriangsak Sumthong (Puk)</dc:creator>
      <pubDate>Wed, 25 Feb 2026 15:58:29 +0000</pubDate>
      <link>https://dev.to/kriangsak_sumthong/aws-mwaa-serverless-is-it-worth-the-switch-from-provisioned-j0f</link>
      <guid>https://dev.to/kriangsak_sumthong/aws-mwaa-serverless-is-it-worth-the-switch-from-provisioned-j0f</guid>
      <description>&lt;p&gt;In the world of Data Engineering, building data pipelines is unavoidable. But what’s even more critical is the Orchestrator. Why? Because we can't (and shouldn't) manually trigger every step of a pipeline. Automation is a necessity.&lt;/p&gt;




&lt;p&gt;Today, we have a massive variety of orchestrators to choose from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Source: Apache Airflow (the most popular), Dagster, and Prefect.&lt;/li&gt;
&lt;li&gt;Managed/Closed Source: Cloud-native platforms like Google Cloud (Cloud Composer), Microsoft Azure, and Databricks.&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%2Fctkrrwdfx9h8ai3q1tij.webp" 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%2Fctkrrwdfx9h8ai3q1tij.webp" alt=" " width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then there’s Amazon Web Services (AWS) with its managed Airflow offering: Amazon MWAA.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Arrival of AWS MWAA Serverless
&lt;/h2&gt;

&lt;p&gt;At the end of 2025, AWS introduced MWAA Serverless. The core concept is simple: allowing Data Engineers to focus on workflows without worrying about infrastructure management.&lt;/p&gt;

&lt;p&gt;In the Provisioned version (non-serverless), AWS spins up dedicated infrastructure behind the scenes. This means you incur costs as long as the environment is active, even if no tasks are running. MWAA Serverless aims to change that.&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%2Fyn3rvkqk7vsocjw3k4jt.webp" 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%2Fyn3rvkqk7vsocjw3k4jt.webp" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*Orchestration on AWS: MWAA vs. Step Functions&lt;br&gt;
It’s worth noting that MWAA isn’t the only orchestrator on AWS; AWS Step Functions is also a very popular choice. I’ll do a deep dive comparison in a future article, but for now, let's focus on MWAA.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A Quick Airflow Refresher&lt;br&gt;
Before we dive in, remember that in Airflow, we write scripts called DAGs (Directed Acyclic Graphs). A DAG defines the structure of your workflow, and inside each DAG are Tasks—the smallest unit of work.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Amazon MWAA Provisioned vs. Serverless
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Amazon MWAA Provisioned&lt;/strong&gt;&lt;br&gt;
This is essentially Apache Airflow deployed on AWS. AWS handles the compute, storage, and database, ensuring scalability, availability, and security. It feels exactly like the Airflow you’d deploy on your own server.&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%2Fh6h32y1xn8alesqn68yk.webp" 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%2Fh6h32y1xn8alesqn68yk.webp" alt=" " width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Amazon MWAA Serverless&lt;/strong&gt;&lt;br&gt;
This is the main highlight. With Serverless, you don’t set up infrastructure at all. You just drop your DAG into an S3 bucket and you're ready to go.&lt;/p&gt;

&lt;p&gt;The Catch: MWAA Serverless only reads YAML files. If you have existing Python-based DAGs, you must convert them to YAML first. (Don't worry, AWS provides a library for this!). Alternatively, you can build DAGs using a drag-and-drop GUI within Amazon SageMaker.&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%2Fnvlmd1g56kd9miygspf2.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%2Fnvlmd1g56kd9miygspf2.png" alt=" " width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  How to use Amazon MWAA Serverless
&lt;/h2&gt;

&lt;p&gt;There are two primary ways to create DAGs:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Method 1: Writing YAML DAGs manually&lt;/strong&gt;&lt;br&gt;
You can write your DAG in VS Code (or any editor) and upload it to S3.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;simples3test:
  dag_id: simples3test
  tasks:
    list_objects:
      operator: airflow.providers.amazon.aws.operators.s3.S3ListOperator
      bucket: your-s3-bucket-name
      prefix: ""
      retries: 0
    create_object_list:
      dependencies:
        - list_objects
      operator: airflow.providers.amazon.aws.operators.s3.S3CreateObjectOperator
      data: Hello MWAA serverless
      s3_bucket: mwaa-serverless-test-cdlb
      s3_key: demo_text.txt
      replace: true
  schedule: 0 0 * * *
&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%2F9qprdu587zwxtt7k2wx4.webp" 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%2F9qprdu587zwxtt7k2wx4.webp" alt=" " width="800" height="173"&gt;&lt;/a&gt;&lt;br&gt;
Once uploaded, you use the AWS CLI to register and execute the workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Create workflow
aws mwaa-serverless create-workflow \
--name simple_s3_test \
--definition-s3-location '{ "Bucket": "your-s3-bucket-name", "ObjectKey": "path/simple_s3_test.yaml" }' \
--role-arn arn:aws:iam::111122223333:role/mwaa-serverless-access-role \
--region us-east-1

# Execute the workflow
aws mwaa-serverless start-workflow-run \
--workflow-arn arn:aws:airflow-serverless:us-east-2:111122223333:workflow/simple_s3_test-abc1234def \
--region us-east-1

# Update workflow if you have made any changes.
aws mwaa-serverless update-workflow \
--workflow-arn arn:aws:airflow-serverless:us-east-2:111122223333:workflow/simple_s3_test-abc1234def \
--definition-s3-location '{ "Bucket": "your-s3-bucket-name", "ObjectKey": "path/simple_s3_test.yaml" }' \
--role-arn arn:aws:iam::111122223333:role/mwaa-serverless-access-role \
--region us-east-1
&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%2Fof3uytmmj7yy6qlqvj9z.webp" 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%2Fof3uytmmj7yy6qlqvj9z.webp" alt=" " width="800" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Method 2: AWS SageMaker Workflow (GUI)&lt;/strong&gt;&lt;br&gt;
You can create workflows visually. In the MWAA Serverless console, click "Create workflow," and it will redirect you to the SageMaker Canvas/Workflow interface. You can drag and drop tasks like "Save file to S3" or "Trigger Glue Job." It’s incredibly convenient.&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%2Frqq7v3q2c8ef8qzh38my.webp" 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%2Frqq7v3q2c8ef8qzh38my.webp" alt=" " width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Extra: Converting Python DAGs to YAML&lt;/strong&gt;&lt;br&gt;
If you want to move your existing dag.py files to MWAA Serverless, AWS provides a converter library:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# AWS Python to Yaml Dag Converter for MWAA Serverless
pip install python-to-yaml-dag-converter-mwaa-serverless

# To convert .py to .yaml
dag-converter convert &amp;lt;python-dag-file&amp;gt;
&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%2Fa7mow4jeurihes4q9gk5.webp" 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%2Fa7mow4jeurihes4q9gk5.webp" alt=" " width="800" height="390"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Same Name, Different Game?
&lt;/h2&gt;

&lt;p&gt;While "Serverless" sounds like an upgrade, it is fundamentally different from the standard Airflow experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Differences &amp;amp; Limitations&lt;/strong&gt;:&lt;br&gt;
Limited Operators: MWAA Serverless focuses almost exclusively on AWS Operators (e.g., S3, Bedrock, Batch, Glue). Classic operators like PythonOperator or BashOperator are not supported. This is because AWS wants the heavy lifting (compute) to happen in other services, not within the serverless orchestrator itself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Missing Parameters&lt;/strong&gt;: Many standard Airflow parameters are unavailable. If you rely on things like email_on_failure, catchup, or on_success_callback, you’ll need to rethink your logic using other AWS services (like SNS for notifications).&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Verdict
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Go with MWAA Serverless if&lt;/strong&gt;: You are building a "pure" AWS workflow, you want something easy to set up, and you prefer a GUI or simple YAML definitions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stay with MWAA Provisioned if&lt;/strong&gt;: You are migrating a complex, existing Airflow environment. If your DAGs use dynamic tasks, DAG-trigger-DAG patterns, or custom Python logic within the operators, Serverless will be more of a headache than a help.&lt;/p&gt;

&lt;p&gt;MWAA Serverless and Provisioned share a name and a concept, but they serve very different use cases. Choose the one that fits your architecture, not just the "Serverless" buzzword!&lt;/p&gt;




&lt;p&gt;REF:&lt;a href="https://docs.aws.amazon.com/mwaa/latest/mwaa-serverless-userguide/mwaas-concepts.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/mwaa/latest/mwaa-serverless-userguide/mwaas-concepts.html&lt;/a&gt;&lt;br&gt;
🌐 Note: This article was translated from Thai with the help of AI to share these insights with the global community. You can find the original Thai version on my page, here: &lt;a href="https://clouddatalabor.com/2026/02/25/can-amazon-mwaa-serverless-replace-amazon-mwaa-provisioned/" rel="noopener noreferrer"&gt;Clouddatalabor&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Happy Coding!&lt;br&gt;
Follow me for more insights on Cloud, Data, and AI at Clouddatalabor.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>aws</category>
      <category>mwaa</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>View vs. Materialized View | A Beginner’s Guide with AWS Athena &amp; Redshift</title>
      <dc:creator>Kriangsak Sumthong (Puk)</dc:creator>
      <pubDate>Mon, 24 Mar 2025 15:43:10 +0000</pubDate>
      <link>https://dev.to/aws-builders/view-vs-materialized-view-a-beginners-guide-with-aws-athena-redshift-5cbl</link>
      <guid>https://dev.to/aws-builders/view-vs-materialized-view-a-beginners-guide-with-aws-athena-redshift-5cbl</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;View vs. Materialized View: What are the differences between these two, and let's try creating them on Redshift and Athena.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What is a View Table?
&lt;/h2&gt;

&lt;p&gt;Normally, when querying data from a database or warehouse, we retrieve it directly from the table, right? However, if we need to repeatedly use the same query or if we need to use the query we wrote in other places, such as in the backend, ETL, or other ELT processes, we have to include the SQL we wrote. Now, imagine that the SQL we wrote is over 100 lines long. What happens? It's messy! Managing the script becomes difficult.&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%2Fbdraawmphltvyxluis33.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%2Fbdraawmphltvyxluis33.png" alt="Example of some complicated query" width="800" height="877"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, as seen in the picture, this SQL is very long and complex. Copying it to different places or trying to write more code based on it becomes difficult and has a high chance of errors. This means that after copying, the syntax might get distorted.&lt;/p&gt;

&lt;p&gt;Therefore, something called a View table was created  to reduce the complexity of querying. As a result, the SQL we saw above will be reduced to what's shown in the example below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Example usecase, which is not really a good usecase LOL
SELECT * FROM company_table
WHERE member_id IN (SELECT employee_id FROM view_table)

-- If we not using view table
SELECT * FROM company_table
WHERE member_id IN (
SELECT employee_id 
FROM abc as a
LEFT JOIN efg as e
ON a.id = e.id
.
.
.
.
WHERE id IS NOT NULL);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will be similar to querying a regular table, except that the data returned is the result of the query underlying that View table.&lt;/p&gt;

&lt;p&gt;However! Modern data warehouses have both View Tables and Materialized View Tables. What are the differences between these two? The next section will explain each type of View.&lt;/p&gt;

&lt;h2&gt;
  
  
  View Table
&lt;/h2&gt;

&lt;p&gt;View Table is a virtual representation of a table. In other words, when we create a View table, the physical data is not stored in the database. Instead, when we query it, the database executes the query that was used to create the View table. Therefore, no matter how many View tables we create, the storage space does not increase. Let's see how to create a View table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- syntax
CREATE [ OR REPLACE ] VIEW name [ ( column_name [, ...] ) ] AS query
[ WITH NO SCHEMA BINDING ] -- [] optional
-- example  use               
CREATE VIEW vw_myevents
AS
SELECT id FROM mockl;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creating a View table and refreshing, we will find that the View table is located in the View section of both Redshift and Athena. Both services use similar syntax, which is CREATE VIEW.&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%2Ferrh9tijf43aoxvp8l19.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%2Ferrh9tijf43aoxvp8l19.png" alt="Redshift views" width="313" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Redshift, we can see the query underlying the View by right-clicking and selecting 'Show view definitions'. We can also edit it directly from there.&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%2Fvj68o56k946gpbwhrgix.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%2Fvj68o56k946gpbwhrgix.png" width="708" height="299"&gt;&lt;/a&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%2F2vira1wv4qbij2lyf3yj.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%2F2vira1wv4qbij2lyf3yj.png" width="723" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Athena, you can view and edit the query by right-clicking and selecting 'Show/edit Query'. You can also make additional edits directly from there.&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%2Fdxb2fjjqw040wxuphbkl.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%2Fdxb2fjjqw040wxuphbkl.png" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Materialized View
&lt;/h2&gt;

&lt;p&gt;Materialized View is a View that is similar to a regular View table, but with an added feature: Materialized View takes the data resulting from the query and creates a physical table that is stored in the database.&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%2Fj08g81ft7utgy0e3zdfn.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%2Fj08g81ft7utgy0e3zdfn.png" width="360" height="148"&gt;&lt;/a&gt;&lt;br&gt;
Querying data is faster with Materialized View compared to a regular View table. For example, if we have a join between table A and table B, with a regular View table, every time we query the view, the system has to process the join between table A and table B again. However, with Materialized View, the join processing is already done because the joined data is pre-stored.&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%2Fel15v8o6yhioepjn105f.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%2Fel15v8o6yhioepjn105f.png" width="800" height="334"&gt;&lt;/a&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%2F565qcktu9g360jdgoz5z.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%2F565qcktu9g360jdgoz5z.png" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's try creating a Materialized View in Redshift. (Athena cannot create Materialized Views because Athena is a serverless query engine and does not store any data. Therefore, it cannot create them. The workaround is to create a table from the query and store it in S3.🤓)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- syntax
CREATE MATERIALIZED VIEW mv_name
[ BACKUP { YES | NO } ]
[ table_attributes ]
[ AUTO REFRESH { YES | NO } ]
AS query 

-- example use
CREATE MATERIALIZED VIEW "public"."mvw_myevent_demo"
AUTO REFRESH YES
AS
SELECT
    id, first_name, last_name
FROM
    "public"."mockl"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After refreshing the Editor page, you'll find that the Materialized View is now in the View section. As mentioned, Materialized View stores data in the database. Therefore, when you query SVV_TABLE_INFO (a table that stores information about system tables and user-defined tables), you'll see only the Materialized View, not the View table, and it also shows the data size.&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%2F92zfjwp6wvfxzhv28dvn.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%2F92zfjwp6wvfxzhv28dvn.png" width="800" height="308"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The limitations of Materialized View are quite significant. Here are some examples of what cannot be used to create Materialized Views:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Standard views or system tables and views&lt;/li&gt;
&lt;li&gt;Temporary tables&lt;/li&gt;
&lt;li&gt;User-defined functions&lt;/li&gt;
&lt;li&gt;ORDER BY, LIMIT, or OFFSET clauses&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Pros and Cons of View and Materialized View
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;View Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simplifies queries, reducing lengthy queries to just one line.&lt;/li&gt;
&lt;li&gt;Provides up-to-date data every time it's queried, reflecting the underlying data in the View (e.g., if there's no WHERE clause, you get the latest data).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;View Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modifying a View requires deleting and recreating it.&lt;/li&gt;
&lt;li&gt;Changes in the source tables of the View's query can break the View.&lt;/li&gt;
&lt;li&gt;While it provides fresh data, it cannot be indexed or optimized directly;&lt;/li&gt;
&lt;li&gt;optimization must be done on the underlying tables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Materialized View Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster query performance because it retrieves data from the pre-stored Materialized View, not the source tables.&lt;/li&gt;
&lt;li&gt;Reduces ETL/ELT steps and simplifies modifications compared to creating new tables via ETL/ELT.&lt;/li&gt;
&lt;li&gt;Redshift offers auto-refresh, updating data from source tables, eliminating the need for separate data update pipelines.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Materialized View Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increases database storage consumption, similar to creating a new table.&lt;/li&gt;
&lt;li&gt;Not suitable for real-time data with constant updates; better for batch processing (even with manual refresh).&lt;/li&gt;
&lt;li&gt;Cannot be created on Athena.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Regarding the selection of which to use, I have these general guidelines:
&lt;/h2&gt;

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

&lt;ul&gt;
&lt;li&gt;If you want to avoid increasing storage costs.&lt;/li&gt;
&lt;li&gt;If you need to use it with real-time data.&lt;/li&gt;
&lt;li&gt;If the query is simple and not complex.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Materialized View:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you want to improve query performance for dashboard displays, especially when pre-processing is required.&lt;/li&gt;
&lt;li&gt;To reduce processing overhead from complex queries, as Materialized View pre-processes and stores data as a physical table.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Hope this help!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;originated from my article in Thai: &lt;a href="https://clouddatalabor.com/2025/03/24/view-vs-materialized-view-a-beginners-guide-with-aws-athena-redshift/" rel="noopener noreferrer"&gt;https://clouddatalabor.com/2025/03/24/view-vs-materialized-view-a-beginners-guide-with-aws-athena-redshift/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>aws</category>
      <category>redshift</category>
      <category>athena</category>
    </item>
  </channel>
</rss>
