<?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: Satyam Gupta</title>
    <description>The latest articles on Forem by Satyam Gupta (@satyam_gupta).</description>
    <link>https://forem.com/satyam_gupta</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%2F2506195%2F84c79105-4f8d-4bf7-937e-888ac4344728.jpg</url>
      <title>Forem: Satyam Gupta</title>
      <link>https://forem.com/satyam_gupta</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/satyam_gupta"/>
    <language>en</language>
    <item>
      <title>Pandas Series – Part 3: The Power of groupby()</title>
      <dc:creator>Satyam Gupta</dc:creator>
      <pubDate>Sat, 25 Oct 2025 08:19:00 +0000</pubDate>
      <link>https://forem.com/satyam_gupta/pandas-series-part-3-the-power-of-groupby-4m83</link>
      <guid>https://forem.com/satyam_gupta/pandas-series-part-3-the-power-of-groupby-4m83</guid>
      <description>&lt;p&gt;&lt;em&gt;This is Part 3 of the Pandas Series, where we explore common Pandas gotchas that can level up your interview answers and your daily data work.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Imagine you're in a FAANG interview. The hiring manager says, "We have a petabyte-scale dataset of user transactions. I need you to generate a daily summary report showing, for each country, the total revenue, the average order value, and the number of unique customers who made a purchase. How would you approach this with Pandas?"&lt;/p&gt;

&lt;p&gt;This is the quintessential &lt;code&gt;groupby&lt;/code&gt; problem. Your ability to answer it cleanly and efficiently is a massive signal of your skill level.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Core Concept: Split-Apply-Combine&lt;/strong&gt;&lt;br&gt;
This is the mental model for any groupby operation. It's a three-step process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Split:&lt;/strong&gt; The data is broken into smaller groups based on the criteria you specify (e.g., all rows for 'USA', all rows for 'India', etc.).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Apply:&lt;/strong&gt; A function is applied to each of these smaller groups independently (e.g., &lt;code&gt;sum()&lt;/code&gt;, &lt;code&gt;mean()&lt;/code&gt;, &lt;code&gt;count()&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Combine:&lt;/strong&gt; The results from each group are collected and combined into a new DataFrame or Series.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;From Basic Aggregations to .agg()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The simplest groupby is applying one function to one column: &lt;code&gt;df.groupby('country')['revenue'].sum()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;But what if you need the sum, mean, AND count? You could run the code three times, but that's inefficient. The answer is the &lt;code&gt;.agg()&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Level 1:&lt;/strong&gt; Multiple functions on one column &lt;code&gt;df.groupby('country')['revenue'].agg(['sum', 'mean', 'count'])&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Level 2:&lt;/strong&gt; Different functions on different columns. This is where it gets powerful. You use a dictionary to specify which function to apply to which column.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;summary = df.groupby('country').agg(
    {'revenue': 'sum',      # Sum of the revenue column
     'order_id': 'count',   # Count of all orders
     'customer_id': 'nunique'} # Count of unique customers
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Level 3: Named Aggregations:&lt;/strong&gt; The dictionary method is great, but the column names in the output can be messy. The modern, preferred, and most readable method is Named Aggregation. It lets you control the output column names directly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;summary = df.groupby('country').agg(
    total_revenue=('revenue', 'sum'),
    number_of_orders=('order_id', 'count'),
    unique_customers=('customer_id', 'nunique')
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This syntax, &lt;code&gt;new_column_name=('source_column', 'function')&lt;/code&gt;, is clean, explicit, and produces a perfectly formatted DataFrame. This is what interviewers love to see.&lt;br&gt;
⚡ For petabyte-scale data, this logic translates directly to PySpark’s groupBy().agg() — same concept, distributed execution.&lt;/p&gt;

&lt;p&gt;And that’s a wrap for Part 3 of the Pandas Mastery Series 🎯&lt;br&gt;
Next up: Should we dive into .apply() magic or merging/joining DataFrames next? Drop your pick below 👇&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>pandas</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Pandas Series – Part 2: Common Gotchas Around Indexing</title>
      <dc:creator>Satyam Gupta</dc:creator>
      <pubDate>Tue, 14 Oct 2025 08:46:53 +0000</pubDate>
      <link>https://forem.com/satyam_gupta/pandas-series-part-2-common-gotchas-around-indexing-97h</link>
      <guid>https://forem.com/satyam_gupta/pandas-series-part-2-common-gotchas-around-indexing-97h</guid>
      <description>&lt;p&gt;&lt;em&gt;This is Part 2 of the Pandas Series, where we explore common Pandas gotchas that can level up your interview answers and your daily data work.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The Core Concepts&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. What is an Index?&lt;/strong&gt;&lt;br&gt;
Think of the DataFrame index not as a row number, but as a set of labels or addresses for your rows. Like a dictionary key, it's optimized for fast lookups. When you write &lt;code&gt;df[df['column'] == 'value']&lt;/code&gt;, Pandas has to scan the entire column. When you use a well-structured index with &lt;code&gt;df.loc['label']&lt;/code&gt;, Pandas can jump directly to the data.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;set_index()&lt;/code&gt; and &lt;code&gt;reset_index()&lt;/code&gt;
These are your primary tools for shaping your index.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;df.set_index('column_name')&lt;/code&gt;: Promotes one or more columns to become the index.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;df.reset_index()&lt;/code&gt;: Demotes the index level(s) back to being regular columns.&lt;/p&gt;

&lt;p&gt;Use these wisely — a well-structured index can cut query time dramatically, especially on large datasets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The MultiIndex (Hierarchical Indexing)&lt;/strong&gt;&lt;br&gt;
This is the "power move." A MultiIndex allows you to have multiple levels of indexing. Imagine a book's table of contents with Chapters, then Sections within Chapters. This structure lets you "drill down" to your data with incredible speed and precision.&lt;/p&gt;

&lt;p&gt;Let's look at an example. A DataFrame with an index on &lt;code&gt;(store, product)&lt;/code&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;sales&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;store&lt;/td&gt;
&lt;td&gt;product&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Store_A&lt;/td&gt;
&lt;td&gt;Apples&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Oranges&lt;/td&gt;
&lt;td&gt;150&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Store_B&lt;/td&gt;
&lt;td&gt;Apples&lt;/td&gt;
&lt;td&gt;80&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Bananas&lt;/td&gt;
&lt;td&gt;120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Oranges&lt;/td&gt;
&lt;td&gt;90&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With this structure, you can easily select:&lt;/p&gt;

&lt;p&gt;All data for Store_A: &lt;br&gt;
&lt;code&gt;df.loc['Store_A']&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Data for Apples in Store_B: &lt;br&gt;
&lt;code&gt;df.loc[('Store_B', 'Apples')]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Pro Tip: For range-based slicing (like with dates), the index must be sorted for optimal performance. You can do this with df.sort_index().&lt;/p&gt;

&lt;p&gt;And that’s it for Day 2 👏&lt;br&gt;
Indexing is one of those Pandas topics most people use without really understanding — but once you do, you unlock serious performance and clarity.&lt;/p&gt;

&lt;p&gt;What’s your favourite indexing trick or gotcha you’ve run into while working with Pandas?&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>pandas</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Pandas Series – Part 1: .loc, SettingWithCopyWarning, and Chained Indexing</title>
      <dc:creator>Satyam Gupta</dc:creator>
      <pubDate>Thu, 02 Oct 2025 11:28:25 +0000</pubDate>
      <link>https://forem.com/satyam_gupta/pandas-loc-settingwithcopywarning-and-chained-indexing-29kn</link>
      <guid>https://forem.com/satyam_gupta/pandas-loc-settingwithcopywarning-and-chained-indexing-29kn</guid>
      <description>&lt;p&gt;&lt;em&gt;This is part 1 of my Pandas Gotchas series — short, sharp lessons on mistakes that trip up even experienced developers (and show up in interviews).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let’s start with a classic:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;df[df['category'] == 'electronics']['price'] *= 0.9&lt;/code&gt;&lt;br&gt;
At first glance, it looks fine. You’re applying a 10% discount to electronics.&lt;br&gt;
But here’s the catch: sometimes this works, sometimes it doesn’t.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did the original DataFrame change?&lt;/li&gt;
&lt;li&gt;Or did your code silently fail?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re unsure, welcome to one of Pandas’ most confusing traps: &lt;code&gt;views vs. copies'&lt;/code&gt; and the dreaded &lt;code&gt;chained indexing&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This question isn't just about syntax; it's about your understanding of how Pandas works under the hood.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Core Problem: Views vs. Copies&lt;/strong&gt;&lt;br&gt;
When you select a subset of a DataFrame, Pandas might return one of two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A View&lt;/strong&gt;: This is a "window" into the original DataFrame. If you modify a view, the original DataFrame is also modified. This is memory-efficient.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A Copy&lt;/strong&gt;: This is a brand new DataFrame, completely independent of the original. Modifying the copy will not change the original.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The danger is that Pandas doesn't guarantee which one you'll get. This ambiguity is the source of the problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Culprit: Chained Indexing&lt;/strong&gt;&lt;br&gt;
The problematic code &lt;code&gt;df[df['category'] == 'electronics']['price'] *= 0.9&lt;/code&gt; is an example of &lt;strong&gt;chained indexing&lt;/strong&gt;. Let's break it down:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;df[df['category'] == 'electronics']&lt;/code&gt;: This is the first operation. Pandas executes this and returns a DataFrame. Is it a view or a copy? We don't know for sure. Let's call this temporary result &lt;code&gt;temp_df&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;['price'] *= 0.9&lt;/code&gt;: This second operation is performed on &lt;code&gt;temp_df&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If &lt;code&gt;temp_df&lt;/code&gt; was a copy, you just modified a temporary object that is immediately discarded. The original df remains unchanged. This is a silent failure – the worst kind of bug.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;[SettingWithCopyWarning]&lt;/code&gt;(&lt;a href="https://pandas.pydata.org/docs/reference/api/pandas.errors.SettingWithCopyWarning.html" rel="noopener noreferrer"&gt;https://pandas.pydata.org/docs/reference/api/pandas.errors.SettingWithCopyWarning.html&lt;/a&gt;) is Pandas' way of telling you, "Hey, you're trying to modify something that might be a copy. I can't be sure if this will work as you expect."&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%2F65h1ja3ta2foo8vhnqmc.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%2F65h1ja3ta2foo8vhnqmc.png" alt=" " width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution: Use .loc for Assignments&lt;/strong&gt;&lt;br&gt;
The correct, unambiguous way to perform this operation is with the &lt;code&gt;.loc&lt;/code&gt; indexer. &lt;code&gt;.loc&lt;/code&gt; allows you to specify the rows and columns you want to access or modify in a single operation.&lt;/p&gt;

&lt;p&gt;The syntax is &lt;code&gt;.loc[row_indexer, column_indexer]&lt;/code&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%2Fatzflljwpab6ua7wyf0l.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%2Fatzflljwpab6ua7wyf0l.png" alt=" " width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Incorrect (Chained Indexing):&lt;br&gt;
&lt;code&gt;df[df['category'] == 'electronics']['price'] *= 0.9&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Correct (Using .loc):&lt;br&gt;
&lt;code&gt;df.loc[df['category'] == 'electronics', 'price'] *= 0.9&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This code guarantees that the modification happens on the original df. You are explicitly telling Pandas: "In the DataFrame df, find the rows where category is electronics, select the price column for those rows, and update it." &lt;br&gt;
No ambiguity, no warning, no silent failures.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;🚨 Never trust chained indexing in Pandas. 
✅ Always use .loc when modifying data.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It’s not just cleaner — it saves you from nasty bugs and makes your intent unambiguous.&lt;/p&gt;

&lt;p&gt;🚀 Stay tuned — this is just Part 1 of the Pandas Gotchas series.&lt;br&gt;
In the upcoming parts, we’ll cover more subtle traps, performance quirks, and interview-style puzzles that every Pandas user should know.&lt;/p&gt;

</description>
      <category>pandas</category>
      <category>python</category>
      <category>career</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>ACID vs BASE: The Foundations of Reliable Databases</title>
      <dc:creator>Satyam Gupta</dc:creator>
      <pubDate>Tue, 23 Sep 2025 09:39:51 +0000</pubDate>
      <link>https://forem.com/satyam_gupta/acid-vs-base-the-foundations-of-reliable-databases-hag</link>
      <guid>https://forem.com/satyam_gupta/acid-vs-base-the-foundations-of-reliable-databases-hag</guid>
      <description>&lt;p&gt;When I first started working with databases, I built a small app that updated a database, ran backend logic, and exported a CSV. Everything looked fine—until multiple users ran transactions at once.&lt;/p&gt;

&lt;p&gt;One day, a transaction went through halfway: the database update in progress, but the logic continued, producing a broken CSV. That was my wake-up call.&lt;/p&gt;

&lt;p&gt;It taught me why ACID properties aren’t just academic—they’re the silent contract that keeps systems reliable.&lt;/p&gt;

&lt;p&gt;🔹 &lt;strong&gt;The ACID Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Atomicity → All or nothing. If one step fails, the entire transaction rolls back.&lt;/p&gt;

&lt;p&gt;Consistency → The database always moves from one valid state to another.&lt;/p&gt;

&lt;p&gt;Isolation → Transactions don’t interfere. Running in parallel should look like they happened sequentially.&lt;/p&gt;

&lt;p&gt;Durability → Once a transaction is committed, it persists—even after a crash.&lt;/p&gt;

&lt;p&gt;These guarantees make relational databases rock-solid for financial, healthcare, and mission-critical workloads.&lt;/p&gt;

&lt;p&gt;🔹 &lt;strong&gt;Enter BASE in Distributed Systems&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But as systems scale, strict ACID becomes hard (and expensive) to maintain across distributed nodes. That’s where BASE comes in:&lt;/p&gt;

&lt;p&gt;Basically Available → The system guarantees availability even under failures.&lt;/p&gt;

&lt;p&gt;Soft state → Data doesn’t have to be instantly consistent.&lt;/p&gt;

&lt;p&gt;Eventually consistent → Data replicas converge to the same state over time.&lt;/p&gt;

&lt;p&gt;BASE sacrifices immediacy of correctness for speed and resilience.&lt;/p&gt;

&lt;p&gt;🔹 &lt;strong&gt;Practical Examples&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ACID use cases → banking, inventory management, booking systems.&lt;/p&gt;

&lt;p&gt;BASE use cases → social media feeds, recommendation engines, analytics dashboards.&lt;/p&gt;

&lt;p&gt;Think about your Instagram “likes” count. It may not update instantly on all devices, but it eventually reflects the true number. That’s BASE in action.&lt;/p&gt;

&lt;p&gt;🔹 &lt;strong&gt;Choosing Between ACID and BASE&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It’s never black-and-white. Many modern systems blend both:&lt;/p&gt;

&lt;p&gt;Use ACID guarantees for the critical path (e.g., recording a payment).&lt;/p&gt;

&lt;p&gt;Use BASE for derived, less critical flows (e.g., analytics, user engagement metrics).&lt;/p&gt;

&lt;p&gt;Takeaway: As engineers, our job is not just to know ACID and BASE definitions—but to make conscious trade-offs when designing architectures. Correctness and availability are both valuable—it’s about knowing where to lean on each.&lt;/p&gt;

&lt;p&gt;👉 Where have you seen ACID vs BASE trade-offs in your projects?&lt;/p&gt;

</description>
      <category>programming</category>
      <category>database</category>
      <category>mongodb</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Communicating with Data: A Simple Framework That Changed My Approach</title>
      <dc:creator>Satyam Gupta</dc:creator>
      <pubDate>Wed, 10 Sep 2025 19:48:12 +0000</pubDate>
      <link>https://forem.com/satyam_gupta/communicating-with-data-a-simple-framework-that-changed-my-approach-ie2</link>
      <guid>https://forem.com/satyam_gupta/communicating-with-data-a-simple-framework-that-changed-my-approach-ie2</guid>
      <description>&lt;p&gt;As engineers and analysts, we spend a lot of time building dashboards, pipelines, and reports. But here’s the uncomfortable truth I’ve learned:&lt;/p&gt;

&lt;p&gt;📊Even the best-looking dashboard can still fail.&lt;/p&gt;

&lt;p&gt;Why? Because if the audience doesn’t know what to do with it, the insight is wasted.&lt;/p&gt;

&lt;p&gt;This happened to me multiple times — polishing a dashboard, sending it off, and then being asked: “Cool, but… what now?”&lt;/p&gt;

&lt;p&gt;That’s when I started applying the Who, What, How framework (from Storytelling with Data). It’s simple, but powerful.&lt;/p&gt;

&lt;p&gt;🔹 Who&lt;/p&gt;

&lt;p&gt;Be crystal clear about your audience. Is it a VP making a budget decision? A PM prioritizing a feature? Another engineer debugging performance? Each requires a different lens.&lt;/p&gt;

&lt;p&gt;🔹 What&lt;/p&gt;

&lt;p&gt;Always tie data to an action. Don’t just show that user churn increased — recommend what should be done. Decide, approve, invest, support — make it actionable.&lt;/p&gt;

&lt;p&gt;🔹 How&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pick the right channel:&lt;/li&gt;
&lt;li&gt;Live deck = your voice carries nuance.&lt;/li&gt;
&lt;li&gt;Written doc/email = more detail, less control.&lt;/li&gt;
&lt;li&gt;Slideument = mix of both, often overused.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And don’t underestimate tone: urgent vs. celebratory vs. exploratory makes a difference.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tools for Structuring Your Story&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;3-Minute Story: If you can’t explain it in 3 minutes, you probably don’t understand it well enough. This forces you to distill the essence.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Big Idea: Write down one sentence that combines your unique perspective + what’s at stake. That becomes the anchor for your narrative.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Storyboarding: Don’t open PowerPoint first. Use paper, a whiteboard, or Post-its to lay out the flow. It saves time and gets stakeholder buy-in before you over-invest in slides.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Why this matters for developers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We often think communication is “extra.” But if our work doesn’t drive decisions, it’s just numbers on a screen. By clarifying Who, What, and How, I’ve seen my work get adopted faster and conversations move from “interesting” to “decisive.”&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>beginners</category>
      <category>presentation</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Building an End-to-End Data Engineering Pipeline with DuckDB and Python</title>
      <dc:creator>Satyam Gupta</dc:creator>
      <pubDate>Mon, 01 Sep 2025 17:39:42 +0000</pubDate>
      <link>https://forem.com/satyam_gupta/building-an-end-to-end-data-engineering-pipeline-with-duckdb-and-python-53g2</link>
      <guid>https://forem.com/satyam_gupta/building-an-end-to-end-data-engineering-pipeline-with-duckdb-and-python-53g2</guid>
      <description>&lt;p&gt;Tldr: An end‑to‑end data engineering + analytics walkthrough that takes a public dataset from raw → cleaned → star schema (fact + dims) → data quality checks → business marts → charts using a single Jupyter notebook.&lt;/p&gt;

&lt;p&gt;This article is also available on Medium and LinkedIn, but here I’ve included more code.&lt;/p&gt;

&lt;p&gt;Data engineering isn’t just about moving data around — it’s about building pipelines that make data usable. In this tutorial, I’ll walk through how I turned a raw dataset into BI-ready marts and visualizations, all inside a single Jupyter Notebook.&lt;/p&gt;

&lt;p&gt;We’ll follow the Medallion Architecture pattern:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bronze → Raw data&lt;/li&gt;
&lt;li&gt;Silver → Cleaned and standardized&lt;/li&gt;
&lt;li&gt;Gold → Star schema (fact + dimensions)&lt;/li&gt;
&lt;li&gt;QA → Quality checks&lt;/li&gt;
&lt;li&gt;Marts → Business-friendly aggregates&lt;/li&gt;
&lt;li&gt;Visualization → Final charts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 Full repo: &lt;a href="https://github.com/Satyam-gupta20/data-engineering-endToend" rel="noopener noreferrer"&gt;https://github.com/Satyam-gupta20/data-engineering-endToend&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%2F1l6sn2o7u9y2bnd5ig46.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%2F1l6sn2o7u9y2bnd5ig46.png" alt=" " width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Ingestion (Bronze Layer)
&lt;/h2&gt;

&lt;p&gt;At this stage, everything is “as-is” — messy but captured.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;train_ds = load_dataset('Hacker0x01/disclosed_reports', split = "train").to_pandas()
test_ds = load_dataset('Hacker0x01/disclosed_reports', split = 'test').to_pandas()
validate_ds = load_dataset('Hacker0x01/disclosed_reports', split = 'validation').to_pandas()

df = pd.concat([train_ds, test_ds, validate_ds], ignore_index = True)

# for any null dict fields, add {} to them instead of them being blank
for c in ['reporter', 'team', 'weakness', 'structured_scope']:
  df[c] = df[c].apply(lambda x : x if isinstance(x, dict) else {})

  df[c + "_json"] = df[c].apply(
      lambda d : json.dumps(
          {k : (v.tolist() if isinstance(v, np.ndarray) else v) for k,v in d.items()},
          sort_keys = True,
          ensure_ascii =  False
      )
  )

#convert date fields to datetime
df['created_at'] = pd.to_datetime(df.get("created_at"), errors = "coerce")
df['disclosed_at'] = pd.to_datetime(df.get("disclosed_at"), errors = "coerce")

bronze_cols = [ "id", "title", "created_at", "disclosed_at", "substate", "visibility", "has_bounty?", "vote_count",
               "original_report_id", "reporter_json", "team_json", "weakness_json", "structured_scope_json", "vulnerability_information" ]

bronze = df[[c for c in bronze_cols if c in df.columns]]
bronze.to_parquet("bronze_hackerone_reports.parquet", index = False)
bronze.to_csv("raw_data.csv")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Transformation (Silver Layer)
&lt;/h2&gt;

&lt;p&gt;Silver = cleaned, consistent, ready for modeling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# create staging table with clean/standardized scalar columns
con.sql("""
    CREATE OR REPLACE TABLE stg_reports AS
    SELECT
    CAST(id as BIGINT) as report_id,
    title,
    LOWER(NULLIF(substate,'')) as substate, --normalised casing
    visibility,
    "has_bounty?" as has_bounty,
    CAST(vote_count AS INTEGER) as vote_count,
    CAST(created_at AS TIMESTAMP) as created_at,
    CAST(disclosed_at AS TIMESTAMP) as disclosed_at,
    CAST(original_report_id AS BIGINT) as original_report_id,
    reporter_json,
    weakness_json,
    team_json,
    structured_scope_json,
    vulnerability_information
    FROM bronze;
""")

#stage normalised tables ie, flatten JSON into typed columns
con.sql("""
    CREATE OR REPLACE TABLE stg_reporter AS
    SELECT DISTINCT
    reporter_json,
    json_extract_string(reporter_json, '$.username') as username,
    CAST(json_extract(reporter_json, '$.verified') AS BOOLEAN) as verified
    from bronze;
""")

con.sql("""
    CREATE OR REPLACE TABLE stg_team AS
    SELECT DISTINCT
    team_json,
    json_extract_string(team_json, '$.handle') as handle,
    CAST(json_extract(team_json, '$.id') AS BIGINT) as id,
    CAST(json_extract(team_json,'$.offers_bounties') AS BOOLEAN) AS offers_bounties
    from bronze;
""")

con.sql("""
    CREATE OR REPLACE TABLE stg_weakness AS
    SELECT DISTINCT
    weakness_json,
    json_extract_string(weakness_json,'$.name') AS weakness_name,
    CAST(json_extract(weakness_json, '$.id') AS BIGINT) as id,
    FROM bronze;
""")

con.sql("""
CREATE OR REPLACE TABLE stg_asset AS
SELECT DISTINCT
  structured_scope_json,
  json_extract_string(structured_scope_json,'$.asset_identifier') AS asset_identifier,
  json_extract_string(structured_scope_json,'$.asset_type')       AS asset_type,
  json_extract_string(structured_scope_json,'$.max_severity')     AS max_severity
FROM bronze;
""")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Star Schema (Gold Layer)
&lt;/h2&gt;

&lt;p&gt;We separate fact and dimension tables:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Goal:&lt;/strong&gt; Build a Source of Truth model (star schema) with conformed dimensions and a single fact table.&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Generate Surrogate Keys:&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Apply hash(JSON) on each entity’s raw JSON to generate a stable, privacy-safe surrogate key (reporter_id, team_id, weakness_id, asset_id).&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Why: Maintains join consistency across all downstream systems while protecting sensitive identifiers (handles, usernames, etc.).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dimension Tables:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;dim_reporter, dim_team, dim_weakness, dim_structured_scope — one row per unique entity, keyed by surrogate ID.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Conformed (consistent) across all marts and use cases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fact Table:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;fact_report — one row per report, with:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Natural key (report_id)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Foreign keys to all four dimensions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Core measures and attributes (has_bounty, vote_count, created_at, disclosed_at, substate)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Why Star Schema:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Easy to query for BI tools (Looker/Tableau/Power BI).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Clear separation of measures (facts) and descriptive attributes (dims).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Facilitates incremental loads and SCD handling in production.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How we do this in production:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generate surrogate keys once in a controlled transformation job to guarantee stability.&lt;/li&gt;
&lt;li&gt;Enforce PK/FK relationships via schema constraints or dbt tests.&lt;/li&gt;
&lt;li&gt;Store Gold layer in a governed warehouse (Snowflake/BigQuery/Redshift) with strict access control, making it the single source of truth for all analytics &amp;amp; AI workloads.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;AI tie-in:&lt;/strong&gt; Clean, normalized entity attributes make it easier to build safe, PII-free ML feature sets downstream.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;con.sql("""
    CREATE OR REPLACE TABLE dim_reporter as
    SELECT DISTINCT
    hash(reporter_json) as reporter_id, -- surrogate_key
    username,
    verified
    FROM stg_reporter;
""")

con.sql("""
    CREATE OR REPLACE TABLE dim_team as
    SELECT DISTINCT
    hash(team_json) as team_id, -- surrogate_key
    id,
    handle,
    offers_bounties
    FROM stg_team;
""")

con.sql("""
    CREATE OR REPLACE TABLE dim_weakness as
    SELECT DISTINCT
    hash(weakness_json) as weakness_id, -- surrogate_key
    id,
    weakness_name
    FROM stg_weakness;
""")

con.sql("""
    CREATE OR REPLACE TABLE dim_structured_scope as
    SELECT DISTINCT
    hash(structured_scope_json) as asset_id, -- surrogate_key
    asset_identifier,
    asset_type,
    max_severity
    FROM stg_asset;
""")
&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%2Famuhvdei5svq1dux5s59.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%2Famuhvdei5svq1dux5s59.png" alt=" " width="581" height="631"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  QA Layer
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Goal&lt;/strong&gt;: Validate that Gold layer tables meet data integrity, completeness, and consistency standards before they are exposed to BI tools or AI models.&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;Record Counts:&lt;/li&gt;
&lt;li&gt;Ensure no unexpected row loss or duplication between Bronze → Silver → Gold.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example: COUNT(DISTINCT report_id) in fact_report should match original dataset count (minus intentional filters).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Key Integrity Checks:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;All fact_report foreign keys (reporter_id, team_id, weakness_id, asset_id) must exist in their respective dimension tables.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Null and Data Type Checks&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Confirm mandatory fields (e.g., created_at, substate) are non-null.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verify correct data types for dates, booleans, and integers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Referential Consistency:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No orphaned dimension entries (dims without a matching fact) unless intentional for slowly changing dimensions.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Guarantees trust in the Source of Truth.&lt;/li&gt;
&lt;li&gt;Prevents BI dashboards or ML pipelines from producing misleading insights.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How we do this in production:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use dbt tests (unique, not_null, relationships) or Great Expectations to automate QA.&lt;/li&gt;
&lt;li&gt;Set up CI/CD checks so broken data never reaches production.&lt;/li&gt;
&lt;li&gt;Implement data quality alerts (Slack/Email) when thresholds fail.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Phase 5 – Aggregation &amp;amp; Marts (Analytics Layer)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Goal&lt;/strong&gt;: Create pre-aggregated, business-friendly datasets optimized for consumption by BI tools, APIs, and AI feature stores.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Marts Matter:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simplify queries for analysts and business users.&lt;/li&gt;
&lt;li&gt;Improve dashboard performance by avoiding heavy aggregations at runtime.&lt;/li&gt;
&lt;li&gt;Provide feature-ready datasets for AI/ML models.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How we do this in production:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create materialized views or incremental tables in the warehouse.&lt;/li&gt;
&lt;li&gt;Store in BI schema separate from operational schemas.&lt;/li&gt;
&lt;li&gt;Automate refreshes using orchestration tools (Airflow/Prefect) on a schedule or event trigger.&lt;/li&gt;
&lt;li&gt;For AI, register these marts in a feature store (Feast/Tecton) so ML teams can use them without re-engineering features.&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%2Fu0g9zi01j1fgav8x0r6u.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%2Fu0g9zi01j1fgav8x0r6u.png" alt=" " width="800" height="606"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;DuckDB is a game-changer for local SQL + analytics.&lt;/li&gt;
&lt;li&gt;The Medallion approach keeps data modeling organized.&lt;/li&gt;
&lt;li&gt;Star schemas still matter — they power BI/analytics-friendly datasets.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 Full notebook: GitHub – &lt;a href="https://github.com/Satyam-gupta20/data-engineering-endToend" rel="noopener noreferrer"&gt;data-engineering-end-to-end&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Would love feedback: What tools do you use for building marts — DuckDB, dbt, or something else?&lt;/p&gt;

</description>
      <category>dataengineering</category>
      <category>python</category>
      <category>sql</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Build a Fast URL Shortener with Flask and Redis (Beginner-Friendly 15 minute Tutorial)</title>
      <dc:creator>Satyam Gupta</dc:creator>
      <pubDate>Sun, 22 Jun 2025 07:55:00 +0000</pubDate>
      <link>https://forem.com/satyam_gupta/url-shortener-using-flask-and-redis-1pbo</link>
      <guid>https://forem.com/satyam_gupta/url-shortener-using-flask-and-redis-1pbo</guid>
      <description>&lt;p&gt;&lt;strong&gt;Project Overview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This project implements a basic URL shortening service using Python, the Flask web framework, and Redis as its primary data store. It demonstrates how to build a modular RESTful API that leverages Redis's speed as an in-memory key-value store for efficient URL mapping management and atomic ID generation. This is an excellent project for understanding fundamental backend development, database integration, and the practical application of Redis in a web context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Shorten URL: Accepts a long URL via a POST request and returns a unique, shortened URL.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Redirect: Redirects users from the generated short URL to its original long URL.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fast Lookups: Utilizes Redis for extremely fast storage and retrieval of URL mappings.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unique Code Generation (Custom): Generates unique short codes by atomically incrementing a counter in Redis and converting the resulting ID to a Base62 string.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Modular Design: Organized into separate Python files for application setup, route handling, and business logic (Redis interactions) using Flask Blueprints.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Basic Error Handling: Provides appropriate responses for missing URLs or invalid requests.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Technologies Used&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Python 3.x&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Flask: A lightweight and flexible web framework for building the API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Redis: An open-source, in-memory data structure store used for fast storage of URL mappings and atomic counter operations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;redis-py: The official Python client library for interacting with Redis.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Project Structure&lt;/strong&gt;&lt;br&gt;
This project follows a common Flask application structure to promote modularity and separation of concerns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;url_shortener/
├── app.py                          # Main Flask application entry point, Redis initialization, blueprint registration.
├── routes.py                       # Defines all Flask application routes (e.g., '/', '/shorten', '/&amp;lt;short_code&amp;gt;') within a Blueprint.
├── services.py                     # Contains the core business logic and Redis interaction functions (e.g., generate/store/retrieve URLs).
├── templates/                      # Flask's default directory for HTML templates.
│   └── index.html                  # The simple homepage HTML for 
└── README.md                       # This project documentation.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How It Works&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application Initialization (&lt;code&gt;app.py&lt;/code&gt;):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The create_app() factory function initializes the Flask application instance.&lt;/p&gt;

&lt;p&gt;It establishes the connection to the Redis server by calling &lt;code&gt;services.init_redis()&lt;/code&gt;, ensuring Redis is ready to serve requests.&lt;/p&gt;

&lt;p&gt;It registers the main_bp Blueprint (defined in &lt;code&gt;routes.py&lt;/code&gt;), which integrates all defined routes into the Flask application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;URL Shortening (&lt;code&gt;routes.py&lt;/code&gt; &amp;amp; &lt;code&gt;services.py&lt;/code&gt;):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A client sends a POST request to the /shorten endpoint (handled by a route in &lt;code&gt;routes.py&lt;/code&gt;) with a JSON body containing the &lt;code&gt;long_url&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The route handler performs basic URL validation and then delegates the core logic to &lt;code&gt;services.generate_and_store_url(long_url)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Inside &lt;code&gt;services.py&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;It uses &lt;code&gt;r.incr('next_short_id')&lt;/code&gt; to atomically increment a counter in Redis. This ensures that every generated ID is globally unique, even with concurrent requests, preventing collisions.&lt;/p&gt;

&lt;p&gt;The unique numeric ID is then converted into a compact, alphanumeric Base62 short_code using a custom encoding function.&lt;/p&gt;

&lt;p&gt;Finally, &lt;code&gt;r.set(short_code, long_url)&lt;/code&gt; stores this mapping directly in Redis, with the &lt;code&gt;short_code&lt;/code&gt; as the key and the &lt;code&gt;long_url&lt;/code&gt; as its value.&lt;/p&gt;

&lt;p&gt;The route then constructs the full shortened URL and returns it as a JSON response to the client.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;URL Redirection (&lt;code&gt;routes.py&lt;/code&gt; &amp;amp; &lt;code&gt;services.py&lt;/code&gt;):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When a user accesses a shortened URL (e.g., &lt;code&gt;http://localhost:5000/1&lt;/code&gt;), the &lt;code&gt;short_code&lt;/code&gt; route handler (in &lt;code&gt;routes.py&lt;/code&gt;) extracts the &lt;code&gt;short_code&lt;/code&gt; from the URL path.&lt;/p&gt;

&lt;p&gt;It calls &lt;code&gt;services.get_long_url(short_code)&lt;/code&gt; to retrieve the original long_url from Redis.&lt;/p&gt;

&lt;p&gt;If the long_url is found in Redis, the Flask application performs an HTTP redirect to the original URL.&lt;/p&gt;

&lt;p&gt;If the short_code is not found (meaning it's invalid or never existed), a 404 Not Found error is returned.&lt;/p&gt;

&lt;p&gt;detailed code and step by step implementation can be found on my github here: &lt;a href="https://github.com/Satyam-gupta20/url_shortener_using_redis_flask/tree/main" rel="noopener noreferrer"&gt;URL Shortener&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%2Fnbel7l40mr806qiahrxc.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%2Fnbel7l40mr806qiahrxc.png" alt=" " width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flask</category>
      <category>redis</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>A Beginner’s Guide to Building Your First Serverless Data Pipeline on AWS</title>
      <dc:creator>Satyam Gupta</dc:creator>
      <pubDate>Fri, 20 Jun 2025 20:03:05 +0000</pubDate>
      <link>https://forem.com/satyam_gupta/a-beginners-guide-to-building-your-first-serverless-data-pipeline-on-aw-1cp0</link>
      <guid>https://forem.com/satyam_gupta/a-beginners-guide-to-building-your-first-serverless-data-pipeline-on-aw-1cp0</guid>
      <description>&lt;p&gt;Stepping into the world of cloud computing, especially AWS, can feel daunting with its vast array of services.&lt;br&gt;
This article will walk you through building a simple, cost-effective serverless data ingestion pipeline that fetches real-time weather data and stores it in AWS S3. It's perfect for anyone with basic Python knowledge looking to get their hands dirty with AWS Lambda and S3 on the free tier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Serverless and AWS?&lt;/strong&gt;&lt;br&gt;
Serverless computing, like AWS Lambda, allows you to run code without provisioning or managing servers. You only pay for the compute time you consume, making it incredibly cost-effective and scalable for many use cases. Combining this with AWS S3, a highly durable and scalable object storage service, gives you a powerful foundation for data pipelines, microservices, and more.&lt;/p&gt;

&lt;p&gt;For a beginner, this project is ideal because it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Uses services with generous AWS Free Tier limits.&lt;/li&gt;
&lt;li&gt;Introduces fundamental AWS concepts: Compute (Lambda), Storage (S3), Permissions (IAM), and Automation (EventBridge).&lt;/li&gt;
&lt;li&gt;Leverages Python, a language many data professionals are familiar with.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Project Goal &amp;amp; Architecture&lt;/strong&gt;&lt;br&gt;
Our goal is simple: automatically fetch current weather data for a specific location and store it as a historical record in an AWS S3 bucket.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+----------------+     +-------------------+     +--------------------+
| AWS EventBridge| --&amp;gt; | AWS Lambda        | --&amp;gt; | AWS S3 Bucket      |
| (Scheduled Rule)|     | (Python Function) |     | (Weather Data JSON)|
+----------------+     +-------------------+     +--------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The Core Components&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AWS S3 (Simple Storage Service): Our data lake! This is where all the fetched weather data (as JSON files) will be stored. S3 is designed for 99.999999999% durability, making it extremely reliable.&lt;/li&gt;
&lt;li&gt;AWS IAM (Identity and Access Management): To manage who can do what in our AWS account. We'll create a specific role for our Lambda function, granting it only the necessary permissions (e.g., to write to S3).&lt;/li&gt;
&lt;li&gt;AWS Lambda: The heart of our serverless magic. Our Python code will run here, fetching data, processing it, and pushing it to S3. We don't worry about servers, patching, or scaling; Lambda handles it all.&lt;/li&gt;
&lt;li&gt;Open-Meteo API: Our external data source. This is a free and open-source API that provides weather data without requiring an API key for basic usage.&lt;/li&gt;
&lt;li&gt;AWS EventBridge (formerly CloudWatch Events): This service will act as our scheduler. We'll set up a rule to trigger our Lambda function at regular intervals (e.g., daily).&lt;/li&gt;
&lt;li&gt;AWS CloudWatch: Lambda automatically integrates with CloudWatch for logging and monitoring, which is essential for debugging and observing our function's execution.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do Check out the full project README on my &lt;a href="https://github.com/Satyam-gupta20/aws_serverless_data_weather_fetcher" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Set up Your AWS Account (If you haven't already)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to aws.amazon.com.&lt;/li&gt;
&lt;li&gt;Click "Create an AWS Account" and follow the instructions. You will need a credit card, but you won't be charged for free-tier usage.
Important: Note down your AWS Account ID.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Create an S3 Bucket (Storage)&lt;/strong&gt;&lt;br&gt;
This is where your weather data files will be stored.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log in to the AWS Management Console.&lt;/li&gt;
&lt;li&gt;Search for "S3" in the search bar at the top and click on "S3".
Click "Create bucket".&lt;/li&gt;
&lt;/ol&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%2F99f49ypxl0ki2cyg05qy.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%2F99f49ypxl0ki2cyg05qy.png" alt=" " width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bucket name: Choose a unique, globally unique name (e.g., yourname-weather-data-bucket).
&lt;strong&gt;Rule:&lt;/strong&gt; Bucket names must be lowercase, no spaces, and unique across all of AWS.&lt;/li&gt;
&lt;li&gt;AWS Region: Choose a region close to you (e.g., us-east-1 (N. Virginia), eu-west-1 (Ireland)). This impacts latency and some pricing, but usually stays within free tier for small usage.&lt;/li&gt;
&lt;li&gt;Object Ownership: Keep the default "ACLs disabled (recommended)".&lt;/li&gt;
&lt;li&gt;Block Public Access settings for this bucket: Keep "Block all public access" checked. This is crucial for security. Your Lambda function will access it, not the public internet.&lt;/li&gt;
&lt;li&gt;Leave other settings as default for now.&lt;/li&gt;
&lt;li&gt;Click "Create bucket".&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%2Fltq67gc6i6xakxcqsdvs.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%2Fltq67gc6i6xakxcqsdvs.png" alt=" " width="800" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Create an IAM Role for Lambda (Permissions)&lt;/strong&gt;&lt;br&gt;
Your Lambda function needs permission to interact with other AWS services (like S3 for putting objects and CloudWatch for logging).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the AWS Management Console, search for "IAM" and click on "IAM".&lt;/li&gt;
&lt;li&gt;In the left navigation pane, click "Roles".&lt;/li&gt;
&lt;li&gt;Click "Create role".&lt;/li&gt;
&lt;li&gt;Trusted entity type: Select "AWS service".&lt;/li&gt;
&lt;li&gt;Use case: Select "Lambda" from the list. Click "Next".&lt;/li&gt;
&lt;li&gt;Permissions policies:&lt;/li&gt;
&lt;li&gt;Search for &lt;strong&gt;AWSLambdaBasicExecutionRole&lt;/strong&gt; and select it. This grants permission to write logs to CloudWatch.&lt;/li&gt;
&lt;li&gt;Search for &lt;strong&gt;AmazonS3FullAccess&lt;/strong&gt; and select it. This grants permission to put objects into S3. &lt;/li&gt;
&lt;li&gt;Click "Next".&lt;/li&gt;
&lt;li&gt;Role name: Give it a descriptive name, e.g., lambda-weather-s3-role.&lt;/li&gt;
&lt;li&gt;Leave other settings as default.&lt;/li&gt;
&lt;li&gt;Click "Create role".&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Create Your Lambda Function (Compute)&lt;/strong&gt;&lt;br&gt;
This will host your Python code.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the AWS Management Console, search for "Lambda" and click on "Lambda".&lt;/li&gt;
&lt;li&gt;Click "Create function".&lt;/li&gt;
&lt;li&gt;Author from scratch is usually the best option for custom code.&lt;/li&gt;
&lt;li&gt;Function name: e.g., WeatherDataFetcher&lt;/li&gt;
&lt;li&gt;Runtime: Choose Python 3.10 (or the latest Python 3.x available).&lt;/li&gt;
&lt;li&gt;Architecture: x86_64 (default).&lt;/li&gt;
&lt;li&gt;Permissions:&lt;/li&gt;
&lt;li&gt;Under "Change default execution role", select "Use an existing role".&lt;/li&gt;
&lt;li&gt;Choose the IAM role you just created: lambda-weather-s3-role.&lt;/li&gt;
&lt;li&gt;Click "Create function".&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Write Lambda Python Code and Configure Environment&lt;/strong&gt;&lt;br&gt;
Now you'll add your Python code to the Lambda function.&lt;/p&gt;

&lt;p&gt;Once your Lambda function is created, you'll be on its configuration page. Scroll down to the "Code source" section.&lt;/p&gt;

&lt;p&gt;You'll see a default lambda_function.py file. Replace its content with the following Python code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import json
import os
import datetime
import logging
import urllib.request

# Set up logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)

import boto3
s3 = boto3.client('s3')

# Configuration (make sure these are set in the Lambda environment variables)
S3_BUCKET_NAME = os.environ.get('S3_BUCKET_NAME')
CITY_LATITUDE = os.environ.get('CITY_LATITUDE')
CITY_LONGITUDE = os.environ.get('CITY_LONGITUDE')

WEATHER_API_URL = "https://api.open-meteo.com/v1/forecast"

def lambda_handler(event, context):
    logger.info(f"Lambda function triggered at {datetime.datetime.now()}")

    if not S3_BUCKET_NAME or not CITY_LATITUDE or not CITY_LONGITUDE:
        logger.error("Missing environment variables: S3_BUCKET_NAME, CITY_LATITUDE, or CITY_LONGITUDE.")
        return {
            'statusCode': 500,
            'body': json.dumps('Configuration error: Missing environment variables.')
        }

    try:
        # Build API URL with parameters
        params = (
            f"latitude={CITY_LATITUDE}&amp;amp;longitude={CITY_LONGITUDE}"
            "&amp;amp;current_weather=true"
            "&amp;amp;temperature_unit=fahrenheit"
            "&amp;amp;windspeed_unit=mph"
            "&amp;amp;timezone=auto"
        )
        full_url = f"{WEATHER_API_URL}?{params}"
        logger.info(f"Fetching weather data from: {full_url}")

        with urllib.request.urlopen(full_url) as response:
            weather_data = json.loads(response.read().decode())

        logger.info(f"Weather data: {weather_data}")

        current_weather = weather_data.get('current_weather', {})
        logger.info(f"Current weather: {current_weather}")

        # Parse timestamp safely
        time_value = current_weather.get('time')

        if time_value:
            try:
                # Open-Meteo returns ISO8601 string like "2025-06-20T18:30"
                timestamp = datetime.datetime.fromisoformat(time_value).isoformat()
            except ValueError:
                # If format isn't ISO, assume UNIX timestamp
                timestamp = datetime.datetime.fromtimestamp(float(time_value)).isoformat()
        else:
            timestamp = datetime.datetime.now().isoformat()

        formatted_data = {
            "timestamp": timestamp,
            "latitude": CITY_LATITUDE,
            "longitude": CITY_LONGITUDE,
            "temperature": current_weather.get('temperature'),
            "windspeed": current_weather.get('windspeed'),
            "winddirection": current_weather.get('winddirection'),
            "weathercode": current_weather.get('weathercode'),
            "is_day": current_weather.get('is_day'),
            "source_api": "Open-Meteo"
        }

        current_utc_time = datetime.datetime.utcnow()
        s3_key_prefix = current_utc_time.strftime("data/%Y/%m/%d/")
        s3_file_name = current_utc_time.strftime("weather_%Y-%m-%d-%H-%M-%S.json")
        s3_object_key = s3_key_prefix + s3_file_name
        logger.info(f"Uploading data to S3 key: {s3_object_key}")

        s3.put_object(
            Bucket=S3_BUCKET_NAME,
            Key=s3_object_key,
            Body=json.dumps(formatted_data, indent=2),
            ContentType='application/json'
        )
        logger.info(f"Successfully uploaded to s3://{S3_BUCKET_NAME}/{s3_object_key}")

        return {
            'statusCode': 200,
            'body': json.dumps(f'Weather data saved to S3 bucket {S3_BUCKET_NAME} as {s3_object_key}!')
        }

    except Exception as e:
        logger.error(f"Error occurred: {e}")
        return {
            'statusCode': 500,
            'body': json.dumps(f'An error occurred: {e}')
        }

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Deploy the code: After pasting the code, click the "Deploy" button at the top right of the "Code source" section.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure Environment Variables:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Below the "Code source" section, click on the "Configuration" tab.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the left sidebar, click "Environment variables".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click "Edit" and then "Add environment variable".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add the following three variables:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
Key: S3_BUCKET_NAME, Value: yourname-weather-data-bucket(your actual S3 bucket name)&lt;br&gt;
Key: CITY_LATITUDE, Value: YOUR_CITY_LATITUDE (e.g., 28.61 for New Delhi)&lt;br&gt;
Key: CITY_LONGITUDE, Value: YOUR_CITY_LONGITUDE (e.g., 77.20 for New Delhi)&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click "Save".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Adjust Basic Settings (Memory &amp;amp; Timeout):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Still under the "Configuration" tab, click "General configuration".&lt;/li&gt;
&lt;li&gt;Click "Edit".&lt;/li&gt;
&lt;li&gt;Memory: Keep it at 128 MB (default, lowest cost).&lt;/li&gt;
&lt;li&gt;Timeout: Increase it slightly to 30 seconds (or 1 minute) to allow enough time for API calls and S3 uploads.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Click "Save".&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Test Your Lambda Function&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;On your Lambda function page, click the "Test" tab (or "Test" button near the top right).&lt;/li&gt;
&lt;li&gt;Click the "Create new event" dropdown.&lt;/li&gt;
&lt;li&gt;Event name: test-invoke&lt;/li&gt;
&lt;li&gt;Event template: "hello-world" (the content of the JSON doesn't matter for this function as it doesn't use the event payload).&lt;/li&gt;
&lt;li&gt;Click "Save".&lt;/li&gt;
&lt;li&gt;Click the "Test" button.&lt;/li&gt;
&lt;/ol&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%2F9j4xviu4m5zk5oxql364.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%2F9j4xviu4m5zk5oxql364.png" alt=" " width="800" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You should see "Execution results" indicating Status: Succeeded.&lt;br&gt;
Check the "Log output" for messages from logger.info() which will confirm the API call and S3 upload.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verify in S3: Go back to your S3 bucket in the AWS console. You should see a new folder data/ and inside it, subfolders for the current year/month/day, containing a new JSON file (e.g., weather_YYYY-MM-DD-HH-MM-SS.json).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 7: Configure a Trigger (EventBridge Schedule)&lt;/strong&gt;&lt;br&gt;
This makes your function run automatically.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;On your Lambda function page, click the "Configuration" tab.&lt;/li&gt;
&lt;li&gt;In the left sidebar, click "Triggers".&lt;/li&gt;
&lt;li&gt;Click "Add trigger".&lt;/li&gt;
&lt;li&gt;Select a source: Choose "EventBridge (CloudWatch Events)".&lt;/li&gt;
&lt;li&gt;Rule: "Create a new rule".&lt;/li&gt;
&lt;li&gt;Rule name: e.g., daily-weather-fetcher&lt;/li&gt;
&lt;li&gt;Rule type: "Schedule expression".&lt;/li&gt;
&lt;li&gt;Schedule expression: cron(0 0 * * ? *) (This will run the function once every 24 hours at midnight UTC).
Tip: You can use rate(1 day) for daily, or cron(0 12 ? * MON-FRI *) for 12 PM UTC, Monday-Friday. Be mindful of frequency to stay within free tier! For testing, you could use rate(5 minutes) but change it back after testing.&lt;/li&gt;
&lt;li&gt;Leave other settings as default.&lt;/li&gt;
&lt;li&gt;Click "Add".
Your Lambda function will now automatically run according to your schedule, fetching and storing weather data daily!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 8: Clean Up Your AWS Resources (Crucial for Free Tier)&lt;/strong&gt;&lt;br&gt;
Always remember to clean up resources after your learning project to avoid unexpected charges, especially if you step outside the free tier. EventBridge rule, Lambda function, S3 bucket (after emptying its contents), and the IAM role.&lt;/p&gt;

&lt;p&gt;I hope this article provides a clear guide and inspires others to get hands-on with AWS. The cloud journey is full of exciting possibilities!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>lambda</category>
      <category>s3</category>
      <category>cloud</category>
    </item>
    <item>
      <title>What is Caching</title>
      <dc:creator>Satyam Gupta</dc:creator>
      <pubDate>Thu, 19 Jun 2025 07:11:52 +0000</pubDate>
      <link>https://forem.com/satyam_gupta/what-is-caching-1ecg</link>
      <guid>https://forem.com/satyam_gupta/what-is-caching-1ecg</guid>
      <description>&lt;p&gt;Caching is a fundamental technique in computing that aims to improve performance by storing frequently accessed data in a faster, more accessible location. Think of it like having a small, super-fast notepad next to your main, much larger bookshelf. When you need a book, you first check your notepad. If it's there, great, you grab it instantly. If not, you go to the bookshelf, find the book, and then also write down its name on your notepad for next time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Core Idea: Speeding Up Access&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Accessing data from its original source (e.g., a database, a remote server, a hard drive) can be slow.&lt;br&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; Store copies of this data in a "cache" – a temporary storage area that is faster to access.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Concepts:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cache Hit: When the requested data is found in the cache. This is the desired outcome, as it means fast access.&lt;/li&gt;
&lt;li&gt;Cache Miss: When the requested data is not found in the cache. In this case, the system has to go to the original (slower) source to retrieve the data. Once retrieved, the data is often then added to the cache for future requests.&lt;/li&gt;
&lt;li&gt;Cache Eviction Policy: What happens when the cache is full and new data needs to be added? An eviction policy determines which existing data to remove to make space. Common policies include:&lt;/li&gt;
&lt;li&gt;LRU (Least Recently Used): Discard the item that hasn't been accessed for the longest time.&lt;/li&gt;
&lt;li&gt;LFU (Least Frequently Used): Discard the item that has been accessed the fewest times.&lt;/li&gt;
&lt;li&gt;FIFO (First-In, First-Out): Discard the oldest item in the cache.&lt;/li&gt;
&lt;li&gt;MRU (Most Recently Used): Discard the item that was accessed most recently. (Less common for general caching, sometimes used in specific scenarios).&lt;/li&gt;
&lt;li&gt;Cache Invalidation: How do you ensure the data in the cache is up-to-date with the original source? This is a critical and often complex aspect. If the original data changes, the cached copy becomes "stale" and needs to be updated or removed. Invalidation strategies include:
a. &lt;em&gt;Time-based expiration:&lt;/em&gt; Data expires after a certain period.
b. &lt;em&gt;Event-driven invalidation:&lt;/em&gt; When the original data changes, a notification is sent to invalidate the cache entry.
c. &lt;em&gt;Manual invalidation:&lt;/em&gt; Explicitly removing data from the cache.
Cache Coherence: In distributed systems, ensuring all caches have a consistent view of the data. This is a very challenging problem.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Where is Caching Used?&lt;/strong&gt;&lt;br&gt;
Caching is ubiquitous in computing, from hardware to software:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CPU Caches (L1, L2, L3): Small, extremely fast caches built directly into the CPU to store frequently used instructions and data.&lt;/li&gt;
&lt;li&gt;Web Browsers: Your browser caches static assets (images, CSS, JavaScript) from websites you visit to speed up subsequent visits.
DNS Caching: Your operating system and local DNS servers cache IP address lookups to resolve domain names faster.&lt;/li&gt;
&lt;li&gt;Content Delivery Networks (CDNs): Geographically distributed servers that cache content (images, videos, web pages) closer to users, reducing latency.&lt;/li&gt;
&lt;li&gt;Database Caching: Caching query results or frequently accessed data in memory to reduce the load on the database server. Examples include Redis, Memcached.&lt;/li&gt;
&lt;li&gt;Application-Level Caching: Developers implement caching within their applications to store computed results or frequently accessed data.&lt;/li&gt;
&lt;li&gt;Operating System Caches: Disk caches, file system caches, etc., to speed up file access.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Benefits of Caching:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Improved Performance/Speed: Faster data retrieval, leading to a more responsive user experience.&lt;/li&gt;
&lt;li&gt;Reduced Latency: Less time waiting for data from slow sources.&lt;/li&gt;
&lt;li&gt;Reduced Load on Backend Systems: By serving requests from the cache, the original data source (e.g., database, API) is hit less often, reducing its workload.&lt;/li&gt;
&lt;li&gt;Cost Savings: Fewer requests to backend systems can lead to lower infrastructure costs (e.g., database queries, bandwidth).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Challenges of Caching&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cache Invalidation: The biggest challenge. Ensuring cached data is fresh and consistent with the source. &lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;"There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors." &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Phil Karlton&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;Cache Coherence: In distributed systems, maintaining consistency across multiple caches.&lt;/li&gt;
&lt;li&gt;Cache Miss Penalties: If the cache hit rate is low, the overhead of checking the cache plus going to the original source can sometimes be slower than just going to the original source directly.&lt;/li&gt;
&lt;li&gt;Memory Usage: Caches consume memory, which needs to be managed efficiently.&lt;/li&gt;
&lt;li&gt;Complexity: Implementing robust caching can add complexity to system design.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;When to Use Caching:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When data is accessed frequently.&lt;/li&gt;
&lt;li&gt;When the data changes infrequently.&lt;/li&gt;
&lt;li&gt;When the cost of retrieving data from the original source is high (e.g., slow network, expensive computation).&lt;/li&gt;
&lt;li&gt;When you need to reduce load on backend systems.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;When Not to Use Caching:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When data is constantly changing (high churn).&lt;/li&gt;
&lt;li&gt;When the data is rarely accessed.&lt;/li&gt;
&lt;li&gt;When the overhead of caching (memory, invalidation logic) outweighs the benefits.&lt;/li&gt;
&lt;li&gt;When strict real-time consistency is paramount and simple caching mechanisms can't guarantee it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In essence, caching is a trade-off: you gain speed and efficiency by sacrificing some degree of real-time consistency and adding a layer of complexity. Understanding these trade-offs is crucial for effective system design.&lt;/p&gt;

</description>
      <category>redis</category>
      <category>computerscience</category>
      <category>programming</category>
      <category>learning</category>
    </item>
    <item>
      <title>Activation Functions in Neural Networks — The Real MVPs of Deep Learning</title>
      <dc:creator>Satyam Gupta</dc:creator>
      <pubDate>Thu, 29 May 2025 18:39:36 +0000</pubDate>
      <link>https://forem.com/satyam_gupta/activation-functions-in-neural-networks-the-real-mvps-of-deep-learning-26g6</link>
      <guid>https://forem.com/satyam_gupta/activation-functions-in-neural-networks-the-real-mvps-of-deep-learning-26g6</guid>
      <description>&lt;p&gt;If you've ever dipped your toes into the world of neural networks, you’ve probably heard about &lt;em&gt;activation functions&lt;/em&gt;. At first glance, they sound like some secret weapon only AI wizards know about. But once you understand what they are and why they matter, it all clicks.&lt;/p&gt;

&lt;p&gt;Let me break it down in a way that feels less like a math textbook and more like a conversation over coffee.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is an Activation Function?
&lt;/h2&gt;

&lt;p&gt;Imagine you’re building a neural network. You pass in some inputs (like pixel values from an image), multiply them by some weights, add a bias, and boom — you get a number.&lt;/p&gt;

&lt;p&gt;But then what?&lt;/p&gt;

&lt;p&gt;That’s where activation functions come in. They act like &lt;em&gt;gatekeepers&lt;/em&gt; or &lt;em&gt;decision-makers&lt;/em&gt; for each neuron. Once your neuron computes a value, the activation function decides whether it should "fire" or not — and by how much.&lt;/p&gt;

&lt;p&gt;Without this decision-making layer, your entire neural network would just be a glorified linear equation. And that means it wouldn’t be able to understand complex things like recognizing faces, translating languages, or even recommending you cat videos.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Do We Need Them?
&lt;/h2&gt;

&lt;p&gt;In a nutshell:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They bring &lt;strong&gt;non-linearity&lt;/strong&gt; to the model.&lt;/li&gt;
&lt;li&gt;They help the network learn &lt;strong&gt;complex patterns&lt;/strong&gt; in data.&lt;/li&gt;
&lt;li&gt;They allow &lt;strong&gt;backpropagation&lt;/strong&gt; by being differentiable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of it like this: If you’re trying to model something complex like "is this a dog or a cat?", you need a network that can think in &lt;strong&gt;curves&lt;/strong&gt;, not straight lines.&lt;/p&gt;




&lt;p&gt;Common Activation Functions&lt;/p&gt;

&lt;p&gt;Let’s take a tour of the most popular ones, minus the jargon:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Sigmoid (𝜎)&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;^-&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Range: (0, 1)&lt;/p&gt;

&lt;p&gt;Good for: Binary classification (e.g., yes/no problems)&lt;/p&gt;

&lt;p&gt;Analogy: Like turning a dimmer switch between 0 and 1.&lt;/p&gt;

&lt;p&gt;Downside: Can lead to the vanishing gradient problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;ReLU (Rectified Linear Unit)&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Range: [0, ∞)&lt;/p&gt;

&lt;p&gt;Default choice for most hidden layers.&lt;/p&gt;

&lt;p&gt;Fast, simple, and introduces non-linearity beautifully.&lt;/p&gt;

&lt;p&gt;Problem: Sometimes neurons "die" and only output 0.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;Softmax&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Used only in the output layer for multi-class classification problems.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;softmax&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x_i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x_i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x_j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nb"&gt;all&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example: If you're building a model to detect if an image is a cat, dog, or rabbit — softmax gives you something like:&lt;/p&gt;

&lt;p&gt;Cat: 0.7&lt;/p&gt;

&lt;p&gt;Dog: 0.2&lt;/p&gt;

&lt;p&gt;Rabbit: 0.1&lt;/p&gt;




&lt;h2&gt;
  
  
  Choosing the right activation function?
&lt;/h2&gt;

&lt;p&gt;Here’s a cheat sheet I wish someone gave me earlier:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer Type&lt;/th&gt;
&lt;th&gt;Recommended Activation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hidden Layers&lt;/td&gt;
&lt;td&gt;ReLU or Leaky ReLU&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output (Binary)&lt;/td&gt;
&lt;td&gt;Sigmoid&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output (Multi-class)&lt;/td&gt;
&lt;td&gt;Softmax&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>machinelearning</category>
      <category>tensorflow</category>
      <category>ai</category>
      <category>programming</category>
    </item>
    <item>
      <title>Machine Learning: A Quick Intro to different types of ML</title>
      <dc:creator>Satyam Gupta</dc:creator>
      <pubDate>Wed, 07 May 2025 06:59:31 +0000</pubDate>
      <link>https://forem.com/satyam_gupta/machine-learning-a-quick-intro-to-different-types-of-ml-5gme</link>
      <guid>https://forem.com/satyam_gupta/machine-learning-a-quick-intro-to-different-types-of-ml-5gme</guid>
      <description>&lt;p&gt;Machine learning is everywhere these days—from the recommendations on Netflix to self-driving cars cruising down the streets. But if you’ve ever tried to dive deeper, you’ve probably come across terms like supervised, unsupervised, and reinforcement learning. It can get overwhelming, especially if you're just starting out.&lt;/p&gt;

&lt;p&gt;Let’s break it down in simple terms, without the jargon overload, so you can actually understand what these types of machine learning are all about.&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%2F6baqf9dkymf00c3sajj8.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%2F6baqf9dkymf00c3sajj8.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Supervised Learning: Learning with a Teacher&lt;/strong&gt;&lt;br&gt;
Imagine you’re learning math in school. Your teacher gives you a bunch of problems and the answers. Over time, you start figuring out patterns—"Oh, whenever I see this kind of equation, I should solve it this way." That’s exactly what supervised learning is like.&lt;/p&gt;

&lt;p&gt;In supervised learning, the machine is given input data and the correct output (the “label”). It learns from these examples so that, later, when it sees new data, it can predict the right answer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common uses:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Spam detection in emails&lt;/li&gt;
&lt;li&gt;Predicting house prices&lt;/li&gt;
&lt;li&gt;Recognizing handwritten digits&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Example algorithms:&lt;/strong&gt; Linear regression, decision trees, random forests, support vector machines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Unsupervised Learning: Figuring it Out Alone&lt;/strong&gt;&lt;br&gt;
Now, imagine you’re handed a bunch of puzzles, but no one tells you what the final picture should look like. You have to sort things out on your own—group similar pieces together, notice patterns, and maybe discover some hidden structure.&lt;/p&gt;

&lt;p&gt;That’s unsupervised learning in a nutshell. The machine is only given data—no answers, no labels. Its job is to find patterns or groups within the data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common uses:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Customer segmentation (grouping customers based on buying behavior)&lt;/li&gt;
&lt;li&gt;Market basket analysis (what products are bought together)&lt;/li&gt;
&lt;li&gt;Anomaly detection (spotting unusual activity in bank transactions)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Example algorithms&lt;/strong&gt;: K-means clustering, hierarchical clustering, principal component analysis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Reinforcement Learning: Learning by Trial and Error&lt;/strong&gt;&lt;br&gt;
Picture a child learning to ride a bike. At first, they fall a lot. But every time they manage to stay balanced a little longer, they get excited and try again. Over time, they figure out how to keep going without falling. That’s the spirit of reinforcement learning.&lt;/p&gt;

&lt;p&gt;In this type of learning, an agent (the learner) interacts with an environment. It takes actions, gets rewards or penalties, and uses that feedback to improve over time. The goal? Maximize the reward.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common uses:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Training AI to play video games&lt;/li&gt;
&lt;li&gt;Robotics (teaching robots to walk or grasp objects)&lt;/li&gt;
&lt;li&gt;Dynamic pricing models&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Example algorithms:&lt;/strong&gt; Q-learning, Deep Q Networks (DQNs), Policy gradients.&lt;/p&gt;

&lt;p&gt;✨ &lt;strong&gt;Wrapping It Up&lt;/strong&gt;&lt;br&gt;
At its core, machine learning is about enabling computers to learn patterns from data. The different types—supervised, unsupervised, reinforcement—just describe how they’re learning.&lt;/p&gt;

&lt;p&gt;Each type has its strengths and is suited for different problems. Knowing which one to use is like picking the right tool for the job. And as machine learning continues to evolve, hybrid approaches and new techniques are being developed every day.&lt;/p&gt;

&lt;p&gt;Whether you’re a curious beginner or someone considering a career in AI, understanding these basics is the perfect first step.&lt;/p&gt;

&lt;p&gt;So next time you hear “machine learning,” you won’t just nod along—you’ll actually get it!&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
      <category>cloudcomputing</category>
    </item>
    <item>
      <title>AWS S3 Storage Classes Explained: Choosing the Right One</title>
      <dc:creator>Satyam Gupta</dc:creator>
      <pubDate>Sat, 26 Apr 2025 19:16:57 +0000</pubDate>
      <link>https://forem.com/satyam_gupta/aws-s3-storage-classes-explained-choosing-the-right-one-55</link>
      <guid>https://forem.com/satyam_gupta/aws-s3-storage-classes-explained-choosing-the-right-one-55</guid>
      <description>&lt;p&gt;Did you know that &lt;a href="https://docs.aws.amazon.com/s3/" rel="noopener noreferrer"&gt;AWS S3&lt;/a&gt; offers &lt;strong&gt;8 major storage classes&lt;/strong&gt;, each optimized for different use cases? Choosing the right one can save you thousands in cloud costs! In this article, we'll break down S3 storage classes and help you pick the best one for your needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Amazon S3?
&lt;/h2&gt;

&lt;p&gt;Amazon S3 (Simple Storage Service) is a highly scalable object storage service that enables you to store and retrieve data from anywhere on the web. Unlike block storage, S3 uses a &lt;strong&gt;flat structure&lt;/strong&gt;, meaning if you modify even a single character in a 1GB file, the entire file must be updated.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Key Features of S3:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Object Storage&lt;/strong&gt;: Data is stored as objects in a flat structure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Buckets&lt;/strong&gt;: Objects are stored in &lt;strong&gt;buckets&lt;/strong&gt;—logical containers where you define a region and a unique name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Automatically scales to accommodate vast amounts of data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;AWS S3 Storage Classes &amp;amp; Their Use Cases&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;AWS offers multiple storage classes to balance cost, performance, and durability. Here’s a breakdown:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Storage Class&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Best For&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Retrieval Time&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Cost&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;S3 Standard&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Frequently accessed data&lt;/td&gt;
&lt;td&gt;Milliseconds&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;S3 Intelligent-Tiering&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data with unpredictable access patterns&lt;/td&gt;
&lt;td&gt;Milliseconds&lt;/td&gt;
&lt;td&gt;Medium (monitoring &amp;amp; automation fees apply)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;S3 Standard-IA&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Infrequently accessed, needs quick retrieval&lt;/td&gt;
&lt;td&gt;Milliseconds&lt;/td&gt;
&lt;td&gt;Lower than Standard; 30-day minimum storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;S3 One Zone-IA&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Infrequent access (Single AZ)&lt;/td&gt;
&lt;td&gt;Milliseconds&lt;/td&gt;
&lt;td&gt;Lower than Standard-IA; 30-day minimum&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;S3 Glacier Instant Retrieval&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Archival data needing fast access&lt;/td&gt;
&lt;td&gt;Milliseconds&lt;/td&gt;
&lt;td&gt;Low; 90-day minimum storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;S3 Glacier Flexible Retrieval&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Archive with flexible retrieval time&lt;/td&gt;
&lt;td&gt;Expedited: 1-5 min&lt;br&gt;Standard: 3-5 hrs&lt;br&gt;Bulk: 5-12 hrs&lt;/td&gt;
&lt;td&gt;Lower than Instant Retrieval; 90-day minimum&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;S3 Glacier Deep Archive&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Long-term archival (rarely accessed)&lt;/td&gt;
&lt;td&gt;Standard: 12 hrs&lt;br&gt;Bulk: 48 hrs&lt;/td&gt;
&lt;td&gt;Lowest; 180-day minimum storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;S3 Express One Zone&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;High-performance AI/ML applications&lt;/td&gt;
&lt;td&gt;Milliseconds&lt;/td&gt;
&lt;td&gt;Medium; Single AZ storage&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;(source: &lt;a href="https://aws.amazon.com/s3/storage-classes/" rel="noopener noreferrer"&gt;AWS S3 Documentation&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Deep Dive into Each Storage Class&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Standard (General Purpose)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Best for &lt;strong&gt;frequently accessed data&lt;/strong&gt; (e.g., cloud apps, websites, gaming, and big data analytics).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;High availability&lt;/strong&gt; and &lt;strong&gt;low-latency retrieval&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. Intelligent-Tiering&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Automatically moves data between two tiers: &lt;strong&gt;frequent&lt;/strong&gt; and &lt;strong&gt;infrequent access&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Ideal when access patterns are unpredictable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3. Standard-IA (Infrequent Access)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;For data that’s &lt;strong&gt;accessed less often but needs rapid retrieval&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Lower storage cost than Standard, but &lt;strong&gt;higher retrieval cost&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Suitable for &lt;strong&gt;backups, disaster recovery, and long-term data storage&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;4. One Zone-IA&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Like Standard-IA but stores data in &lt;strong&gt;a single Availability Zone&lt;/strong&gt; (AZ), reducing costs by ~20%.&lt;/li&gt;
&lt;li&gt;Best for &lt;strong&gt;non-critical data where high availability isn’t required&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;5. Glacier Instant Retrieval&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Low-cost archival storage&lt;/strong&gt; with &lt;strong&gt;millisecond retrieval times&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Good for long-term storage of data that’s &lt;strong&gt;rarely accessed&lt;/strong&gt; but still needs fast retrieval.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;6. Glacier Flexible Retrieval&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Designed for &lt;strong&gt;data accessed 1-2 times per year&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lower retrieval cost&lt;/strong&gt; than Glacier Instant Retrieval, but &lt;strong&gt;retrieval times vary from minutes to hours&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;7. Glacier Deep Archive&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lowest-cost storage class&lt;/strong&gt; for &lt;strong&gt;long-term retention&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Ideal for &lt;strong&gt;compliance and regulatory archives&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retrieval time: Hours&lt;/strong&gt; (best for data you rarely need to access).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;8. S3 Express One Zone&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Amazon’s newest storage class, optimized for fast, low-latency workloads that don’t require high availability across multiple regions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Retrieval time:  Faster than Standard S3 due to its single-zone architecture&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Choosing the right &lt;a href="https://aws.amazon.com/" rel="noopener noreferrer"&gt;AWS&lt;/a&gt; S3 storage class depends on &lt;strong&gt;how frequently you access your data&lt;/strong&gt; and &lt;strong&gt;your cost constraints&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Which S3 storage class do you use the most? Let me know in the comments!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>programming</category>
      <category>cloudcomputing</category>
      <category>cloudstorage</category>
    </item>
  </channel>
</rss>
