<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shweta Vishwakarma on Medium]]></title>
        <description><![CDATA[Stories by Shweta Vishwakarma on Medium]]></description>
        <link>https://medium.com/@3101.shweta?source=rss-160473da91c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7DCEqDle9BRrvR2Y6joBeA.jpeg</url>
            <title>Stories by Shweta Vishwakarma on Medium</title>
            <link>https://medium.com/@3101.shweta?source=rss-160473da91c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 18:12:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@3101.shweta/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Spark Execution Flow Explained: Jobs, Stages, Tasks & DAG]]></title>
            <link>https://medium.com/@3101.shweta/spark-execution-flow-explained-jobs-stages-tasks-dag-91b937465ad0?source=rss-160473da91c------2</link>
            <guid isPermaLink="false">https://medium.com/p/91b937465ad0</guid>
            <category><![CDATA[data-engineer]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[pyspark]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Shweta Vishwakarma]]></dc:creator>
            <pubDate>Thu, 18 Dec 2025 12:03:10 GMT</pubDate>
            <atom:updated>2025-12-18T12:03:10.399Z</atom:updated>
            <content:encoded><![CDATA[<p>Apache Spark is often celebrated for its speed and scalability, but what really makes it efficient is the way it executes code behind the scenes. Understanding Spark’s execution model helps you write better, faster, and more optimized data pipelines.</p><p>In this post — we’ll break down how a Spark application is executed across a cluster, one step at a time.</p><h3>🧠 Why Understand the Execution Flow?</h3><p>Whether you’re a data engineer building ETL jobs or a data scientist tuning performance, grasping Spark’s internal execution flow can help you:</p><ul><li>Optimize queries and reduce execution time</li><li>Debug performance issues effectively</li><li>Avoid common pitfalls with joins, shuffling, and caching</li><li>Leverage the Spark UI for insights</li></ul><h3>High-Level Spark Execution Flow</h3><p>Here’s what happens when you run a Spark application:</p><ol><li><strong>SparkContext is initialized</strong></li><li><strong>User code is converted into a Directed Acyclic Graph (DAG)</strong></li><li><strong>DAG is divided into stages</strong></li><li><strong>Each stage is broken into tasks</strong></li><li><strong>Tasks are distributed to executors</strong></li><li><strong>Results are collected back by the driver</strong></li></ol><p>Let’s break each of these down 👇</p><h3>1️. The Driver Program &amp; SparkContext</h3><p>Every Spark application begins with a <strong>Driver Program</strong>, which contains the user-defined logic (transformations and actions).</p><p>The driver:</p><ul><li>Creates a <strong>SparkContext</strong> (the main entry point)</li><li>Connects to the <strong>Cluster Manager</strong> (YARN, Kubernetes, Standalone)</li><li>Allocates <strong>executors</strong> for the job</li><li>Converts user code into an execution plan</li></ul><h3>2️. Building the DAG (Directed Acyclic Graph)</h3><p>When you define a series of transformations like .map(), .filter(), .groupBy(), etc., Spark doesn’t execute them immediately. Instead, it builds a <strong>DAG</strong>—a graph of all operations where:</p><ul><li>Nodes = RDDs or DataFrames</li><li>Edges = Transformations (narrow or wide)</li></ul><p>👉 Only when an <strong>action</strong> (like .collect() or .save()) is called, Spark triggers execution.</p><h3>3️. Stages: Breaking the DAG</h3><p>The DAG is split into <strong>stages</strong> based on data shuffling boundaries:</p><ul><li><strong>Narrow dependency</strong> = Same stage<br> <em>(e.g., map, filter)</em></li><li><strong>Wide dependency</strong> = New stage<br> <em>(e.g., groupBy, join, reduceByKey)</em></li></ul><p>Each stage contains a set of tasks that can be executed in parallel.</p><h3>4️. Tasks: The Atomic Unit of Work</h3><p>A <strong>task</strong> is a single operation on a <strong>partition</strong> of data.</p><p>Example:</p><ul><li>If you have a DataFrame with 8 partitions, and you’re performing a .map(), Spark will create 8 tasks for that transformation.</li></ul><p>Tasks are scheduled by the <strong>Task Scheduler</strong> and sent to the appropriate <strong>executors</strong>.</p><h3>5️. Executors: Doing the Heavy Lifting</h3><p>Executors are distributed JVM processes responsible for:</p><ul><li>Executing tasks</li><li>Caching intermediate data (if needed)</li><li>Reporting results back to the driver</li></ul><p>They are allocated per application and remain alive throughout its lifecycle.</p><h3>6️. Final Result: Aggregation &amp; Collection</h3><p>Once all tasks finish:</p><ul><li>Results (or final transformations) are gathered by the <strong>Driver</strong></li><li>The action returns a value, saves to disk, or writes to a target system</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91b937465ad0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Spark Architecture: How It Works Under the Hood]]></title>
            <link>https://medium.com/@3101.shweta/apache-spark-architecture-how-it-works-under-the-hood-e6d16222c7d0?source=rss-160473da91c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6d16222c7d0</guid>
            <dc:creator><![CDATA[Shweta Vishwakarma]]></dc:creator>
            <pubDate>Thu, 18 Dec 2025 11:57:30 GMT</pubDate>
            <atom:updated>2025-12-18T12:04:01.843Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Overview</strong></h3><p>Apache Spark has gained massive popularity for processing large-scale data efficiently. But what makes it truly powerful is its <strong>robust and flexible architecture</strong> — designed to support distributed computing, in-memory processing, and modular workloads.</p><p>In this blog (part of our ongoing Spark series), we’ll explore the <strong>internal architecture of Apache Spark</strong>, covering its key components, how they interact, and why it matters for performance.</p><h3>The Big Picture: Spark’s Master-Slave Architecture</h3><p>At its core, Apache Spark follows a <strong>master-slave</strong> or <strong>driver-executor</strong> model. Here’s a simple breakdown:</p><ul><li><strong>Driver Program</strong>: The master node that controls job execution</li><li><strong>Executors</strong>: Worker nodes that do the actual processing</li><li><strong>Cluster Manager</strong>: Allocates resources (CPU, memory) for Spark applications</li></ul><h3>Spark can run on:</h3><ul><li><strong>Standalone mode</strong> (built-in cluster manager)</li><li><strong>Apache Hadoop YARN</strong></li><li><strong>Apache Mesos</strong></li><li><strong>Kubernetes</strong></li></ul><h3>Key Components of Apache Spark Architecture</h3><p>Let’s dive into the main parts:</p><h3>1. Driver Program</h3><p>The <strong>Driver</strong> is the <em>brain</em> of the Spark application. It is responsible for:</p><ul><li>Running the user-defined Spark code</li><li>Creating the <strong>SparkContext</strong></li><li>Building the <strong>DAG (Directed Acyclic Graph)</strong></li><li>Dividing the DAG into <strong>stages</strong> and <strong>tasks</strong></li><li>Scheduling tasks to executors</li><li>Tracking their status and collecting results</li></ul><p>➡ <strong>Runs on the master node</strong> and coordinates everything.</p><h3>2. SparkContext</h3><p>SparkContext is the <strong>entry point</strong> to every Spark application. It:</p><ul><li>Connects to the <strong>Cluster Manager</strong></li><li>Allocates <strong>executors</strong></li><li>Acts as the bridge between your code and Spark’s internal services</li></ul><h3>3. Cluster Manager</h3><p>The <strong>Cluster Manager</strong> is responsible for:</p><ul><li>Resource management (CPU, memory)</li><li>Launching and monitoring executor nodes</li></ul><p>Spark supports:</p><ul><li><strong>Standalone Cluster Manager</strong> (built-in)</li><li><strong>YARN</strong></li><li><strong>Mesos</strong></li><li><strong>Kubernetes</strong></li></ul><h3>4. Executors</h3><p><strong>Executors</strong> are JVM processes that:</p><ul><li>Run tasks assigned by the driver</li><li>Store data in memory or disk</li><li>Cache intermediate results</li><li>Report status back to the driver</li></ul><p>➡ Executors are <strong>dedicated to a single Spark application</strong> and terminate when it finishes.</p><h3>5. Tasks and Stages</h3><p>Spark breaks each job into <strong>stages</strong>, and each stage into <strong>tasks</strong>:</p><ul><li><strong>Stage</strong> = A set of transformations that can run without shuffling</li><li><strong>Task</strong> = A unit of execution on a <strong>partition</strong> of data</li></ul><p>Tasks run in parallel across executors, leveraging Spark’s <strong>distributed nature</strong>.</p><p>🔁 <strong>Execution Flow Recap</strong></p><p>User Code → SparkContext → DAG → Stages → Tasks → Executors</p><p>📊 <strong>Diagram: Apache Spark Architecture</strong></p><ul><li>— — — — — — — — +<br>| Driver Program|<br>| (SparkContext) |<br>+ — — — — — — — — +<br> |<br> v<br>+ — — — — — — — — — — + + — — — — — — — — — — +<br>| Cluster Manager | ←&gt; | Executors |<br>| (YARN, K8s, etc.) | | (Tasks + Caching) |<br>+ — — — — — — — — — — + + — — — — — — — — — — +</li></ul><h3>Optional Components in the Ecosystem</h3><p>Spark’s core engine is powerful on its own, but most real-world workloads rely on its ecosystem modules. These are tightly integrated yet optional, which is why Spark adapts so well across use cases.</p><h3>1. Spark SQL</h3><p>Spark SQL provides structured data processing on top of Spark’s core engine.</p><p>It allows you to:</p><ul><li>Query data using SQL</li><li>Work with DataFrames and Datasets</li><li>Read from multiple sources like Hive, Parquet, ORC, JSON, JDBC</li></ul><p>Under the hood:</p><ul><li>SQL queries are converted into logical plans</li><li>Optimized by <strong>Catalyst Optimizer</strong></li><li>Executed as physical plans using Spark’s execution engine</li></ul><p>➡ This is why Spark SQL is often faster than traditional SQL-on-Hadoop systems.</p><h3>2. Spark Streaming / Structured Streaming</h3><p>Spark supports real-time data processing via:</p><ul><li><strong>Spark Streaming</strong> (micro-batch based, legacy)</li><li><strong>Structured Streaming</strong> (modern, declarative)</li></ul><p>Capabilities:</p><ul><li>Processes data in near real time</li><li>Integrates with Kafka, Kinesis, sockets, files</li><li>Uses the same engine as batch jobs</li></ul><p>➡ Structured Streaming treats streaming as an <strong>unbounded table</strong>, which simplifies logic and improves fault tolerance.</p><h3>3. MLlib</h3><p>MLlib is Spark’s machine learning library.</p><p>It provides:</p><ul><li>Distributed ML algorithms (classification, regression, clustering)</li><li>Feature engineering utilities</li><li>Pipeline APIs</li></ul><p>Architecture-wise:</p><ul><li>Algorithms are executed as distributed Spark jobs</li><li>Data stays close to executors, reducing data movement</li></ul><p>➡ Ideal for large-scale ML, not for deep learning. Different tools, different jobs.</p><h3>4. GraphX</h3><p>GraphX enables graph processing on Spark.</p><p>Use cases:</p><ul><li>Social networks</li><li>Recommendation engines</li><li>Dependency graphs</li></ul><p>It represents graphs using:</p><ul><li>RDDs for vertices and edges</li><li>Distributed graph computations using Spark primitives</li></ul><h3>How Spark Executes a Job (Step-by-Step)</h3><p>Let’s connect the dots with a concrete execution flow:</p><ol><li><strong>User submits a Spark application</strong></li></ol><ul><li>Using spark-submit, Databricks job, or notebook</li></ul><ol><li><strong>Driver initializes SparkContext</strong></li></ol><ul><li>Contacts the Cluster Manager</li><li>Requests resources</li></ul><ol><li><strong>Cluster Manager allocates executors</strong></li></ol><ul><li>Executors start as JVM processes</li></ul><ol><li><strong>Driver builds a DAG</strong></li></ol><ul><li>Based on lazy transformations</li><li>No execution yet</li></ul><ol><li><strong>Action triggers execution</strong></li></ol><ul><li>DAG is split into stages</li><li>Stages are split into tasks</li></ul><ol><li><strong>Tasks are scheduled on executors</strong></li></ol><ul><li>Each task processes one partition</li><li>Tasks run in parallel</li></ul><ol><li><strong>Shuffle (if required)</strong></li></ol><ul><li>Data is redistributed across executors</li><li>Expensive but unavoidable for wide transformations</li></ul><ol><li><strong>Results returned to Driver</strong></li></ol><ul><li>Or written to storage (S3, ADLS, HDFS, etc.)</li></ul><ol><li><strong>Application finishes</strong></li></ol><ul><li>Executors are terminated</li><li>Resources are released</li></ul><h3>Why Spark Architecture Matters for Performance</h3><p>Understanding Spark’s internals directly impacts how you write code.</p><h3>1. Lazy Evaluation</h3><ul><li>Transformations don’t execute immediately</li><li>Spark builds an optimized execution plan first</li></ul><p>➡ Helps Spark reduce unnecessary computation</p><h3>2. In-Memory Processing</h3><ul><li>Data can be cached in RAM across stages</li><li>Avoids repeated disk I/O</li></ul><p>➡ Massive performance boost for iterative workloads</p><h3>3. Partitioning and Parallelism</h3><ul><li>More partitions = more parallelism (up to a point)</li><li>Poor partitioning leads to skew and slow jobs</li></ul><p>➡ Architecture-aware tuning beats random config tweaking</p><h3>4. Fault Tolerance via Lineage</h3><ul><li>Spark doesn’t replicate data like Hadoop</li><li>It rebuilds lost partitions using lineage</li></ul><p>➡ Faster recovery, less storage overhead</p><h3>Common Architecture Mistakes (And Why They Hurt)</h3><ul><li>Too few partitions → executors sit idle</li><li>Too many small partitions → scheduling overhead</li><li>Blind caching → memory pressure and GC issues</li><li>Ignoring shuffle boundaries → unexpected slowdowns</li></ul><p>All of these are architectural consequences, not “Spark being slow.”</p><h3>When Spark Might Not Be the Right Tool</h3><p>Spark is powerful, not magical.</p><p>It may not be ideal for:</p><ul><li>Low-latency OLTP workloads</li><li>Single-machine data processing</li><li>Deep learning training at scale</li><li>Ultra-low-latency streaming (sub-second SLA)</li></ul><p>Knowing the architecture helps you know when <strong>not</strong> to use Spark.</p><h3>Final Thoughts</h3><p>Apache Spark’s architecture is the reason it scales from a laptop to thousands of nodes.</p><p>At a high level:</p><ul><li><strong>Driver</strong> orchestrates</li><li><strong>Executors</strong> compute</li><li><strong>Cluster Manager</strong> allocates resources</li><li><strong>DAG, stages, and tasks</strong> ensure efficient execution</li></ul><p>Once you understand how these pieces fit together, Spark stops feeling like a black box and starts behaving like a predictable, optimizable engine.</p><p>In the next blog of this series, we’ll go deeper into:<br> ➡ <strong>DAG, stages, shuffles, and how Spark optimizes queries internally</strong></p><p>Because performance problems rarely start in the code.<br>They start in misunderstanding the architecture.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6d16222c7d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Spark Series: Key Features and Use Cases]]></title>
            <link>https://medium.com/@3101.shweta/apache-spark-series-key-features-and-use-cases-76aded3bc357?source=rss-160473da91c------2</link>
            <guid isPermaLink="false">https://medium.com/p/76aded3bc357</guid>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-engineer]]></category>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[etl-pipeline]]></category>
            <dc:creator><![CDATA[Shweta Vishwakarma]]></dc:creator>
            <pubDate>Mon, 09 Jun 2025 09:49:57 GMT</pubDate>
            <atom:updated>2025-06-09T10:06:57.829Z</atom:updated>
            <content:encoded><![CDATA[<p>In the era of big data, speed and scale are critical. Apache Spark has emerged as a powerhouse in the data processing world, enabling organizations to analyze vast amounts of data quickly and efficiently.</p><p>Built for performance and scalability, Spark has become one of the most widely used engines for <strong>big data analytics</strong>, enabling teams to process massive datasets with ease — whether it’s for ETL pipelines, machine learning, real-time analytics, or interactive data exploration.</p><p>In this first part of our Apache Spark series, we’ll uncover the <strong>key features</strong> that make Spark so powerful and explore its <strong>use cases</strong> across industries and domains.</p><h3>🚀 What is Apache Spark?</h3><p>Apache Spark is an <a href="https://github.com/apache/spark?ref=chaosgenius.io">open source</a> distributed data processing engine that enables users to perform complex data analysis across large datasets. It is designed to be fast, flexible, and easy to use, making it suitable for various applications in data science and analytics.</p><h3>🧱 Key Features of Apache Spark</h3><p>Apache Spark is popular not just for performance but for its versatility and usability. Here are the features that make Spark stand out:</p><h3>1. In-Memory Computation for Lightning Speed ⚡</h3><p>Spark caches intermediate data in memory, reducing costly disk I/O. This accelerates:</p><ul><li>Iterative machine learning algorithms</li><li>Repeated ad-hoc queries</li></ul><p>💡 <em>Benefit</em>: Jobs run dramatically faster than traditional disk-based systems like Hadoop MapReduce.</p><h3>2. Unified Engine for All Workloads 🔄</h3><p>Spark can handle:</p><ul><li><strong>Batch processing</strong></li><li><strong>Stream processing</strong> (real-time analytics)</li><li><strong>SQL queries</strong></li><li><strong>Machine learning</strong> (via MLlib)</li><li><strong>Graph analytics</strong> (via GraphX)</li></ul><p>💡 <em>Benefit</em>: One engine, multiple capabilities. No need to stitch together different tools.</p><h3>3. Multi-language Support 🧑‍💻</h3><p>Spark APIs are available in:</p><ul><li><strong>Scala</strong> (native)</li><li><strong>Python</strong> (via PySpark)</li><li><strong>Java</strong></li><li><strong>R</strong></li><li><strong>SQL</strong></li></ul><p>💡 <em>Benefit</em>: Teams with varied programming backgrounds can work seamlessly.</p><h3>4. Advanced DAG Execution Engine 🕸️</h3><p>Spark translates jobs into a <strong>Directed Acyclic Graph (DAG)</strong> for stage-based execution. It:</p><ul><li>Optimizes data transformations</li><li>Executes operations in stages</li><li>Reuses cached data across jobs</li></ul><p>💡 <em>Benefit</em>: Smarter job scheduling, less latency.</p><h3>5. Fault Tolerance via Lineage 💥</h3><p>Spark’s <strong>Resilient Distributed Datasets (RDDs)</strong> maintain lineage information, which means lost data partitions can be recomputed from original operations.</p><p>💡 <em>Benefit</em>: High reliability even on large, unstable clusters.</p><h3>6. Broad Ecosystem Integration 🌐</h3><p>Spark works well with:</p><ul><li><strong>HDFS, Hive, HBase</strong></li><li><strong>Amazon S3, Azure, GCP</strong></li><li><strong>Kafka, Cassandra, JDBC</strong>, and more</li></ul><p>💡 <em>Benefit</em>: Easily integrates with modern cloud and data platforms.</p><h3>7. Scalability Across Environments 📈</h3><p>Spark runs on:</p><ul><li><strong>Standalone cluster mode</strong></li><li><strong>Apache Mesos</strong></li><li><strong>Hadoop YARN</strong></li><li><strong>Kubernetes</strong></li></ul><p>💡 <em>Benefit</em>: Easily scale from local testing to massive clusters without changing code.</p><h3>8. Catalyst Optimizer + Tungsten Engine 🧠</h3><ul><li><strong>Catalyst</strong>: Optimizes SQL queries logically and physically</li><li><strong>Tungsten</strong>: Enables whole-stage code generation, better memory management</li></ul><p>💡 <em>Benefit</em>: Supercharged performance for structured data queries.</p><h3>9. Lazy Evaluation</h3><p>Apache Spark doesn’t execute your commands immediately. Instead, it creates a plan and waits until it absolutely needs to compute something.</p><h3>🔧 What is Apache Spark Used For?</h3><h3>1. Batch Data Processing</h3><ul><li>Process large volumes of static data efficiently.</li><li>Ideal for ETL (Extract, Transform, Load) pipelines.</li><li>Common in data warehousing and scheduled jobs.</li></ul><p>🧠 <em>Example</em>: Aggregating daily sales data for dashboards.</p><h3>2. Real-Time Stream Processing</h3><ul><li>Ingest and process live data streams.</li><li>Supports real-time analytics and alerting systems using <strong>Structured Streaming</strong> or <strong>Spark Streaming</strong>.</li></ul><p>🧠 <em>Example</em>: Detecting fraudulent transactions or analyzing clickstreams.</p><h3>3. Machine Learning &amp; Data Science</h3><ul><li>Spark’s <strong>MLlib</strong> library allows scalable training and deployment of ML models.</li><li>Supports classification, regression, clustering, recommendation, and more.</li></ul><p>🧠 <em>Example</em>: Building recommendation engines for e-commerce or tuning predictive models.</p><h3>4. Interactive Data Analysis</h3><ul><li>Perform ad-hoc queries on massive datasets using <strong>Spark SQL</strong>.</li><li>Works well with BI tools and Jupyter notebooks.</li></ul><p>🧠 <em>Example</em>: Data scientists querying large data lakes to explore trends.</p><h3>5. Graph Processing</h3><ul><li>Use <strong>GraphX</strong> to work with graph data structures like social networks or road maps.</li><li>Supports operations like PageRank, shortest paths, etc.</li></ul><p>🧠 <em>Example</em>: Analyzing relationships in social networks or supply chains.</p><h3>6. Data Lakehouse and Unified Analytics</h3><ul><li>Acts as a compute engine over <strong>data lakes</strong>.</li><li>Integrates with <strong>Delta Lake</strong>, <strong>Apache Hudi</strong>, or <strong>Iceberg</strong> for versioned, ACID-compliant tables.</li></ul><p>🧠 <em>Example</em>: Building a modern lakehouse for real-time + historical analytics.</p><p>Now that we’ve explored what Apache Spark can do and why it’s become a go-to tool for modern data engineering, it’s time to look under the hood. In the <strong>next part of this series</strong>, we’ll dive deep into the <strong>architecture of Apache Spark</strong> — breaking down its core components, execution flow, and how it handles distributed computing at scale.</p><p><strong>Hope you found this blog useful!</strong><br>If you have any questions, feel free to drop a comment below or connect with me on <a href="https://www.linkedin.com/in/shweta-vishwakarma-b2938b199/">LinkedIn</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76aded3bc357" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configuring Google Cloud Infrastructure Using Terraform]]></title>
            <link>https://medium.com/@3101.shweta/configuring-google-cloud-infrastructure-using-terraform-de5e8697e849?source=rss-160473da91c------2</link>
            <guid isPermaLink="false">https://medium.com/p/de5e8697e849</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Shweta Vishwakarma]]></dc:creator>
            <pubDate>Thu, 21 Sep 2023 07:54:23 GMT</pubDate>
            <atom:updated>2023-09-21T07:54:23.634Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>IaC — </strong>IaC stands for Infrastructure as a code is an approach to provision infrastructures such as server, storage or networking infrastructure through some kind of code.</p><p>Since, many IaC tools are available such as <a href="https://www.chef.io/products/chef-infra">chef</a>, <a href="https://www.puppet.com/">puppet</a>, <a href="https://developers.redhat.com/products/ansible/getting-started?sc_cid=7013a000003SfSLAA0&amp;gclid=CjwKCAjwsKqoBhBPEiwALrrqiKchRG2DdUxORSfOmEKOysJXZYlCTE0v2nHpm86CISGIfT0Iy3IxmBoCSLYQAvD_BwE">red hat ansible automation</a> , <a href="https://aws.amazon.com/cloudformation/">aws cloud formation</a> and <a href="http://terraform.io/">terraform</a>. However, in this series we’ll be discussing to create and manage the infrastructure (i.e. GCP services) using terraform.</p><p><strong>Terraform</strong> — Terraform is an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share.</p><p>The terraform workflows consists of three stages :</p><p><strong><em>1 . Write</em></strong> — you define resources across cloud providers and services.</p><p><strong><em>2. Plan</em></strong> — terraform creates execution plan to create, update or destroy the infrastructure.</p><p><strong><em>3. Apply</em> </strong>— terraform performs the operations in an assigned order.</p><p>Let’s see, how can we configure infrastructures using terraform in GCP. To illustrate, we will create a cloud storage bucket and a bigquery dataset in a GCP project.</p><p><strong><em>Prerequisites</em></strong> — A Gitlab account and a GCP project.</p><p>Before we proceed with the declarative modules of terraform scripts, let’s configure a service account in the GCP project and set up the CI/CD variable in the gitlab project.</p><p>To create a service account into a GCP project, move to “IAM &amp; Admin &gt; Service Accounts” section from the navigation menu, as shown in the below image :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*ZYAjNd6iiEpup6siwtYXvw.png" /></figure><p>Now click “create service account” and fill up the required details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*qqKoSktPRe_rxR_0gJoaHQ.png" /></figure><p>Create the service account and download the private key for the service account into JSON format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*jkqKgwA8OqXvNuKOkaXYnA.png" /></figure><p>Now encode the private key into an encrypted format (you can use any online encoder e.g. base64) and copy the encoded key on your clipboard.</p><p>Next, move to the interface of gitlab’s project, navigate to settings &gt;&gt; CI/CD, expand the “Variables” section and click on “Add variable”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-qUO82IwttURCy7VJ9dMhQ.png" /></figure><p>You can give any name to the “Key” and paste the encoded key into the “Value” section as shown below.</p><p>Note — we’re going to use the “Key” as a variable further</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*oS8tPOXOcpFCDtL--KUjzA.png" /></figure><p>We have already segregated the entire project in various files:</p><p><strong><em>main.tf</em></strong> — it contains the modules where we’ve described the basic details of the infrastructure and services that needs to be configured as displayed below :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*lrV_zNQm95cTWRdL-m6Ucg.png" /></figure><p><strong><em>variables.tf</em></strong> — here, we describe the variables used in the modules, e.g. as shown in the above image, while we’re configuring the module “google_storage_bucket” variables bucket_name, storage_class and bucket_location is being recalled from the variables file.</p><p>Variables.tf consists of the type and description of the variables required in the modules and can be written as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*ojvhXaW3hZA-rpSSxJzl1Q.png" /></figure><p><strong><em>terraform.tfvars</em></strong> — terraform.tfvars describes the default values of the variables that needs to considered while executing the terraform modules, e.g.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*_6RXXohQK0yLXKPUTcsM4w.png" /></figure><p><strong><em>.gitlab-ci.yml</em></strong> — it contains the CI/CD configuration and defines scripts that should be run during the actual pipeline execution and here we’ve distributed it in three stages , i.e.</p><ol><li>validate — it is used to validate the syntax of Terraform files. Terraform performs a syntax check on all Terraform files in the directory specified and displays warnings and errors if any files contain invalid syntax.</li><li>plan — it creates an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure.</li><li>apply — it performs a plan just like terraform plan does, but then actually carries out the planned changes to each resource using the relevant infrastructure provider’s API.</li></ol><p>Note — we’re bounding the terraform apply stage to manual, so it’ll require manual approval before applying the plan changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*m4L2RN2XkB1jEmGmwo8tfA.png" /></figure><p>Since, we’re ready with the modules and .gitlab-ci.yml file, next we’ll execute the pipeline to create the GCS bucket and BQ dataset in the GCP project.</p><p>To trigger and execute the pipeline, move to the “Build &gt; Pipelines” section of your gitlab project and click “Run Pipeline” and once you hit it you’d be able to see the status of your executed pipeline.</p><p>Now, when you pass each stages of pipeline i.e. validate, plan &amp; apply, verify the created resources from your Google cloud console.</p><p>Hope you find it useful. In case of any queries leave your comments here or reach out to me on <a href="https://www.linkedin.com/in/shweta-vishwakarma-b2938b199/">Linkedin</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de5e8697e849" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Lifecycle]]></title>
            <link>https://medium.com/@3101.shweta/data-lifecycle-9f36f40d97b?source=rss-160473da91c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f36f40d97b</guid>
            <dc:creator><![CDATA[Shweta Vishwakarma]]></dc:creator>
            <pubDate>Fri, 16 Dec 2022 09:00:35 GMT</pubDate>
            <atom:updated>2022-12-16T09:00:35.147Z</atom:updated>
            <content:encoded><![CDATA[<p>Data Engineers choose different storage systems based on the stage of data lifecycle. Now, you must be wondering about the ‘data lifecycle’, so, let’s discuss it briefly.</p><p>The data lifecycle consists of four stages:</p><ul><li>Ingest</li><li>Store</li><li>Process &amp; analyze</li><li>Explore &amp; visualize</li></ul><h4><strong>Ingest</strong></h4><p>Ingestion is the primary stage of data lifecycle &amp; the process of obtaining and importing data for usage through a various data processing methods.</p><p>Moreover, the data engineers perform data ingestion through various modes . Let’s mention few of them.</p><ul><li>Application data ingestion</li><li>Streaming data ingestion</li><li>Batch data ingestion</li></ul><p><em>Note: We’ll discuss each in other parts of the series.</em></p><h4><strong>Store</strong></h4><p>The objective of this stage of data lifecycle is to make data available for tranformation &amp; analysis. To choose between storage systems , it requires to understand the various factors, i.e.</p><ul><li>Data models (how the data will be accessed)</li><li>Access Controls that needs to be implemented, and,</li><li>How long the data will be stored.</li></ul><h4><strong>Processing &amp; Analyze</strong></h4><p>During this stage of data lifecycle, the data engineers perform data transformation and data analysis. In other words, once the raw data is collected, it gets processed such as data cleansing , normalizing and standardization of data to make it suitable to analyze and produce meaningful information ( a variety of techniques may be used to extract useful information from the data).</p><h4><strong>Explore &amp; Visualize</strong></h4><p>Even though there are various ways &amp; widely used machine learning libraries to explore your data such as pandas, scikit and tensorflow (Python and SQL), a non programmers can use the visualization tools , e.g. data studio to expore their data sets.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f36f40d97b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Kubernetes Engine]]></title>
            <link>https://medium.com/@3101.shweta/introduction-to-kubernetes-engine-51c5adf2eaa1?source=rss-160473da91c------2</link>
            <guid isPermaLink="false">https://medium.com/p/51c5adf2eaa1</guid>
            <dc:creator><![CDATA[Shweta Vishwakarma]]></dc:creator>
            <pubDate>Wed, 08 Jul 2020 10:01:09 GMT</pubDate>
            <atom:updated>2020-07-08T10:01:09.030Z</atom:updated>
            <content:encoded><![CDATA[<p>Kubernetes Engine is Google Cloud Platform’s managed Kubernetes service. With this service, GCP customers can create and maintain their own Kubernetes clusters without having to manage the Kubernetes platform.</p><p>Kubernetes runs containers on a cluster of VMs. It determines where to run containers, monitors the health of containers and manages the full lifecycle of VMs instances. And this collection of tasks is known as container orchestration.</p><p>KEEP IN MIND: when you use Kubernetes Engine, you will manage Kubernetes and your applications and workloads running in containers on the Kubernetes platform.</p><h3>KUBERNETES CLUSTER ARCHITECTURE:</h3><p>A Kubernetes cluster consists of a cluster master and one or more nodes(which are the workers of clusters).</p><p>CLUSTER MASTER: It controls the clusters and manages services provided by Kubernetes , i.e. Kubernetes API, controllers and schedulers. The cluster master issues the command that performs an action on a node.</p><p>NODES: execute the workloads run on cluster. Nodes are VMs that run containers configured to run an application. The nodes run an agent called “kubelet” , which is the service that communicates with the cluster master.</p><h3>KUBERNETES OBJECT:</h3><h4>1.PODS</h4><p>Pods are single instances of a running process in a cluster. Pods contain atleast one container. Multiple containers are used when two or more containers must share resources. Pods also use shared networking and storage across containers. Each Pod gets a unique IP address and set of ports. Container connects to a port. Multiple containers connect to different ports and can talk to each other on localhost. This structure is designed to support running one instance of an application within the cluster as a pod. A pod allows its containers to behave as they are running on an isolated a VM, sharing common storage, one IP address and a set of ports. By doing this, you can deploy multiple instance of the same application, or different applications on the same node or different nodes, without having to change their configuration.</p><h4>2.SERVICES</h4><p>Kubernetes provides a level of indirection between applications running in a pod and other application that call them: it is called a “service”.</p><p>A service is an object that provides API endpoints with a stable IP address that allow application to discover pods running a particular application. Services update when changes are made to pods , so they maintain an up-to-date list of pods running an application.</p><h4>3.REPLICASET</h4><p>It is a controller used by a deployment that ensures the correct number identical of pods are running.</p><p>It can also be used to update and delete a pod.</p><h4>4.DEPLOYMENT</h4><p>Deployments are set of identical pods. The members of set may change i.e. pods are ephemeral.</p><p>A pod template is a definition of how to run a pod. The description of how to define the pod is called pod specification.</p><h4>4.STATEFULSET</h4><p>StatefulSets are like deployments , but they assign unique identifiers to pods. This enables Kubernetes to track which pod is used by which client and keep them together. StatefulSets are used when an application needs a unique network identifier or stable persistent storage.</p><h4>5.JOBS</h4><p>It is an abstraction about a workload. Jobs create pods and run them until the application completes a workload. Job specifications are specified in a configuration file and include specifications about the container to use and what command to run.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51c5adf2eaa1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>