<?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 Trisit Chatterjee on Medium]]></title>
        <description><![CDATA[Stories by Trisit Chatterjee on Medium]]></description>
        <link>https://medium.com/@trisitchatterjee?source=rss-79590a4fa1cb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SYXfO2KpSyQIq0jt</url>
            <title>Stories by Trisit Chatterjee on Medium</title>
            <link>https://medium.com/@trisitchatterjee?source=rss-79590a4fa1cb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:51:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@trisitchatterjee/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[Python Decorators — Quick introduction]]></title>
            <link>https://medium.com/@trisitchatterjee/python-decorators-quick-introduction-0cf900fa6ecf?source=rss-79590a4fa1cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/0cf900fa6ecf</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Trisit Chatterjee]]></dc:creator>
            <pubDate>Thu, 11 Jul 2024 21:30:10 GMT</pubDate>
            <atom:updated>2024-07-11T21:30:10.370Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python Decorators — Quick introduction</h3><p>Decorators are one of the most powerful tools that Python supports. They allow you to modify the behaviour of a function or a class. Typically, decorators help extend functionality through existing code in an immaculate and maintainable way. By understanding decorators, you can enhance your code’s flexibility and reusability. This article will delve into what decorators are, how they work, and provide illustrative examples to demonstrate their usage effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eHF5z82ZVyR4tFx3CEUgGQ.jpeg" /></figure><p>The Decorator is an example of metaprogramming, where one writes code preoccupied with other code. In Python, decorators are usually created as functions that take another function as an argument and extend or provide extra functionality. This is to be done without alteration or modification to the source code of the original function. So in that way, it gives a mechanism to attach the desired feature in a reusable manner to functions.</p><p>The simplest form of a Python decorator would be to define inside the definition of the decorator function a wrapper function. The wrapper function is the place where you insert the extended behavior. Here is a basic example of a decorator that prints a message before and after the function call:</p><pre>def my_decorator(func):<br>    def wrapper():<br>        print(&quot;Something is happening before the function is called.&quot;)<br>        func()<br>        print(&quot;Something is happening after the function is called.&quot;)<br>    return wrapper<br><br>@my_decorator<br>def say_hello():<br>    print(&quot;Hello!&quot;)<br><br>say_hello()</pre><p>In this program, my_decorator is a decorator for say_hello. When you call say_hello, the function within my_decorator is called, prints the message at first, then calls the original function say_hello, and finally prints a message afterwards.</p><p>You can also have decorators that accept arguments. Here’s an example of a decorator that repeats a function call a specified number of times:</p><pre>def repeat(num_times):<br>    def decorator_repeat(func):<br>        def wrapper(*args, **kwargs):<br>            for _ in range(num_times):<br>                result = func(*args, **kwargs)<br>            return result<br>        return wrapper<br>    return decorator_repeat<br><br>@repeat(num_times=3)<br>def greet(name):<br>    print(f&quot;Hello, {name}!&quot;)<br><br>greet(&quot;Alice&quot;)</pre><p>The output will be:</p><blockquote>Hello, Alice!</blockquote><blockquote>Hello, Alice!</blockquote><blockquote>Hello, Alice!</blockquote><p>Another very common use of decorators is logging. You can create a decorator that logs the arguments and returns the value of a function:</p><pre>import functools<br><br>def log(func):<br>    @functools.wraps(func)<br>    def wrapper(*args, **kwargs):<br>        print(f&quot;Calling {func.__name__} with args {args} and kwargs {kwargs}&quot;)<br>        result = func(*args, **kwargs)<br>        print(f&quot;{func.__name__} returned {result}&quot;)<br>        return result<br>    return wrapper<br><br>@log<br>def add(a, b):<br>    return a + b<br><br>print(add(3, 5))</pre><p>The output will be like below:</p><blockquote>Calling add with args (3, 5) and kwargs {}</blockquote><blockquote>add returned 8</blockquote><blockquote>8</blockquote><p>In this example, the log decorator uses the functools.wraps decorator to preserve the original function&#39;s metadata. A wrapper function that logs the arguments and return value of the add function. Now, if you call add(3, 5), it&#39;s going to log all the calls with their respective results.</p><h3>Additional Examples and Use Cases</h3><h4>Timing Functions</h4><p>Another practical use case for decorators is timing how long a function takes to execute. This can be very useful for performance testing.</p><pre>import time<br><br>def timer(func):<br>    @functools.wraps(func)<br>    def wrapper(*args, **kwargs):<br>        start_time = time.time()<br>        result = func(*args, **kwargs)<br>        end_time = time.time()<br>        print(f&quot;{func.__name__} took {end_time - start_time:.4f} seconds&quot;)<br>        return result<br>    return wrapper<br><br>@timer<br>def slow_function():<br>    time.sleep(2)<br>    print(&quot;Function complete&quot;)<br><br>slow_function()</pre><p>In this example, the timer decorator measures the time before and after the function execution and prints the duration.</p><h4>Access Control</h4><p>Decorators can also be used for access control in your code. For instance, you can create a decorator to check if a user has the required permissions to execute a function.</p><pre>def requires_permission(permission):<br>    def decorator(func):<br>        @functools.wraps(func)<br>        def wrapper(*args, **kwargs):<br>            user_permissions = get_user_permissions()  # This would be a function to get the current user&#39;s permissions<br>            if permission not in user_permissions:<br>                raise PermissionError(f&quot;User lacks {permission} permission&quot;)<br>            return func(*args, **kwargs)<br>        return wrapper<br>    return decorator<br><br>@requires_permission(&#39;admin&#39;)<br>def delete_user(user_id):<br>    print(f&quot;User {user_id} deleted&quot;)<br><br># Assuming get_user_permissions returns [&#39;admin&#39;]<br>delete_user(42)</pre><p>Here, the requires_permission decorator ensures that the function it decorates can only be called if the current user has the specified permission.</p><p><strong>PS:</strong></p><p>Just in case you are curious how @functools.wraps works?</p><p>@functools.wraps is itself a decorator that takes a function used in a wrapper and updates the wrapper function to look more like the wrapped function by copying attributes such as the name, module, and docstring.</p><p>Here is what @functools.wraps does in detail:</p><ul><li>It copies the original function’s __name__, __module__, __annotations__, and __doc__ attributes to the wrapper function.</li><li>It updates the wrapper function’s __dict__ with the original function’s __dict__.</li></ul><h3>Conclusion</h3><p>In summary, Python decorators are a flexible tool to modify or extend the behaviour of functions and methods, which allows for writing cleaner and more maintainable code. The above examples demonstrate how you can use decorators to do things like print messages, reapply function calls, logging, measure performance, and enforce access control. By working through these examples, you will learn how to use decorators to make your code readable and succinct.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0cf900fa6ecf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NULL & NULL Indicators — DB2 Z/OS]]></title>
            <link>https://medium.com/@trisitchatterjee/null-null-indicators-db2-z-os-a0602566fab8?source=rss-79590a4fa1cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0602566fab8</guid>
            <category><![CDATA[mainframe]]></category>
            <category><![CDATA[db2]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[null]]></category>
            <dc:creator><![CDATA[Trisit Chatterjee]]></dc:creator>
            <pubDate>Fri, 28 Apr 2023 18:54:23 GMT</pubDate>
            <atom:updated>2023-04-28T19:11:02.919Z</atom:updated>
            <content:encoded><![CDATA[<h3>NULL, NULL Indicators &amp; Coalesce— DB2 Z/OS</h3><blockquote>In the world of database management systems, NULL is an important concept to understand. A NULL value represents the absence of a value in a particular column or field of a table. It is often used to indicate that a particular piece of data is unknown, undefined, or not applicable. However, NULL can also cause some challenges in querying and manipulating data, as its use requires special handling and attention.</blockquote><blockquote>In DB2 z/OS, the handling of NULL values is done through the use of NULL indicators and the COALESCE function. In this article, we will explore what NULL values are, how they are represented in DB2 z/OS, and how NULL indicators and COALESCE can be used to work with NULL values in DB2 z/OS.</blockquote><blockquote>Lets see in details.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*lZRF3kQMiYYYVDKT0ggWYg.jpeg" /></figure><p><strong>What is NULL?</strong></p><p>In the context of databases, NULL is a special value that represents the absence of a value in a particular field or column of a table. It is not the same as zero, an empty string, or a space character, as these all represent actual values. Instead, NULL is used to indicate that a particular piece of data is unknown, undefined, or not applicable.</p><p>For example, in a customer database, there might be a field for the customer’s middle initial. However, not all customers might have a middle initial, so in these cases, the field would be set to NULL to indicate the absence of a value.</p><p>NULL is not the same as “blank” or “empty”. A blank or empty value represents a valid value, whereas NULL indicates the absence of a value. It is important to keep this distinction in mind when working with NULL values in a database.</p><p><strong>How are NULL values represented in DB2 z/OS?</strong></p><p>In DB2 z/OS, NULL values are represented using a special bit called a NULL indicator. The NULL indicator is a single bit that is associated with each column in a table that can contain NULL values. The value of the NULL indicator is set to 0 if the column contains a value, and set to 1 if the column contains a NULL value.</p><p>For example, let’s say we have a table called “<strong>Customers</strong>” with the following columns:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*F0DjbXnSppCXyVBN0CoY7Q.png" /></figure><p>If a particular row in the Customers table has a NULL value in the MiddleInitial column, the corresponding NULL indicator bit for that column would be set to 1.</p><p><strong>How can NULL indicators be used in DB2 z/OS?</strong></p><p>NULL indicators are used in DB2 z/OS to indicate the presence or absence of a value in a particular column of a table. They are typically used in SQL queries to handle NULL values in a consistent manner.</p><p>For example, let’s say we want to retrieve all the customers from the Customers table, but only want to include those with a middle initial. We can use a NULL indicator in our SQL query to accomplish this:</p><blockquote>SELECT * FROM Customers WHERE MiddleInitial IS NOT NULL;</blockquote><p>In this query, we are checking the value of the NULL indicator for the MiddleInitial column. If the NULL indicator is set to 1 (indicating a NULL value), the corresponding row will be excluded from the results.</p><p>To use a NULL indicator with this column, we need to define a NULL indicator variable in our application code. Here’s an example in COBOL:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*RFk8bdnjUQOUK-p7GMV11A.png" /></figure><p>In this example, we have defined a COBOL data structure called “CUSTOMER-REC” that corresponds to a row in the “Customers” table. The “MIDDLEINITIAL” column is defined as a one-byte character field, and we have also defined a “MI-INDICATOR” field that will hold the NULL indicator value for the “MIDDLEINITIAL” column.</p><p>When we retrieve data from the “Customers” table, we need to make sure that we retrieve both the “MIDDLEINITIAL” column and the associated NULL indicator value. Here’s an example COBOL program that retrieves customer data from the “Customers” table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*20pHIvbHuIBs406uAbS4Tw.png" /></figure><p>In this example, we are using embedded SQL to retrieve customer data from the “Customers” table. We are selecting the “CustomerID”, “FirstName”, “LastName”, “MiddleInitial”, and “MI_Indicator” columns from the table, and we are using the INTO clause to store the results in the “CUSTOMER-REC” data structure.</p><p>When the SQL statement is executed, the DB2 z/OS system will automatically set the value of the “MI_Indicator” field to indicate whether the “MiddleInitial” column contains a NULL value or not. If the “MiddleInitial” column contains a NULL value, the value of “MI_Indicator” will be set to -1. Otherwise, it will be set to 0.</p><p>By using a NULL indicator in this way, we can ensure that our application code can handle NULL values in a consistent and reliable manner. We can use the value of the NULL indicator to check whether the “MiddleInitial” column contains a NULL value, and we can take appropriate action based on that information.</p><p><strong>How can the COALESCE function be used in DB2 z/OS?</strong></p><p>The COALESCE function is used in DB2 z/OS to handle NULL values in SQL queries. It returns the first non-NULL value in a list of expressions.</p><p>The syntax for the COALESCE function is as follows:</p><blockquote>COALESCE(expression1, expression2, …, expressionN)</blockquote><p>The COALESCE function takes a list of expressions as arguments. It returns the first expression in the list that is not NULL. If all the expressions in the list are NULL, the COALESCE function returns NULL.</p><p>Here’s an example of using COALESCE in a SQL query:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*7B0xDVc1M5RJMVlH46f6_g.png" /></figure><p>In this query, we are selecting the MiddleInitial column from the Customers table, but if a NULL value is encountered, we will substitute it with the string “N/A”. The result set will include a column called “MI” that contains either the middle initial or “N/A” if the MiddleInitial column contains a NULL value.</p><p>COALESCE can also be used to perform more complex operations involving multiple columns.</p><p>For example, let’s say we have a table called “<strong>Orders</strong>” with the following columns:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*lyzMS-YbOx7uBqRNnp5PSw.png" /></figure><p>If we want to retrieve a list of orders along with the corresponding customer names, we can use the COALESCE function to handle cases where the customer name is NULL:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*3A3l7jZHhQCVtFRGQdE58A.png" /></figure><p>In this query, we are joining the Orders and Customers tables and selecting the OrderID, customer name (concatenated from the FirstName, MI, and LastName columns), OrderDate, and OrderTotal columns. We are also using COALESCE to handle cases where the MiddleInitial column contains a NULL value. If a NULL value is encountered, the COALESCE function will return an empty string instead.</p><h3><strong>Conclusion</strong></h3><p>NULL values are an important concept to understand in the context of databases, as they can indicate the absence of a value in a particular field or column. In DB2 z/OS, NULL values are represented using a NULL indicator bit, which is associated with each column in a table that can contain NULL values.</p><p>NULL indicators are used in SQL queries to handle NULL values in a consistent manner. The COALESCE function is also used in SQL queries to handle NULL values, returning the first non-NULL value in a list of expressions. By understanding how NULL values are represented and how NULL indicators and COALESCE can be used in SQL queries, developers and database administrators can ensure their databases are designed and managed in an effective and efficient manner.</p><p>===============================================================</p><p>If you like this article please share with your colleagues/friends.</p><p>My LinkedIn Page — <a href="https://www.linkedin.com/in/trisitchatterjee/">Link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0602566fab8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Map Reduce Programming Paradigm and its successors]]></title>
            <link>https://medium.com/@trisitchatterjee/map-reduce-programming-paradigm-and-its-successors-c8780433e955?source=rss-79590a4fa1cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8780433e955</guid>
            <category><![CDATA[mapreduce]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Trisit Chatterjee]]></dc:creator>
            <pubDate>Wed, 26 Apr 2023 21:42:03 GMT</pubDate>
            <atom:updated>2023-04-26T21:44:35.829Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*apyOMwJMG9Oh4Q8YnMFj7g.jpeg" /></figure><p><em>Image Source — Unsplash.com</em></p><h4>MapReduce is a programming model used to process and generate large amounts of data in parallel. The MapReduce model divides a large data set into smaller subsets and processes each subset in parallel. This model allows large data sets to be processed quickly and efficiently. The basic steps involved in executing a MapReduce job are as follows:</h4><p>1. Splitting the input data<br>The first step in executing a MapReduce job is to split the input data into smaller subsets. Each subset is called an input split. The input splits are usually of equal size and are processed independently. The input splits are passed to the mappers.</p><p>2. Mapping<br>The mapper is the first stage of the MapReduce job. The mapper processes the input data and generates a set of key-value pairs. Each key-value pair represents an intermediate result. The mapper applies a map function to each input split. The map function takes as input a key-value pair and generates a set of intermediate key-value pairs. The intermediate key-value pairs are then passed to the shuffle stage.</p><p>3. Shuffle<br>The shuffle stage is responsible for sorting and grouping the intermediate key-value pairs generated by the mappers. The shuffle stage is divided into two sub-stages: sorting and grouping.</p><p>3.1 Sorting<br>The sorting stage sorts the intermediate key-value pairs based on the keys. The sorted key-value pairs are then passed to the grouping stage.</p><p>3.2 Grouping<br>The grouping stage groups the sorted key-value pairs based on the keys. All key-value pairs with the same key are grouped together. The grouped key-value pairs are then passed to the reducers.</p><p>4. Reducing<br>The reducer is the second stage of the MapReduce job. The reducer processes the grouped key-value pairs and generates a set of output key-value pairs. The reducer applies a reduce function to each group of key-value pairs. The reduce function takes as input a key and a set of values and generates a set of output key-value pairs. The output key-value pairs are then written to the output.</p><h4>Now, let’s consider an example of a MapReduce job to count the number of occurrences of each word in a large text file. The input data is a large text file containing a set of documents. The objective is to count the number of occurrences of each word in the text file.</h4><p>1. Splitting the input data<br>The input text file is split into several input splits. Each input split contains a subset of the input data.</p><p>2. Mapping<br>Each input split is processed by a separate mapper. The mapper reads the input split and generates a set of key-value pairs. The key is the word and the value is 1. For example, if the input split contains the text “Hello World”, the mapper generates two key-value pairs: “Hello,1” and “World,1”.</p><p>3. Shuffle<br>The intermediate key-value pairs generated by the mappers are sorted and grouped by the shuffle stage. All key-value pairs with the same key are grouped together. For example, all key-value pairs with the key “Hello” are grouped together.</p><p>4. Reducing<br>Each group of key-value pairs is processed by a separate reducer. The reducer sums up the values for each key to generate the output key-value pairs. For example, if the group of key-value pairs contains “Hello,1” and “Hello,1”, the reducer generates the output key-value pair “Hello,2”. The output key-value pairs are written to the output.</p><h4>Summary</h4><p>The MapReduce model is widely used for processing and analyzing large-scale data sets due to its ability to handle large amounts of data efficiently. By dividing the input data into smaller subsets, MapReduce allows for parallel processing, which significantly reduces processing time. The MapReduce model consists of four basic steps: splitting the input data, mapping, shuffle, and reducing. The mapping stage generates a set of intermediate key-value pairs, which are sorted and grouped in the shuffle stage. The reducing stage generates the final output by processing the grouped key-value pairs. MapReduce has been used in various industries such as e-commerce, finance, and healthcare to process and analyze large data sets.</p><h4>What are the successors of Map Reduce?</h4><p>With the increasing demand for faster processing and more efficient use of resources, new technologies and frameworks have emerged as successors to MapReduce. Some of these successors and cloud technologies include:</p><p>1. <strong>Apache Spark</strong>: Apache Spark is a popular open-source data processing framework that has gained popularity due to its speed and scalability. It provides a unified framework for processing data in a distributed manner and supports various data sources such as Hadoop Distributed File System (HDFS), Apache Cassandra, and Amazon S3. It also provides APIs for processing data in batch, real-time, and machine learning workloads.</p><p>2. <strong>Apache Flink</strong>: Apache Flink is another popular open-source data processing framework that focuses on stream processing and real-time analytics. It supports both batch and stream processing and provides APIs for processing data in a distributed and fault-tolerant manner. Flink is known for its low-latency processing and support for event-time processing.</p><p>3. <strong>Apache Hadoop YARN</strong>: Apache Hadoop YARN (Yet Another Resource Negotiator) is a cluster management technology that provides a resource management layer for Hadoop. It allows different processing frameworks such as MapReduce, Spark, and Flink to share the same cluster and resources, thereby providing better resource utilization and reducing operational costs.</p><p>4. <strong>Cloud-native data processing services</strong>: Many cloud providers such as Amazon Web Services (AWS), Google Cloud Platform (GCP), and Microsoft Azure provide managed services for data processing and analytics. These services include AWS Elastic MapReduce (EMR), GCP Dataflow, and Azure HDInsight. These services provide a fully managed platform for processing and analyzing data without the need for managing infrastructure.</p><p>In summary, while MapReduce is still popular, new technologies and cloud services have emerged as successors to provide faster processing, better scalability, and more efficient use of resources. These technologies include Apache Spark, Apache Flink, Apache Hadoop YARN, and cloud-native data processing services.</p><p>===============================================================</p><p>If you like this small article please share on LinkedIn.</p><p>My LinkedIn Page — <a href="https://www.linkedin.com/in/trisitchatterjee/">Link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8780433e955" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kanban and Scrum — A brief comparative study]]></title>
            <link>https://medium.com/@trisitchatterjee/kanban-and-scrum-a-brief-comparative-study-4b47a0edb2f2?source=rss-79590a4fa1cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b47a0edb2f2</guid>
            <category><![CDATA[kanban]]></category>
            <category><![CDATA[scrum]]></category>
            <category><![CDATA[agile-methodology]]></category>
            <dc:creator><![CDATA[Trisit Chatterjee]]></dc:creator>
            <pubDate>Sun, 23 Apr 2023 11:51:58 GMT</pubDate>
            <atom:updated>2023-04-23T11:51:58.135Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kanban and Scrum — A brief comparative study</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*irWB6S2tW_8L1mbFN-Za6g.jpeg" /></figure><blockquote>Kanban and Scrum are two popular project management frameworks that are widely used in software development and other industries. Both frameworks have unique features and benefits, and choosing the right one depends on the specific needs and requirements of the project. In this comparative study, we will discuss the similarities and differences between Kanban and Scrum and their suitability for different types of projects.</blockquote><h3>Overview of Kanban and Scrum</h3><p>Kanban is a visual project management system that focuses on continuous delivery and improvement. It was originally developed by Toyota in the 1940s for use in manufacturing, and later adapted for software development. Kanban emphasizes transparency, flow, and pull-based work systems, where work is pulled through the process based on demand.</p><p>Scrum, on the other hand, is an agile framework that focuses on delivering high-quality products incrementally and iteratively. It was developed in the 1990s for software development and is based on empirical process control theory. Scrum emphasizes collaboration, self-organization, and adaptive planning, and is often used for complex projects with changing requirements.</p><p>Now, let’s take a closer look at the similarities and differences between Kanban and Scrum.</p><p><strong>Similarities between Kanban and Scrum</strong></p><ol><li>Agile principles: Both Kanban and Scrum are based on the Agile principles, which emphasize customer satisfaction, working software, and collaboration between the development team and stakeholders.</li><li>Iterative and incremental approach: Both frameworks follow an iterative and incremental approach, where work is delivered in small increments and feedback is obtained regularly.</li><li>Visual management: Both frameworks use visual management techniques to improve transparency and make work visible to the team and stakeholders.</li><li>Continuous improvement: Both frameworks emphasize continuous improvement and encourage the team to adapt to changing requirements and improve their processes.</li></ol><p><strong>Differences between Kanban and Scrum</strong></p><ol><li>Roles and responsibilities: Kanban does not prescribe specific roles and responsibilities, whereas Scrum has three main roles: Product Owner, Scrum Master, and Development Team. In Kanban, the team is responsible for the entire process, from planning to delivery.</li><li>Planning and estimation: Scrum uses fixed-length sprints, typically two to four weeks, and requires the team to plan and estimate the work for each sprint. Kanban, on the other hand, does not require fixed-length iterations and allows work to be pulled through the process based on demand.</li><li>Work items: In Scrum, work items are defined as user stories and added to the product backlog. In Kanban, work items can take any form and are added to the board as they arise.</li><li>Workflow management: Scrum uses a predefined workflow, consisting of several stages, including planning, sprint, review, and retrospective. Kanban, on the other hand, allows for flexible workflows and focuses on optimizing flow and reducing lead time.</li></ol><h3>Suitability for Different Types of Projects</h3><p>Kanban and Scrum have different strengths and weaknesses, and choosing the right framework depends on the specific needs and requirements of the project. Here are some guidelines for when to use Kanban and when to use Scrum:</p><p><strong>When to use Kanban</strong>:</p><ol><li>Projects with changing priorities: Kanban is well-suited for projects with changing priorities, where work needs to be pulled through the process based on demand.</li><li>Projects with a high volume of work: Kanban is ideal for projects with a high volume of work, where it is important to optimize flow and reduce lead time.</li><li>Continuous improvement focus: Kanban is suitable for teams that are focused on continuous improvement and want to optimize their workflows over time.</li><li>Small teams: Kanban is well-suited for small teams that are self-organizing and do not require a predefined process.</li></ol><p><strong>When to use Scrum</strong>:</p><ol><li>Complex projects: Scrum is well-suited for complex projects with changing requirements, where an adaptive and iterative approach is necessary.</li><li>Projects with a fixed timeline: Scrum is ideal for projects with a fixed timeline, as it allows for predictable delivery and regular feedback.</li><li>Team-based projects: Scrum is suitable for team-based projects, where collaboration, communication, and transparency are essential.</li><li>Projects with predefined workflows: Scrum is well-suited for projects with predefined workflows, where it is important to follow a specific process to deliver high-quality products.</li></ol><h3>Some scenarios to understand the concepts</h3><p>Let’s say you are working on a software development project to create a new mobile app. Here are some scenarios that could help illustrate the differences between Kanban and Scrum.</p><p><strong>Scenario 1: Changing Priorities</strong></p><p>Imagine that the client has requested a change in the app’s design midway through the project. The change is urgent and needs to be implemented as soon as possible.</p><p>In this scenario, Kanban would be better suited for the project because it allows for work to be pulled through the process based on demand. The team could add the new design requirement to the Kanban board and prioritize it accordingly. The team could then work on the new design requirement while continuing to work on the other tasks on the board. This approach would allow the team to be more responsive to changing priorities and deliver value to the client as soon as possible.</p><p>In Scrum, the change in design requirements would need to wait until the next sprint planning session. The team would need to estimate the effort required to implement the change, prioritize it with the other user stories in the product backlog, and plan it for the next sprint. This approach would be more rigid and less responsive to changing priorities.</p><p><strong>Scenario 2: Predictable Delivery</strong></p><p>Imagine that the client has a fixed deadline for the app’s release and wants to ensure that the team can deliver the app on time.</p><p>In this scenario, Scrum would be better suited for the project because it allows for predictable delivery and regular feedback. The team could use the fixed-length sprints to plan and estimate the work for each sprint and deliver working software at the end of each sprint. The Scrum framework provides regular opportunities for the team to review progress, obtain feedback, and adjust their plans accordingly. This approach would allow the team to deliver the app on time and with the desired level of quality.</p><p>In Kanban, there is no fixed timeline for delivery, and work is pulled through the process based on demand. While Kanban does provide opportunities for continuous improvement and regular feedback, it may not be as well-suited for projects with fixed timelines and deadlines.</p><p><strong>Scenario 3: Team-Based Collaboration</strong></p><p>Imagine that the mobile app project requires close collaboration between the development team and the client’s marketing team.</p><p>In this scenario, Scrum would be better suited for the project because it emphasizes team-based collaboration, communication, and transparency. The Scrum framework provides regular opportunities for the development team and the client’s marketing team to review progress, provide feedback, and adjust their plans accordingly. The Product Owner role in Scrum is responsible for managing the client’s requirements and providing feedback to the development team. The Scrum Master role is responsible for facilitating communication and collaboration between the team members. This approach would allow the team to work closely with the client’s marketing team to ensure that the app meets their needs and requirements.</p><p>In Kanban, the team is responsible for the entire process, and there is no specific role for managing the client’s requirements or facilitating communication between the team members. While Kanban does provide opportunities for collaboration and transparency, it may not be as well-suited for projects that require close collaboration between different teams.</p><p><strong>Conclusion</strong></p><p>In summary, Kanban and Scrum are two popular project management frameworks that have unique features and benefits. Kanban is ideal for projects with changing priorities, a high volume of work, and a focus on continuous improvement. Scrum is well-suited for complex projects with changing requirements, a fixed timeline, and team-based collaboration. The choice between Kanban and Scrum depends on the specific needs and requirements of the project, and each framework has its own strengths and weaknesses. By understanding the differences between Kanban and Scrum, you can choose the right framework for your project and tailor it to the specific needs of your team and organization to achieve the desired results.</p><p>It is worth noting that many organizations use a hybrid approach, combining elements of both Kanban and Scrum to create a custom framework that meets their unique needs. For example, some teams use Kanban for their daily work and Scrum for their longer-term planning and delivery. Others may use Scrum for their development process and Kanban for their operations or support work. The key is to choose the right framework for your team and adapt it as necessary to meet your specific needs.</p><p>In conclusion, both Kanban and Scrum are effective project management frameworks that can help improve productivity, collaboration, and quality in software development and other industries. While they have different approaches and strengths, they share the same goal of delivering value to the customer in a timely and efficient manner. By understanding the differences between Kanban and Scrum, you can choose the right framework for your team and organization and tailor it to meet your specific needs.</p><p>===============================================================</p><p>If you like this article please share on LinkedIn.</p><p>My LinkedIn profile — <a href="https://www.linkedin.com/in/trisitchatterjee/">Link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b47a0edb2f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DAGs in the context of Apache Spark]]></title>
            <link>https://medium.com/@trisitchatterjee/dags-in-the-context-of-apache-spark-5c064e460df1?source=rss-79590a4fa1cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c064e460df1</guid>
            <category><![CDATA[apache-spark-rdd]]></category>
            <category><![CDATA[directed-acyclic-graph]]></category>
            <category><![CDATA[apache-spark]]></category>
            <dc:creator><![CDATA[Trisit Chatterjee]]></dc:creator>
            <pubDate>Sat, 22 Apr 2023 16:10:15 GMT</pubDate>
            <atom:updated>2023-04-22T16:10:15.205Z</atom:updated>
            <content:encoded><![CDATA[<h4>Apache Spark is a distributed computing framework that allows processing of large-scale data sets in a distributed manner. One of the key features of Spark is its ability to perform complex data transformations using a Directed Acyclic Graph (DAG) execution engine. In this context, a DAG is used to represent the logical flow of computations that need to be executed on the data.</h4><p>A Spark application is typically composed of several transformations and actions that need to be executed on the data. Transformations are operations that take one or more input data sets and produce an output data set, while actions are operations that produce some output or result. For example, a transformation might involve filtering, mapping, or aggregating data, while an action might involve counting, collecting, or saving data.</p><p>When a Spark application is submitted, the transformations and actions are translated into a logical DAG. This DAG represents the sequence of operations that need to be executed on the data to produce the desired output. The DAG is then optimized and partitioned into stages, which are groups of tasks that can be executed in parallel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*V3FpKWDewxRkbKOqfrtvcg.jpeg" /></figure><p><em>Image Source — https://spark.apache.org/docs/3.0.0/web-ui.html</em></p><p>The DAG optimization process involves applying a set of rules to the DAG to improve its performance. For example, the DAG might be optimized by combining multiple transformations into a single operation, or by reordering operations to reduce data shuffling. The optimized DAG is then partitioned into stages, which are groups of tasks that can be executed in parallel. The partitioning process involves analyzing the dependencies between transformations and grouping them together to minimize data movement and maximize parallelism.</p><p>Once the DAG is optimized and partitioned, it is then submitted to the Spark cluster for execution. Each stage is then divided into tasks, which are individual units of work that can be executed on different nodes in the cluster. The tasks are then scheduled and executed in parallel across the cluster, with each task reading data from its input partition, performing the transformation or action, and writing the output to its output partition.</p><p>As the tasks are executed, the Spark DAG execution engine tracks their progress and monitors their performance. This information is used to dynamically allocate resources to the different stages and tasks, based on the amount of data being processed and the available resources in the cluster. This allows Spark to automatically scale up or down based on the workload and optimize the performance of the application.</p><p>One of the key advantages of using a DAG execution engine in Spark is that it allows for efficient parallelization of complex data transformations. The DAG represents the logical flow of computations and allows Spark to optimize and partition the operations in a way that minimizes data movement and maximizes parallelism. This can result in significant performance improvements compared to traditional batch processing frameworks that lack this capability.</p><p>Another advantage of using a DAG execution engine is that it allows for fault-tolerant processing of data. When a task fails or a node goes down, Spark can automatically recover the lost work by re-executing the failed task on a different node. This is achieved by maintaining lineage information for each partition, which allows Spark to track the dependencies between the different transformations and actions and recompute lost data as needed.</p><p>In conclusion, Apache Spark uses a Directed Acyclic Graph (DAG) execution engine to efficiently process large-scale data sets in a distributed manner. The DAG represents the logical flow of computations and allows Spark to optimize and partition the operations in a way that minimizes data movement and maximizes parallelism. This can result in significant performance improvements compared to traditional batch processing frameworks. Additionally, the DAG execution engine allows for fault-tolerant processing of data by maintaining lineage information and re-executing failed tasks as needed.</p><p>===============================================================</p><p>If you like this small article please share on LinkedIn.</p><p>My LinkedIn Page — <a href="https://www.linkedin.com/in/trisitchatterjee/">Link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c064e460df1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>