<?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 Kirti Kolare on Medium]]></title>
        <description><![CDATA[Stories by Kirti Kolare on Medium]]></description>
        <link>https://medium.com/@kirtikolare15?source=rss-0315bea6d885------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1tESXr3NpVHsMLjb</url>
            <title>Stories by Kirti Kolare on Medium</title>
            <link>https://medium.com/@kirtikolare15?source=rss-0315bea6d885------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 01:09:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kirtikolare15/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[Understanding Android Activity and Activity Lifecycle]]></title>
            <link>https://medium.com/@kirtikolare15/understanding-android-activity-and-activity-lifecycle-4ce71274c554?source=rss-0315bea6d885------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ce71274c554</guid>
            <dc:creator><![CDATA[Kirti Kolare]]></dc:creator>
            <pubDate>Wed, 25 Mar 2026 07:40:30 GMT</pubDate>
            <atom:updated>2026-03-25T07:40:30.171Z</atom:updated>
            <content:encoded><![CDATA[<p>Introduction</p><p>Android applications are built using different components, and one of the most fundamental components is an Activity. If you’ve ever used an Android app, every screen you interact with – like a login page, dashboard, or settings screen – is typically an activity.</p><p>Understanding activities and their lifecycle is crucial for building efficient, responsive, and bug-free Android applications.</p><p>What is an Activity?</p><p>An Activity in Android represents a single screen with a user interface. It acts as an entry point for user interaction.</p><p>For example:</p><p>•	A login screen → one activity</p><p>•	A home screen → another activity</p><p>•	A profile page → another activity</p><p>Each activity is responsible for:</p><p>•	Displaying UI elements</p><p>•	Handling user interactions</p><p>•	Managing data for that screen</p><p>Key Features of an Activity</p><p>•	Acts as a controller between UI and data</p><p>•	Manages user input (clicks, typing, gestures)</p><p>•	Can start other activities using Intents</p><p>•	Has a defined lifecycle controlled by the Android system</p><p>What is Activity Lifecycle?</p><p>The Activity Lifecycle is a set of callback methods that define the different states an activity goes through from creation to destruction.</p><p>The Android system manages this lifecycle based on:</p><p>•	User actions</p><p>•	System conditions (like memory)</p><p>•	Navigation between activities</p><p>Activity Lifecycle States</p><ol><li>onCreate()</li></ol><p>This is the first method called when an activity is created.</p><p>Purpose:</p><p>•	Initialize UI components</p><p>•	Set layout using setContentView()</p><p>•	Initialize variables</p><p>@Override</p><p>protected void onCreate(Bundle savedInstanceState) {</p><p>. super.onCreate(savedInstanceState);</p><p>. setContentView(R.layout.activity_main);</p><p>}</p><p>2. onStart()</p><p>Called when the activity becomes visible to the user.</p><p>Purpose:</p><p>•	Prepare the activity to be displayed</p><p>3. onResume()</p><p>Called when the activity starts interacting with the user.</p><p>Purpose:</p><p>•	Start animations</p><p>•	Resume ongoing tasks</p><p>This is the active state of the activity.</p><p>4. onPause()</p><p>Called when another activity partially covers the current activity.</p><p>Purpose:</p><p>•	Pause ongoing tasks</p><p>•	Save temporary data</p><p>5. onStop()</p><p>Called when the activity is no longer visible.</p><p>Purpose:</p><p>•	Release resources</p><p>•	Stop background operations</p><p>6. onRestart()</p><p>Called when the activity is restarting after being stopped.</p><p>7. onDestroy()</p><p>Called before the activity is destroyed.</p><p>Purpose:</p><p>•	Clean up resources</p><p>•	Final shutdown</p><p>Lifecycle Flow Summary</p><p>The lifecycle generally follows this sequence:</p><p>onCreate() → onStart() → onResume()</p><p>. ↓</p><p>. (Running)</p><p>. ↓</p><p>onPause() → onStop() → onDestroy()</p><p>If returning back:</p><p>onRestart() → onStart() → onResume()</p><p>Why is Activity Lifecycle Important?</p><p>Understanding the lifecycle helps in:</p><p>•	Preventing app crashes</p><p>•	Managing memory efficiently</p><p>•	Saving and restoring data</p><p>•	Handling interruptions (calls, notifications, etc.)</p><p>Real-Life Example</p><p>Imagine you are using a messaging app:</p><p>•	You open the app → onCreate()</p><p>•	You start chatting → onResume()</p><p>•	You get a call → onPause()</p><p>•	App goes to background → onStop()</p><p>•	You return → onRestart() → onResume()</p><p>Best Practices</p><p>•	Avoid heavy operations in onCreate()</p><p>•	Release resources in onStop() or onDestroy()</p><p>•	Save user data in onPause()</p><p>•	Use ViewModel or SavedInstanceState for persistence</p><p>Conclusion</p><p>The Activity and its Lifecycle are the backbone of Android application development. Mastering them ensures your app behaves smoothly across different scenarios, from simple navigation to complex multitasking.</p><p>By understanding when and how each lifecycle method is triggered, developers can create responsive, efficient, and user-friendly applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*L5GyVqHH78sDCn1MVyHL_g@2x.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ce71274c554" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MapReduce: The Backbone of Distributed Data Processing]]></title>
            <link>https://medium.com/@kirtikolare15/mapreduce-the-backbone-of-distributed-data-processing-bc25ece7b221?source=rss-0315bea6d885------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc25ece7b221</guid>
            <category><![CDATA[mapreduce]]></category>
            <dc:creator><![CDATA[Kirti Kolare]]></dc:creator>
            <pubDate>Sun, 21 Sep 2025 09:32:52 GMT</pubDate>
            <atom:updated>2025-09-21T09:32:52.700Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*5ZqNSFBUSz6_TUxB" /></figure><p>In today’s digital world, data is everywhere. From social media posts and online transactions to IoT sensors and streaming platforms, organizations generate terabytes of information every day. Managing and making sense of such massive datasets requires powerful tools and techniques. One of the most foundational frameworks for handling big data is MapReduce, originally developed by Google and later popularized through Hadoop.</p><p>In this blog, we’ll dive deep into what MapReduce is, how it works, why it matters, and where it’s used. By the end, you’ll have a clear understanding of how MapReduce simplifies large-scale data processing.</p><h3>What is MapReduce?</h3><p>MapReduce is a distributed computing model designed to process extremely large datasets in parallel across clusters of machines. The idea is simple: divide the work into smaller sub-tasks (Map), then combine their results into a final output (Reduce).</p><p>The term is inspired by functional programming languages:</p><ul><li>map() transforms collections by applying a function to each element.</li><li>reduce() aggregates results into a single outcome, such as a sum or maximum.</li></ul><p>Google introduced MapReduce in 2004 through Jeffrey Dean and Sanjay Ghemawat’s landmark paper. Their motivation was clear: as Google’s web index grew, traditional data processing models struggled with scale, reliability, and cost. MapReduce provided an elegant solution, enabling Google engineers to write simple programs that could run across thousands of machines.</p><p>A MapReduce system automates the complexity of:</p><ul><li>Data partitioning (splitting input files into manageable blocks).</li><li>Task scheduling (assigning work to available nodes).</li><li>Fault tolerance (retrying failed tasks).</li><li>Result aggregation (combining partial outputs into the final dataset).</li></ul><p>This paradigm quickly became the backbone of Google’s search engine, ad systems, and analytics platforms. Later, Hadoop — a widely adopted open-source implementation — brought the technology to organizations everywhere.</p><p>In short, MapReduce abstracts away the complexity of distributed systems, giving developers a powerful, simple way to handle “big data.”</p><h3>Why MapReduce?</h3><p>Before MapReduce, organizations typically relied on centralized databases or single servers for processing. This approach had several limitations:</p><ul><li>Data Movement Overhead: To analyze data, you often had to move huge volumes across networks, which was slow and costly.</li><li>Limited Scalability: Single machines could not keep up with exploding data volumes.</li><li>High Costs: Vertical scaling (buying bigger servers) was expensive.</li><li>Fragility: If one system crashed, entire jobs failed.</li></ul><p>MapReduce solved these challenges:</p><ol><li>Parallelization at Scale — Jobs are divided into thousands of smaller tasks, executed simultaneously across clusters.</li><li>Data Locality Optimization — Tasks run on the machine storing the data block, drastically reducing network usage.</li><li>Built-in Fault Tolerance — Failed tasks are automatically retried elsewhere.</li><li>Simplified Programming Model — Engineers no longer needed to manage distributed file systems, job distribution, or recovery.</li></ol><p>Example in Practice</p><p>At Google, processing web crawl data for indexing once required complex, hand-crafted distributed programs. After adopting MapReduce, engineers could express the same logic in 50 lines of code, while the system handled cluster execution seamlessly.</p><p>Why It Matters Today</p><p>Although technologies like Apache Spark have superseded MapReduce in many contexts, the model remains a cornerstone of distributed data processing. It established the principles of scalability, locality, and fault tolerance that modern systems build upon.</p><h3>MapReduce Workflow</h3><p>The workflow of MapReduce describes the sequence of steps that transform raw input data into meaningful results. While the model looks deceptively simple — just map() and reduce() — the actual system involves several carefully orchestrated phases to maximize efficiency and reliability.</p><p>Step 1: Input Splitting</p><ul><li>Large datasets (e.g., multi-gigabyte log files) are split into fixed-size blocks — commonly 64 MB or 128 MB in Hadoop.</li><li>Each block is assigned to a mapper task.</li><li>By working with splits, MapReduce enables parallelism, where hundreds or thousands of map tasks can run simultaneously.</li></ul><p>Step 2: Mapping Phase</p><ul><li>The map function processes each split independently.</li><li>For every input record, it emits one or more key-value pairs.</li><li>Example: processing e-commerce orders, a mapper might emit (ProductID, Revenue) for each order.</li></ul><p>Since each map task works independently, failures don’t affect others. If a task crashes, it can be re-executed on another machine.</p><p>Step 3: Shuffling and Sorting</p><ul><li>After mapping, the framework groups values by their keys across all nodes.</li><li>This process is known as shuffle and sort.</li><li>Example: if multiple mappers emit (Tea, 5), (Tea, 7), (Tea, 2), all values for the key Tea are collected and sorted before passing to reducers.</li></ul><p>This is often the most network-intensive step, as data may move across cluster nodes. To optimize, MapReduce employs combiners.</p><p>Step 4: Combining (Optional)</p><ul><li>A combiner is like a mini-reducer that runs on each mapper’s output before shuffling.</li><li>It reduces redundant key-value pairs.</li><li>Example: If a mapper produces 1,000 occurrences of the word “data,” a combiner can sum them locally before sending (data, 1000) instead of 1,000 (data, 1) pairs.</li></ul><p>Combiners dramatically cut down network traffic and improve efficiency.</p><p>Step 5: Reducing Phase</p><ul><li>The reduce function aggregates values for each unique key.</li><li>Example: summing revenues per product (ProductID, [100, 200, 150]) → (ProductID, 450).</li><li>Reducers are executed in parallel, each working on a subset of keys.</li></ul><p>Step 6: Output</p><ul><li>Final results are written to the distributed file system (like HDFS).</li><li>Each reducer usually writes one output file. The collection of these files forms the job’s complete result.</li></ul><p>Key Orchestration Features</p><ul><li>Data Locality: Map tasks are scheduled on nodes that already store the data block, minimizing transfers.</li><li>Fault Tolerance: Failed tasks are retried automatically. Failed nodes are excluded, and tasks are reassigned.</li><li>Speculative Execution: Slow-running tasks are duplicated on another node; whichever finishes first is accepted.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/0*6Wm92WTLeI7-PYKV" /></figure><p>Why This Workflow Matters</p><p>This carefully designed pipeline ensures MapReduce can scale to thousands of nodes and petabytes of data. The abstraction allows developers to think in terms of map and reduce logic, while the framework handles the heavy lifting of distribution, synchronization, and fault tolerance.</p><p>In short, the workflow turns the chaos of distributed computing into a predictable, reliable, and efficient process.</p><h3>Example: WordCount in MapReduce</h3><p>The WordCount program is the “Hello World” of MapReduce. It’s simple, intuitive, and demonstrates every stage of the workflow clearly. The goal is to count how many times each word appears in a large collection of documents.</p><p>Problem Definition</p><p>Suppose we have thousands of text files (e.g., news articles, books, or social media posts). We want to know how often each word occurs across the entire dataset. Doing this on a single machine might be feasible for small inputs, but for gigabytes or terabytes of text, we need a scalable approach.</p><p>This is where MapReduce shines.</p><p>Step 1: Input Data</p><p>Let’s say our dataset includes two documents:</p><ul><li>Document 1: <em>“Data is powerful. Data is the new oil.”</em></li><li>Document 2: <em>“Big data requires powerful tools.”</em></li></ul><p>Step 2: Map Function</p><p>The mapper reads each line, splits it into words, and emits (word, 1) pairs:</p><p>def map(document_id, line):</p><p>words = line.split()</p><p>for word in words:</p><p>emit(word.lower(), 1)</p><p>Mapper outputs:</p><ul><li>From Document 1:<br>(data, 1), (is, 1), (powerful, 1), (data, 1), (is, 1), (the, 1), (new, 1), (oil, 1)</li><li>From Document 2:<br>(big, 1), (data, 1), (requires, 1), (powerful, 1), (tools, 1)</li></ul><p>Notice how each occurrence of a word is treated equally by emitting (word, 1).</p><p>Step 3: Shuffle and Sort</p><p>The framework now groups identical keys across all mappers:</p><ul><li>data → [1, 1, 1]</li><li>is → [1, 1]</li><li>powerful → [1, 1]</li><li>the → [1]</li><li>new → [1]</li><li>oil → [1]</li><li>big → [1]</li><li>requires → [1]</li><li>tools → [1]</li></ul><p>Step 4: Reduce Function</p><p>The reducer aggregates values by summing them:</p><p>def reduce(word, values):</p><p>count = sum(values)</p><p>emit(word, count)</p><p>Reducer outputs:</p><ul><li>(data, 3)</li><li>(is, 2)</li><li>(powerful, 2)</li><li>(the, 1)</li><li>(new, 1)</li><li>(oil, 1)</li><li>(big, 1)</li><li>(requires, 1)</li><li>(tools, 1)</li></ul><p>Step 5: Output</p><p>The final result is written to the distributed file system:</p><p>big 1</p><p>data 3</p><p>is 2</p><p>new 1</p><p>oil 1</p><p>powerful 2</p><p>requires 1</p><p>the 1</p><p>tools 1</p><p>Key Insights from WordCount</p><ol><li>Parallelism: Each document or block is processed independently in parallel by mappers.</li><li>Data Locality: If Document 1 is stored on Node A and Document 2 on Node B, the framework runs mappers on those nodes.</li><li>Simplicity: The developer only wrote two functions (map and reduce), yet the framework handled splitting, shuffling, and fault tolerance.</li><li>Scalability: The same program can process gigabytes or petabytes without modification — only the cluster size changes.</li></ol><p>Variations of WordCount</p><ul><li>Top-N Words: Extend the reducer to keep track of the top N most frequent words.</li><li>Stopword Filtering: Mappers can filter out common words like “the,” “is,” or “a.”</li><li>Case Normalization &amp; Tokenization: Mappers can normalize text (e.g., lowercase, punctuation removal).</li><li>Real-World Use: WordCount is a building block for search engines, spam detection, and sentiment analysis.</li></ul><h3>Advantages of MapReduce</h3><p>1. Scalability</p><p>One of the most celebrated strengths of MapReduce is its ability to scale from a few nodes to thousands of machines. The same code that processes gigabytes can, without modification, process petabytes by simply adding more nodes to the cluster.</p><ul><li>At Google, MapReduce jobs routinely processed multi-terabyte web indexes across tens of thousands of servers.</li><li>Hadoop, the open-source implementation, enabled enterprises to scale cheaply using commodity hardware.</li></ul><p>This horizontal scalability made big data accessible to organizations that could not afford specialized, high-end infrastructure.</p><p>2. Fault Tolerance</p><p>Hardware failures are a given in large clusters. In fact, at the scale Google operates, failures happen daily. MapReduce assumes failure as the norm and provides automatic recovery:</p><ul><li>If a node crashes during the map phase, its tasks are reassigned to another machine.</li><li>If a reducer fails, the framework reruns the task using the same grouped data.</li><li>Checkpointing and replication in distributed file systems (like HDFS) ensure no data loss.</li></ul><p>This means developers don’t need to manually handle failures — the system takes care of it transparently.</p><p>3. Data Locality Optimization</p><p>A major innovation of MapReduce is the principle of moving computation to the data, not data to the computation.</p><ul><li>Each map task is scheduled on the node storing its input split, minimizing costly data transfers.</li><li>By reducing network bottlenecks, MapReduce significantly improves job performance.</li></ul><p>This is particularly valuable in large clusters where transferring terabytes of data across the network would be prohibitively expensive and slow.</p><p>4. Simplicity of Programming Model</p><p>Before MapReduce, writing distributed applications required expertise in concurrency, networking, and fault tolerance. MapReduce abstracts all this complexity. Developers only need to define:</p><ul><li>A map function: transforms input into intermediate key-value pairs.</li><li>A reduce function: aggregates values by key into final results.</li></ul><p>The framework handles parallelization, scheduling, synchronization, and error recovery. This makes it approachable even for developers without distributed systems backgrounds.</p><p>5. Parallelism and High Throughput</p><p>By design, MapReduce jobs split into hundreds or thousands of tasks, which run concurrently. This ensures:</p><ul><li>Efficient cluster utilization — idle nodes are automatically assigned work.</li><li>Reduced execution time — a job that might take days on one server can finish in hours or minutes on a cluster.</li></ul><p>Speculative execution further improves performance by duplicating slow-running tasks and using the fastest result.</p><p>6. Flexibility in Data Processing</p><p>MapReduce can process structured, semi-structured, and unstructured data. Examples include:</p><ul><li>Structured: Sales data, relational exports.</li><li>Semi-structured: JSON, XML logs.</li><li>Unstructured: Web crawls, text, images, or sensor data.</li></ul><p>Because the model is general-purpose, it can be applied to domains as diverse as search indexing, genomics, fraud detection, and recommendation engines.</p><p>7. Cost-Effectiveness</p><p>Unlike traditional enterprise systems that required expensive hardware, MapReduce (and Hadoop) runs on commodity hardware clusters. This drastically reduced costs, allowing even mid-sized companies to adopt big data analytics.</p><p>8. Ecosystem and Adoption</p><p>The popularity of MapReduce led to the creation of a rich ecosystem:</p><ul><li>Apache Hadoop: the most famous open-source implementation.</li><li>Apache Pig &amp; Hive: higher-level languages built on MapReduce.</li><li>Cloud platforms: AWS Elastic MapReduce (EMR), Google Cloud Dataproc.</li></ul><p>This ecosystem made MapReduce jobs easier to write, manage, and scale.</p><h3>Limitations of MapReduce</h3><p>While MapReduce was groundbreaking, it has several shortcomings:</p><ul><li>Batch-Oriented — Not suitable for real-time analytics.</li><li>High Latency — Jobs involve multiple disk I/O operations, making them slow.</li><li>Inefficient for Iterative Tasks — Machine learning and graph algorithms require repeated passes, which MapReduce handles poorly.</li><li>Rigid Model — Developers must force problems into map–reduce steps, even when unnatural.</li><li>Debugging Challenges — Distributed errors are hard to trace and test.</li><li>Declining Relevance — Spark, Flink, and cloud-native tools are faster and more flexible.</li></ul><h3>Use Cases of MapReduce</h3><p>MapReduce has been applied across industries to solve a wide range of large-scale data problems. Its versatility lies in its ability to process structured, semi-structured, and unstructured data with the same simple programming model. Below are some prominent use cases:</p><p>1. Search Engines and Web Indexing</p><p>Google’s original motivation for MapReduce was building and updating its web index. By splitting crawled web data into smaller chunks, Google engineers could run mappers to extract words and links, then reducers to aggregate them into a massive searchable index. Yahoo! and Bing also used Hadoop-based MapReduce for similar indexing tasks.</p><p>2. Log Analysis in Social Media Platforms</p><p>Companies like Facebook, LinkedIn, and Twitter generate billions of log entries every day — from user clicks to ad impressions. MapReduce processes these logs to:</p><ul><li>Identify usage trends.</li><li>Optimize recommendation engines.</li><li>Detect spam or unusual activity.</li></ul><p>For instance, Facebook’s original “Hive” system was built on top of Hadoop MapReduce to allow analysts to run SQL-like queries on logs at scale.</p><p>3. ETL Pipelines (Extract, Transform, Load)</p><p>Many enterprises use MapReduce to transform raw operational data into structured forms suitable for data warehouses.</p><ul><li>Example: Cleaning, parsing, and aggregating raw transaction records before loading them into analytics dashboards.</li><li>This ensures high-volume business data can be processed overnight and made ready for reporting.</li></ul><p>4. Scientific Research and Healthcare</p><p>MapReduce has had major impacts in fields like genomics, physics, and climate science.</p><ul><li>Genomics: DNA sequencing produces terabytes of raw reads. MapReduce helps align these sequences and find genetic patterns.</li><li>Climate Modeling: NASA uses distributed data processing to analyze decades of satellite images.</li><li>Particle Physics: CERN’s Large Hadron Collider data was partly processed with Hadoop-based clusters.</li></ul><p>5. Business Intelligence and Retail</p><p>Retailers and banks leverage MapReduce for customer analytics.</p><ul><li>Retail: Analyzing purchasing behavior to recommend products or optimize inventory.</li><li>Finance: Detecting fraud patterns by analyzing large volumes of transaction logs.</li><li>Marketing: Segmenting customers and measuring campaign effectiveness across millions of records.</li></ul><p>6. Media and Entertainment</p><p>Streaming companies (like Netflix, in its earlier days) used MapReduce to process viewing logs and identify popular shows, optimize recommendations, and forecast demand.</p><h3>Conclusion</h3><p>MapReduce transformed the way organizations handle big data by introducing scalability, fault tolerance, and data locality. It simplified distributed programming and laid the foundation for today’s big data ecosystem.</p><p>However, its batch orientation, inefficiency for iterative algorithms, and high latency mean it has been largely superseded by newer frameworks like Apache Spark, Flink, and cloud-native solutions.</p><p>Still, MapReduce remains a historical milestone — a first step in making massive data processing accessible and reliable. Understanding it is essential, not just for appreciating Hadoop’s legacy, but also for grasping the evolution of modern data processing frameworks.</p><p>Reference : <a href="https://cdn.bookey.app/files/pdf/book/en/nosql-distilled.pdf">NoSQL Distilled: A Brief Guide to the Emerging World of Polyglot Persistence</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc25ece7b221" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>