<?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 Ashish Mishra on Medium]]></title>
        <description><![CDATA[Stories by Ashish Mishra on Medium]]></description>
        <link>https://medium.com/@arglee?source=rss-16fea3dfb80f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gtRMfDWZmOyf1B30kj8V8Q.jpeg</url>
            <title>Stories by Ashish Mishra on Medium</title>
            <link>https://medium.com/@arglee?source=rss-16fea3dfb80f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 21:48:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arglee/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[Beyond Human Eyes: How Docstrings Are Becoming the Interface Between Your Code and AI Agents]]></title>
            <link>https://arglee.medium.com/beyond-human-eyes-how-docstrings-are-becoming-the-interface-between-your-code-and-ai-agents-d96b8eb57287?source=rss-16fea3dfb80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d96b8eb57287</guid>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Ashish Mishra]]></dc:creator>
            <pubDate>Thu, 22 May 2025 18:50:10 GMT</pubDate>
            <atom:updated>2025-05-23T03:42:25.091Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>In software development, documentation has traditionally been written by developers, for developers.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pykzHcg0yIhykzy5" /><figcaption>Photo by <a href="https://unsplash.com/@santesson89?utm_source=medium&amp;utm_medium=referral">Andrea De Santis</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>We’ve long understood the value of well-crafted docstrings and comments in making our code maintainable and accessible to our human collaborators.</p><p>But a subtle yet profound shift is happening in the software development landscape:</p><blockquote>Docstrings are no longer just for us humans — they’re becoming a critical interface for AI agents to understand, interact with, and extend our code.</blockquote><h4>The Dual Audience of Modern Code Documentation</h4><p>For decades, we’ve preached the gospel of good documentation as a courtesy to our future selves and colleagues.</p><p>“<strong><em>Code tells you how, comments tell you why.</em></strong>”</p><p>But today, we need to recognize that our documentation serves two distinct audiences:<strong><em> human developers and AI systems</em></strong> that increasingly participate in the development process.</p><p>When I first started programming, documentation was purely a human-to-human communication tool. I’d write docstrings to explain my intentions, guide implementation decisions, and document edge cases. The docstrings I wrote were informal, sometimes inconsistent, and focused on conveying meaning to another person who would read them.</p><p>Now, I find myself crafting documentation with a different mindset. I’m not just writing for the junior developer who might maintain my code next year — I’m writing for AI assistants that will analyze, suggest improvements to, and even extend my code tomorrow.</p><h4>How AI Agents Consume Documentation</h4><p>Unlike humans, AI agents don’t skim documentation or read between the lines. They process it systematically, extracting structured information that shapes their understanding of your code’s functionality, parameters, and behavior.</p><p>When an AI agent encounters a function like this:</p><pre>def calculate_tax(income: float, tax_rate: float = 0.2) -&gt; float:<br>    &quot;&quot;&quot;<br>    Calculate the tax amount based on income and tax rate.<br>    <br>    Args:<br>        income (float): The total taxable income<br>        tax_rate (float, optional): The tax rate as a decimal. Defaults to 0.2<br>        <br>    Returns:<br>        float: The calculated tax amount<br>        <br>    Raises:<br>        ValueError: If income or tax_rate is negative<br>    &quot;&quot;&quot;<br>    if income &lt; 0 or tax_rate &lt; 0:<br>        raise ValueError(&quot;Income and tax rate must be non-negative&quot;)<br>    return income * tax_rate</pre><p>It doesn’t just see text — it extracts a structured representation that includes:<br>- The function’s purpose<br>- Required and optional parameters with their types<br>- Return value type and description<br>- Potential exceptions</p><p>This structured information becomes crucial for AI systems to generate appropriate calls to your functions, suggest improvements, or integrate your code with other components.</p><h4>Docstrings as Function Schemas for AI</h4><p><a href="https://platform.openai.com/docs/guides/function-calling?api-mode=chat">OpenAI’s function calling </a>capability, introduced in their API, demonstrates how docstrings can serve as the bridge between human-written code and AI capabilities. The system uses function schemas that look remarkably similar to well-structured docstrings.</p><p>Consider how an AI agent might transform the above docstring into a function schema:</p><pre>{<br>  &quot;name&quot;: &quot;calculate_tax&quot;,<br>  &quot;description&quot;: &quot;Calculate the tax amount based on income and tax rate.&quot;,<br>  &quot;parameters&quot;: {<br>    &quot;type&quot;: &quot;object&quot;,<br>    &quot;properties&quot;: {<br>      &quot;income&quot;: {<br>        &quot;type&quot;: &quot;number&quot;,<br>        &quot;description&quot;: &quot;The total taxable income&quot;<br>      },<br>      &quot;tax_rate&quot;: {<br>        &quot;type&quot;: &quot;number&quot;,<br>        &quot;description&quot;: &quot;The tax rate as a decimal&quot;,<br>        &quot;default&quot;: 0.2<br>      }<br>    },<br>    &quot;required&quot;: [&quot;income&quot;]<br>  }<br>}</pre><p>This transformation isn’t coincidental — it’s by design. The structured nature of <a href="https://github.com/dadadel/pyment/tree/master?tab=readme-ov-file#example">modern docstring</a> formats like Google, NumPy, or reST style was already moving toward machine readability before AI agents became prevalent.</p><h4>Writing Documentation for AI Consumption</h4><p>So how should we adapt our documentation practices for this dual audience? Here are some principles I’ve developed in my work:</p><p><strong>1. Embrace Consistency and Structure</strong></p><p>AI agents process documentation more effectively when it follows consistent patterns. Pick a docstring format (Google, NumPy, reST) and adhere to it rigorously across your codebase. Tools like <a href="https://github.com/pydantic/pydantic/discussions/10106">Pydantic already leverage docstrings</a> as field descriptions when generating JSON schemas.</p><p><strong>2. Be Explicit About Types and Constraints</strong></p><p>Type hints in Python code are valuable, but explaining constraints in docstrings provides additional context that AI agents can use:</p><pre>def create_user(username: str, age: int) -&gt; User:<br>    &quot;&quot;&quot;<br>    Create a new user in the system.<br>    <br>    Args:<br>        username (str): Username for the account. Must be 3-20 alphanumeric characters.<br>        age (int): User&#39;s age in years. Must be between 13 and 120.<br>    <br>    Returns:<br>        User: The created user object<br>    &quot;&quot;&quot;</pre><p>This explicit information about valid input ranges helps AI agents generate appropriate test cases, validate inputs, or suggest improvements.</p><p><strong>3. Document the “Why” and “When”</strong></p><p>AI agents can often infer what code does, but they need help understanding why decisions were made or when to use particular approaches:</p><pre>def legacy_format_address(address_obj):<br>    &quot;&quot;&quot;<br>    Formats address according to legacy system requirements.<br>    <br>    Note: Use only when integrating with pre-2020 systems. For newer systems,<br>    use the AddressFormatter class instead.<br>    &quot;&quot;&quot;</pre><p>This contextual information helps AI assistants make appropriate recommendations about when to use different parts of your codebase.</p><h4>Documentation-Driven AI Assistance</h4><p>The investment in <a href="https://zencoder.ai/blog/ai-enhanced-docstring-comment-generation">better documentation yields dividend</a>s when working with AI coding assistants.</p><p>Consider these use cases:</p><p><strong>1. Automatic test generation</strong>: AI agents can use docstrings to understand function behavior and generate comprehensive test suites that cover edge cases described in the documentation.</p><p><strong>2. Smart code completion:</strong> Well-documented functions enable AI assistants to suggest appropriate function calls based on the documented behavior and parameter requirements.</p><p><strong>3. Self-documenting APIs:</strong> AI agents can generate client libraries and documentation for APIs based on the docstrings in your backend code.</p><p><strong>4. Code refactoring assistance: </strong>When you need to refactor complex systems, AI agents can use docstrings to understand intent and preserve behavior while suggesting structural improvements.</p><h4>The Future of Documentation in an AI-Enhanced Development Environment</h4><p>Looking ahead, I see several trends emerging:</p><p><strong>1. Documentation verification tools</strong> will validate that docstrings accurately reflect the code’s behavior and match the expected format for AI consumption.</p><p><strong>2. Bidirectional documentation flows</strong> will emerge, where AI agents not only consume docstrings but also suggest improvements to make them more complete and accurate.</p><p><strong>3. Documentation-first development </strong>approaches will gain popularity, where developers write comprehensive docstrings before implementing functions — enabling AI assistants to generate implementation drafts based on the specifications.</p><p><strong>4. Semantic documentation standards</strong> will evolve to better capture intent, business rules, and domain knowledge in a format accessible to both humans and AI.</p><h4>Conclusion: A New Documentation Philosophy</h4><p>The shift toward documentation that serves both human and AI audiences requires a subtle but important change in how we approach documentation.</p><p>It’s no longer sufficient to view documentation as an afterthought or a nice-to-have — it’s becoming the primary interface through which AI agents understand and interact with our code.</p><p>By investing in clear, structured documentation that follows consistent patterns, we not only help our human teammates but also enable AI assistants to become more capable partners in the development process. The docstrings we write today are becoming the API through which our code communicates with an increasingly intelligent ecosystem of development tools.</p><p>The next time you document a function, remember: you’re not just writing for the developer who’ll maintain your code — <strong>you’re defining how AI agents will understand, test, extend, and integrate your code into the broader software ecosystem</strong>. Documentation is evolving from a courtesy to a crucial interface specification, and those who master this dual-audience documentation will gain a significant advantage in an AI-augmented development world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d96b8eb57287" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You Are Too Busy to Be a Leader!]]></title>
            <link>https://arglee.medium.com/you-are-too-busy-to-be-a-leader-6d9c1c6c3e7c?source=rss-16fea3dfb80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d9c1c6c3e7c</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[team-management]]></category>
            <category><![CDATA[organization]]></category>
            <category><![CDATA[pshychology]]></category>
            <dc:creator><![CDATA[Ashish Mishra]]></dc:creator>
            <pubDate>Thu, 01 May 2025 16:59:12 GMT</pubDate>
            <atom:updated>2025-05-01T17:55:58.074Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K8yrgRgL2huQiu4eEWILyA.png" /><figcaption>Let’s talk about leaders.</figcaption></figure><blockquote>Bragging about busyness and overwork triggers the same pleasure centers in our brains as food and money.</blockquote><p>-According to research in the <a href="https://www.wsj.com/articles/the-cult-of-busy-1428080581"><strong>Wall Street Journal</strong></a><strong>.</strong></p><blockquote>“I am busy.”</blockquote><blockquote>“I’m juggling a million things at once!”</blockquote><blockquote>“I am working 18 hours daily for this week.”</blockquote><p>If this sounds familiar to you or your team, it’s time to pause and reflect. As Robin S. Sharma wisely noted:</p><blockquote>Leadership is not about a title or a designation. It’s about impact, influence, and inspiration.</blockquote><h4>The Busyness Epidemic</h4><p>Being perpetually busy has become our default state. When asked “<em>How are you?</em>”, nearly 8 out of 10 people respond with “Busy”.</p><p>According to <a href="https://hbr.org/2023/03/beware-a-culture-of-busyness">a small experiment conducted by Nora Rosendahl, COO of Hintsa</a>. We’ve reached a point where busyness is conflated with importance, productivity, and even success.</p><p>But here’s the uncomfortable truth: wearing busyness as a badge of honor isn’t something to be proud of. In fact, research published in <strong>Personnel Psychology</strong> in 2024 found that “<strong>stress bragging</strong>” or <strong>“busy bragging</strong>” makes people appear less competent and less likable to colleagues. Even worse, this behavior creates a stress ripple effect that increases burnout among team members.</p><h4>Creativity Needs Space</h4><p>When we’re constantly busy, our <a href="https://www.forbes.com/sites/forbestechcouncil/2021/04/09/pandemic-fuels-global-growth-of-entrepreneurship-and-startup-frenzy/?sh=6fbc6dfd7308">creativity suffers</a>. During the pandemic, we saw a <a href="https://www.forbes.com/sites/forbestechcouncil/2021/04/09/pandemic-fuels-global-growth-of-entrepreneurship-and-startup-frenzy/?sh=6fbc6dfd7308">surprising surge in startups and entrepreneurial ventures</a>. Why? Because for many, the disruption created space for observation and imagination — the two essential ingredients for creativity.</p><p>As noted in a Forbes article,</p><blockquote>“Humans have always been creative — as problem-solvers, if nothing else.”</blockquote><p>But we need mental space for this creativity to flourish. Another study published in Forbes found that</p><blockquote>“The more stuff we have, the less creative we are.”</blockquote><p>This applies to our schedules as well — when they’re overstuffed, our innovative thinking diminishes.</p><h4>The Research Is Clear: Long Hours Backfire</h4><p><a href="https://hbr.org/2015/08/the-research-is-clear-long-hours-backfire-for-people-and-for-companies">Harvard Business Review has emphasized repeatedly that long hours backfire</a> for both individuals and organizations. Extended work hours don’t just diminish returns — they actively harm performance, wellbeing, and organizational outcomes.</p><p>What’s particularly interesting is that according to research in the <a href="https://www.wsj.com/articles/the-cult-of-busy-1428080581"><strong>Wall Street Journal</strong></a><strong>:</strong></p><blockquote>Bragging about busyness and overwork triggers the same pleasure centers in our brains as food and money.</blockquote><p>We get a neurological reward from appearing <a href="https://www.forbes.com/sites/daviddisalvo/2015/11/19/study-the-more-stuff-we-have-the-less-creative-we-are/?sh=679716f4505c">busy</a>, even when that busyness undermines our effectiveness.</p><h4>The Pareto Principle: Your Leadership Lifeline</h4><p>The solution to the busyness trap is hidden in plain sight — the 80/20 rule, also known as the Pareto Principle. Named after Italian economist <strong><em>Vilfredo Pareto</em></strong>, who observed in 1897 that 80% of Italy’s land was owned by 20% of the population, this principle has profound implications for leadership.</p><p>Applied to leadership, the Pareto Principle suggests that:</p><blockquote>- 20% of your efforts produce 80% of your results<br>- 20% of your team delivers 80% of the output<br>- 20% of your time determines 80% of your impact</blockquote><p><a href="https://hbr.org/2015/08/the-research-is-clear-long-hours-backfire-for-people-and-for-companies">Effective leaders recognize this imbalance</a> and focus their energy accordingly. Instead of spreading yourself thin across countless tasks, identify the vital few activities that truly drive results.</p><h4>Practical Application of the 80/20 Rule</h4><h4>1. Decision Making</h4><p>Gather 80% of the information and make your decision in 20% of the allotted time. As Michael Edwards notes, “<strong><em>Having 80% of the data will do. The 20% of data you lack is probably easily made up by your expertise, experience, and intuition</em></strong>.”</p><h4>2. Team Management</h4><p>Don’t spend 80% of your time with the bottom-performing 20%. While it might seem counterintuitive, focusing too much on struggling team members can cause your star performers to feel neglected. Your top 20% who deliver 80% of results need your attention too.</p><h4>3. Communication</h4><p>Spend 80% of your time listening to your team and only 20% talking. This ratio transforms your leadership effectiveness by ensuring you truly understand before being understood.</p><h4>4. Ideation</h4><p>Allow 80% of ideas to come from your team and only 20% from yourself. This empowers your team while leveraging their collective intelligence.</p><h4>5. Task Management</h4><p>Focus 80% of your energy on the 20% of tasks that drive the most value. As time management expert Pamela J. Vaccaro suggests, “<strong><em>The 80/20 rule states that the relationship between input and output is rarely, if ever, balanced.</em></strong>”</p><h4>A Chanakya’s Lesson for Leaders</h4><p>I particularly loved these lines when I was reading spectacular book “Chanakya’s Chant”.</p><p>In Ashwin Sanghi’s “Chanakya’s Chant,” there’s a profound exchange between a scholar and an Acharya (teacher):</p><blockquote>“Acharya, what should the punishment be for a prime minister who keeps the king ignorant of happenings in the kingdom?”</blockquote><blockquote>“My son, kings are ignorant not because prime ministers do not give them the right answers but because they do not ask their prime ministers the right questions. And here endeth the lesson!”</blockquote><p>As a leader, asking the right questions matters more than having all the answers. When you’re too busy, you stop asking these essential questions.</p><h4>Make Time for What Matters</h4><p><em>Jake Knapp, “Make Time: How to Focus on What Matters Every Day” </em>reminds us that:</p><blockquote>“Make Time is a framework for choosing what you want to focus on, building the energy to do it, and breaking the default cycle so that you can start being more intentional about the way you live your life.”</blockquote><p>According to <a href="https://en.wikipedia.org/wiki/Parkinson%27s_law">Parkinson’s Law</a>, work expands to fill the time allotted for its completion. This applies to meetings, projects, and daily tasks. By setting clear boundaries on time, you can compress work and increase efficiency.</p><p>Remember that 80% of your results come from 20% of your time. Identify that crucial 20% and protect it fiercely. Delegate or eliminate the rest.</p><h4>The Leadership Paradox</h4><p>The ultimate leadership paradox is this: to lead effectively, you must create space in your life. The busier you are, the less effective your leadership becomes. True leadership isn’t about being constantly in motion — it’s about moving with purpose, direction, and impact.</p><p>As you reflect on your own leadership journey, ask yourself: <strong><em>Are you busy, or are you effective? Are you filling time, or are you creating impact? The answer may require you to put down your badge of busyness and pick up the mantle of meaningful leadership instead.</em></strong></p><p>After all, at the end of your career, no one will remember how busy you were. They’ll remember how you made them feel, the vision you created, and the impact you had. And none of that comes from busyness — it comes from presence, purpose, and prioritization.</p><h4>Good Reads:</h4><p>There are few blogs that motivated me to write this blog.</p><ul><li><a href="https://www.lifehack.org/articles/communication/21-reasons-why-you-should-not-proud-being-busy.html">https://www.lifehack.org/articles/communication/21-reasons-why-you-should-not-proud-being-busy.html</a></li><li><a href="https://hbr.org/2015/08/the-research-is-clear-long-hours-backfire-for-people-and-for-companies">https://hbr.org/2015/08/the-research-is-clear-long-hours-backfire-for-people-and-for-companies</a></li><li><a href="https://www.forbes.com/sites/forbestechcouncil/2021/04/09/pandemic-fuels-global-growth-of-entrepreneurship-and-startup-frenzy/?sh=6fbc6dfd7308">https://www.forbes.com/sites/forbestechcouncil/2021/04/09/pandemic-fuels-global-growth-of-entrepreneurship-and-startup-frenzy/?sh=6fbc6dfd7308</a></li></ul><h4>References:</h4><p>[¹]: Sharma, R. S. (2010). *The Leader Who Had No Title: A Modern Fable on Real Success in Business and in Life*. Free Press.<br>[²]: Rosendahl, N. (2019). “The Busyness Experiment.” Hintsa Performance Blog. <a href="https://www.hintsa.com/blog/busy-experiment/">https://www.hintsa.com/blog/busy-experiment/</a><br>[³]: Dobby, R., et al. (2024). “The Impact of Stress Bragging on Workplace Perceptions.” *Personnel Psychology*, 77(1), 123–145.<br>[⁴]: Robbins, M. (2020). “How the Pandemic Has Boosted Creativity.” Forbes. <a href="https://www.forbes.com/sites/mindylubber/2020/10/13/disruption-has-triggered-innovation-and-creativity/">https://www.forbes.com/sites/mindylubber/2020/10/13/disruption-has-triggered-innovation-and-creativity/</a><br>[⁵]: Brown, G. (2019). “The Relationship Between Material Possessions and Creativity.” Forbes.<br>[⁶]: Perlow, L. A., &amp; Porter, J. L. (2009). “Making Time Off Predictable — and Required.” *Harvard Business Review*, 87(10), 102–109.<br>[⁷]: Belkin, L. (2015). “The Cult of Busy.” *Wall Street Journal*. <a href="https://www.wsj.com/articles/the-cult-of-busy-1428080581">https://www.wsj.com/articles/the-cult-of-busy-1428080581</a><br>[⁸]: Edwards, M. (2018). *The 80/20 Principle in Decision Making*. Business Expert Press.<br>[⁹]: Vaccaro, P. J. (2017). *Time Management: The Pareto Principle in Practice*. Productivity Press.<br>[¹⁰]: Sanghi, A. (2010). *Chanakya’s Chant*. Westland Publications.<br>[¹¹]: Knapp, J., &amp; Zeratsky, J. (2018). *Make Time: How to Focus on What Matters Every Day*. Currency.<br>[¹²]: Newport, C. (2016). *Deep Work: Rules for Focused Success in a Distracted World*. Grand Central Publishing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d9c1c6c3e7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying Metadata Management — Part 2]]></title>
            <link>https://arglee.medium.com/demystifying-metadata-management-part-2-378434352bdb?source=rss-16fea3dfb80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/378434352bdb</guid>
            <category><![CDATA[data-lakehouse]]></category>
            <category><![CDATA[data-fabric]]></category>
            <category><![CDATA[data-mesh]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[metadata-management]]></category>
            <dc:creator><![CDATA[Ashish Mishra]]></dc:creator>
            <pubDate>Mon, 06 Nov 2023 02:01:57 GMT</pubDate>
            <atom:updated>2023-11-07T17:49:53.662Z</atom:updated>
            <content:encoded><![CDATA[<h3>Demystifying Metadata Management: Lakehouse, Data fabric, Data Mesh</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UGLbSgHc3iTVNk6I" /><figcaption>Photo by <a href="https://unsplash.com/@lureofadventure?utm_source=medium&amp;utm_medium=referral">Ali Kazal</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This part of the series contains advanced components of metadata management. Each component plays a very crucial role in designing the metadata management architecture.</p><p>If you are visiting this series first time then the recommendation is to complete <a href="https://medium.com/@arglee/demystifying-metadata-management-part-1-cd86ee78228a">Demystifying Metadata Management part -1</a> of the series to have basic knowledge of the metadata components.</p><p>In this part, we will discuss the following topics:</p><ul><li>Lake House</li><li>Data Fabric</li><li>Data Warehouse vs Data lake vs Data Fabric</li><li>Data Virtualization</li><li>Data Mesh</li><li>Data Mesh vs Data Mart vs Data Fabric</li><li>Data Context</li></ul><h3><strong>Lake House:</strong></h3><p>Don’t worry if you have not heard this word before. It’s the combination of Data Warehouse and Data Lake. Businesses leverage cost-effective storage of data lake analytics-optimized data warehouse. The Organizations will eventually ETL certain portions to the data lake and subsequently some portion of data to the warehouse to make it a two-tier architecture.</p><p>Data Lakehouse is a step towards making it a single-tier architecture, that can benefit:</p><ul><li>Businesses don’t have to worry about fragile engineering ETLs to transfer data among multiple data stores.</li><li>Reduced Data Redundancy by enabling a single repository for all data.</li><li>Reduced cost by streamlining ETL and single-tier architecture.</li><li>Increased agility and up-to-date data enable quick analytics and reports on near real-time data.</li><li>Able to combine transaction, ACID, and structured data features of warehouse and quick and easy data access into a single solution.</li></ul><blockquote>Data Lake could enable quick access to data, but data warehouse provides lower latency and better performance of SQL queries.</blockquote><p>Lake House Solutions are:</p><ul><li>Delta Lake</li><li><a href="https://hudi.apache.org/">Apache Hudi</a></li><li>Apache Iceberg</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*VjgW8DVTiIvFbg4P.png" /><figcaption>Image Courtesy: <a href="https://databricks.com/blog/2020/01/30/what-is-a-data-lakehouse.html)">Databricks</a></figcaption></figure><p><em>Good read on Data Lakehouse: </em><a href="https://www.splunk.com/en_us/blog/learn/data-lakehouses.html"><em>Blog by Splunk</em></a></p><h3>Data Fabric:</h3><p><strong>Data fabric</strong> is a collection of practices and tools(Software or Hardware) used to implement data connectivity across the entire company estate — on-premises systems, all cloud data storage services, hybrid storage systems, and even edge devices. Think of a data fabric solution as the nervous system in our bodies. Its purpose is to distribute various kinds of information to the organs (business systems), requiring it for decision-making.</p><p>Data fabric can also be referred to as an architecture that facilitates end-to-end data pipelines, systems, and databases.</p><p>Historically, an enterprise may have had different ERP, CRM, supply chain, or customer data platforms, which persist data in different and separate environments. There is a high chance that these systems will have a potential overlap of data. Decision-making requires data across multiple places to understand the in-depth behavior of customer&#39;s lifecycle and future predictions and thus there is a requirement to create a system that could have access to the data from across data stores. Data fabric helps to build such a system.</p><p>Thus, Data Fabric allows more holistic and data-centric decision-making by applying sophisticated automation and tooling. There is no single tool or platform to fully set up data fabric architecture. A mix of solution, management, and monitoring will be required to create a Data Fabric Solution.</p><p>To establish a Data Fabric, there is no set of rules or practices. The sophistication of Data Fabric Architecture is based upon the use case and the organization’s needs. Data Fabric implementation could be costly if not procured with precaution and need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nrA4yS6Y0KddWXeY.png" /><figcaption>Image Courtesy: <a href="https://www.montecarlodata.com/blog-data-fabric-the-future-of-data-architecture/">MonteCarloData</a></figcaption></figure><p>Data Virtualization must not be confused with Data Fabric. Data Virtualization is one of the technologies to enable Data Fabric. We will discuss more about Data Virtualization in the later part of this blog.</p><blockquote>Data fabric is a complementary “coating” you can use to connect disparate data lake solutions with data warehouse tools to resolve interoperability issues, improve data distribution speed, and achieve better data standardization.</blockquote><p><strong>Data fabric solutions:</strong></p><ul><li>SAP Data Intelligence</li><li>IBM Data Fabric</li><li>Google Cloud Dataplex</li></ul><p><em>Good Read on Data Fabric: </em><a href="https://www.infopulse.com/blog/data-fabric-complements-dwh-data-lake"><em>A blog by Infopulse</em></a></p><p><strong>Data Warehouse vs Data Lake vs Data Fabric:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*kiImpKo4pWe7ScC7.png" /></figure><h3><strong>Data Virtualization:</strong></h3><p>Rather than moving data physically using any ETL process. Data Virtualization is a process or architecture to create a metadata layer above physical data to create a virtual data layer. This allows users to leverage the source data in real time.</p><p>Data virtualization can also be extended to add an extra security layer to enable row-level or column-level security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*YoCbvdNIyYKcTkKHxgfbhw.png" /><figcaption>Image Courtesy: <a href="https://www.tibco.com/reference-center/what-is-data-virtualization">tibco.com</a></figcaption></figure><p><em>Good Read on Data Virtualization: </em><a href="https://www.tibco.com/reference-center/what-is-data-virtualization"><em>A blog by tibco</em></a></p><h3>Data Mesh:</h3><p>“<strong>Data Mesh</strong>” - The term coined by <a href="https://martinfowler.com/articles/data-monolith-to-mesh.html#DomainDataAsAProduct">Zhamak Dehghani in her 2019 blog</a> post is a “<em>socio-technical paradigm</em>”. Data Mesh is a process or shift in organizational culture to replace centrally managed data lakes or warehouses with independent lakes or warehouses managed by business or domain owners. Each domain owner is responsible for their ETL to get data to their domain-based warehouse. Thus, in Data Mesh, Ownership, responsibility, and accountability of management for ETL, monitoring, and management of centralized warehouse/data lake gets distributed among multiple small and less complex domain-based warehouses.</p><blockquote>Data Marts must not be confused with Data Mesh. Data Marts are dependent upon the central warehouse to provide data. On the contrary, Data Mesh architecture is to replace central warehouse.</blockquote><p>Read more about the difference between Data Mesh and Data Marts <a href="https://atlan.com/data-mesh-vs-data-mart/#:~:text=Comparing%20data%20mesh%20and%20data%20mart:%20A%20comprehensive%20analysis%20In%20this%20section,%20we%20delve%20into%20the%20world%20of%20data%20architecture%20by%20exploring%20the%20key%20differences%20and%20similarities%20between%20two%20prominent%20approaches:%20data%20mesh%20and%20data%20mart.%20Here%E2%80%99s%20a%20detailed%20comparison%20table%20that%20highlights%20the%20distinct%20applications,%20use%20cases,%20and%20characteristics%20of%20these%20data%20management%20methodologies.">here</a>.</p><p><em>Good Read on Data Mesh: </em><a href="https://www.upsolver.com/blog/demystifying-the-data-mesh-a-quick-what-is-and-how-to"><em>A blog by upsolver</em></a></p><p><strong>Data Fabric and Data Mesh:</strong></p><p>A data fabric and a data mesh both provide an architecture to access data across multiple technologies and platforms, but a data fabric is technology-centric, while a data mesh focuses on organizational change. as per Serra in <a href="https://www.jamesserra.com/archive/2021/06/data-fabric-defined/">a June blog post</a>:</p><blockquote>Data mesh is more about people and process than architecture, while a data fabric is an architectural approach that tackles the complexity of data and metadata in a smart way that works well together.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*dkc_eGN5D-CoCGiE.png" /><figcaption>Image Courtesy: <a href="https://martinfowler.com/articles/data-monolith-to-mesh.html#DomainDataAsAProduct">martinfowler.com</a></figcaption></figure><p>Good read on Data Mesh vs Data Fabric: <a href="https://analyticsindiamag.com/data-mesh-vs-data-fabric-whats-the-difference/">A blog by analyticsindiamag</a></p><h4><strong><em>[Writer’s Corner]</em></strong></h4><p><em>While writing </em><a href="https://medium.com/@arglee/demystifying-metadata-management-part-1-cd86ee78228a"><em>Demystifying Metadata Management</em></a><em> series, I had an opportunity to talk to few brightest minds in the industry and most of the companies are struggling in state of Data Mesh. Data fabric is as tough as much as it is beautiful and most of the companies struglling tobe onee.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=378434352bdb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chrome Extensions using Vite + Typescript + React: Stepwise Process]]></title>
            <link>https://arglee.medium.com/chrome-extensions-using-vite-typescript-react-stepwise-process-6d013f5332b9?source=rss-16fea3dfb80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d013f5332b9</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[vitejs]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[typescript-with-react]]></category>
            <dc:creator><![CDATA[Ashish Mishra]]></dc:creator>
            <pubDate>Tue, 24 Oct 2023 02:32:35 GMT</pubDate>
            <atom:updated>2023-10-24T02:32:35.212Z</atom:updated>
            <content:encoded><![CDATA[<p>Chrome extensions come in really handy when it comes to blocking ads, improving productivity, managing cluttered tabs, and of course improving the readability of code on GitHub for developers.❤️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sWqccE_AfTucc7Z8.png" /><figcaption>Image Courtesy: <a href="http://singlequote.blog/">singlequote.blog</a></figcaption></figure><p>In this blog, let’s create a Chrome extension in an easy 4-step process using <a href="https://react.dev/">React</a>, <a href="https://www.typescriptlang.org/">Typescript</a>, and <a href="https://vitejs.dev/guide/why.html">Vite bundler</a>.</p><p>Let us assume that nodejs is pre-installed, if not then you can follow this <a href="https://singlequote.blog/chrome-extension-using-node-rollup-plugin-stepwise-process/(opens%20in%20a%20new%20tab)">setup nodejs and dependencies on the development/local machine</a>.</p><p>Now, since we are all set, Let’s begin!!</p><h3>Step 1: Initialise a new Project</h3><p>Create a new project using Vite.</p><pre>npm create vite@latest</pre><p>This command will prompt for a few inputs from the user:</p><ol><li><strong>Project Name:</strong> Project name that you want to give to your project.</li><li><strong>Select a Framework:</strong> Choose ‘React’ as that is what we are going with in this tutorial.</li><li><strong>Select a variant</strong>: Choose ‘Typescript’ there to keep up with this tutorial.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/0*Tx52vye-FcK2X1aM.png" /><figcaption>Image Courtesy: <a href="http://singlequote.blog/">singlequote.blog</a></figcaption></figure><h3>Step 2: Install Dependencies &amp; Run Application on Local</h3><p>Now change the directory to the created/initialized folder and install the dependencies.</p><pre>&gt; cd vite-ts-react-test<br>&gt; npm install</pre><p>Now to test if everything worked fine. Run the following command in the terminal.</p><pre>npm run dev</pre><p>This will prompt a new message on the command line similar to below screenshot:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/0*UCdwuiNdCVvVxbaF.png" /><figcaption>Image Courtesy: <a href="http://singlequote.blog/">singlequote.blog</a></figcaption></figure><p>This signifies that everything is running fine up to this point. Once you open the above shown — <a href="http://localhost:5173/">http://localhost:5173/</a> on the browser, you will a see Vite welcome page, something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/0*U_PnruXEZpWBnkim.png" /><figcaption>Image Courtesy: <a href="http://singlequote.blog/">singlequote.blog</a></figcaption></figure><p>Next exit from the vite localhost prompt using ‘CTRL+C’ and run the command to build the project</p><pre>npm run build</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*nnZ1RvP6rQTkmj5I.png" /><figcaption>Image Courtesy: <a href="http://singlequote.blog/">singlequote.blog</a></figcaption></figure><p>An output something like the above will come up on the terminal/cmd.</p><h3>Step 3: Create a Chrome Extension and Validate it</h3><p>At the end of step 2, the boilerplate will be ready inside the project directory. You will see a lot of stuff inside the directory but don’t worry we are only interested in a few of these:</p><ol><li><strong>Dist:</strong> The “<em>build</em>” command creates this folder dynamically by copying a few files from other folders or as instructed in the config file. For this tutorial default configuration will work. So, we are not going to touch anything inside it.</li><li><strong>Public:</strong> We will add all of our project files and static files in this folder and the “<em>build</em>” command will add those to the dist folder, once the build is successful.</li><li><strong>Src:</strong> This is where magic happens. This is where we write typescript code, you will also some typescript written in this blog.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/0*0OKcuFLdYTYhRPp4.png" /><figcaption>Image Courtesy: <a href="http://singlequote.blog/">singlequote.blog</a></figcaption></figure><p>Now go to <strong><em>public</em></strong> folder and create a new file <strong><em>manifest.json</em></strong>:</p><pre>{<br>    &quot;manifest_version&quot;: 3,<br>    &quot;name&quot;: &quot;vite-ts-react-test&quot;,<br>    &quot;version&quot;: &quot;1.0&quot;,<br>    &quot;description&quot;: &quot;&quot;,<br>    &quot;action&quot;: {<br>        &quot;default_popup&quot;: &quot;index.html&quot;<br>    },<br>    &quot;permissions&quot;: [<br>        &quot;scripting&quot;,<br>        &quot;tabs&quot;,<br>        &quot;activeTab&quot;<br>    ],<br>    &quot;host_permissions&quot;: [<br>        &quot;https://*/*&quot;,<br>        &quot;http://*/*&quot;<br>    ],<br>    &quot;icons&quot;: {<br>        &quot;16&quot;: &quot;images/16x16.png&quot;,<br>        &quot;32&quot;: &quot;images/32x32.png&quot;<br>    }<br>  }</pre><p>Run the below command to build the project:</p><pre>npm run build</pre><p>Now go to chrome://extension, and enable developer mode if not already set. Click on “Load Unpacked” to pick <strong><em>dist</em></strong> folder from the local file system.</p><p>Voila!! Our Chrome Extension is ready to try.</p><p>If you are still following up to this point, then a new extension will be available on your extension list. You can go ahead and click on the extension on the Chrome menu bar, you will see the Vite welcome page as mentioned <a href="https://singlequote.blog/chrome-extension-using-vite-typescript-react-stepwise-process/#Vite-Welcome-page-singlequoteblog">above on this page</a>.</p><h3>Step 4: Scripting in Chrome Extension</h3><p>In this step, let’s try to do some scripting to see if it works. Let’s go to the <em>“src”</em> folder to write some typescript code.</p><p>In this script, we will write a code using Chrome API to change the background color of the web page.</p><p>let’s install the Chrome API using the below command:</p><pre>npm install -D @types/chrome</pre><p>Now look for src/App.tsx file in the project directory and change the code as below:</p><pre>// import { useState } from &#39;react&#39;<br>import reactLogo from &#39;./assets/react.svg&#39;<br>import viteLogo from &#39;/vite.svg&#39;<br>import &#39;./App.css&#39;<br><br>function App() {<br>  // const [count, setCount] = useState(0) <br>  const onClick = async () =&gt; {<br>    let [tab] = await chrome.tabs.query({ active: true, currentWindow: true });<br>    chrome.scripting.executeScript({<br>      target: { tabId: tab.id! },<br>      func: () =&gt; {<br>        document.body.style.backgroundColor = &#39;green&#39;;<br>      }<br>    });<br>  }<br>  return (<br>    &lt;&gt;<br>      &lt;div&gt;<br>        &lt;a href=&quot;https://vitejs.dev&quot; target=&quot;_blank&quot;&gt;<br>          &lt;img src={viteLogo} className=&quot;logo&quot; alt=&quot;Vite logo&quot; /&gt;<br>        &lt;/a&gt;<br>        &lt;a href=&quot;https://react.dev&quot; target=&quot;_blank&quot;&gt;<br>          &lt;img src={reactLogo} className=&quot;logo react&quot; alt=&quot;React logo&quot; /&gt;<br>        &lt;/a&gt;<br>      &lt;/div&gt;<br>      &lt;h1&gt;Vite + React&lt;/h1&gt;<br>      &lt;div className=&quot;card&quot;&gt;<br>        &lt;button onClick={() =&gt; changeColorOnClick()}&gt;<br>         Change Color<br>        &lt;/button&gt;<br>        &lt;p&gt;<br>          Edit &lt;code&gt;src/App.tsx&lt;/code&gt; and save to test HMR<br>        &lt;/p&gt;<br>      &lt;/div&gt;<br>      &lt;p className=&quot;read-the-docs&quot;&gt;<br>        Click on the Vite and React logos to learn more<br>      &lt;/p&gt;<br>    &lt;/&gt;<br>  )<br>}<br>export default App</pre><p>if you look closely most of the code is already available. The only new addition is a function “<strong><em>changeColorOnClick</em></strong>“.</p><pre>const changeColorOnClick = async () =&gt; {<br>    let [tab] = await chrome.tabs.query({ active: true, currentWindow: true });<br>    chrome.scripting.executeScript({<br>      target: { tabId: tab.id! },<br>      func: () =&gt; {<br>        document.body.style.backgroundColor = &#39;green&#39;;<br>      }<br>    });<br>  }</pre><p>Now don’t forget to build it again and refresh the extension from chrome://extensions.</p><pre>npm run build</pre><p>and it’s done!!</p><p>Give it a try by visiting any website with a considerably white background like <a href="http://singlequote.blog/">singlequote.blog</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*yfNDERWCqPu6OJa8.gif" /></figure><p><strong>Tips and Tricks</strong>: Running the <strong><em>build</em></strong> command after every change could be tiresome and error-prone. If you forgot to refresh and are wondering why the changes are not coming up — Rollup is here to rescue us. Read about <a href="https://singlequote.blog/chrome-extension-using-node-rollup-plugin-stepwise-process/(opens%20in%20a%20new%20tab)">Chrome Extension using Node + Rollup plugin: Stepwise Process</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d013f5332b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terminal/Commandline Trick: Multiprocessing Progress Bar — Python atpbar]]></title>
            <link>https://arglee.medium.com/terminal-commandline-trick-multiprocessing-progress-bar-python-atpbar-4ac8b76b9076?source=rss-16fea3dfb80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ac8b76b9076</guid>
            <category><![CDATA[python-tricks]]></category>
            <category><![CDATA[progress-bar]]></category>
            <category><![CDATA[command-line-interface]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Ashish Mishra]]></dc:creator>
            <pubDate>Sat, 02 Sep 2023 14:43:20 GMT</pubDate>
            <atom:updated>2023-09-04T02:02:33.420Z</atom:updated>
            <content:encoded><![CDATA[<h3>Terminal/Commandline Trick: Multiprocessing Progress Bar — Python atpbar</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*n68QjylBz7DwaYv-.jpeg" /><figcaption>Courtesy: Unspash</figcaption></figure><p>In this blog, we will discuss a simple yet very useful library for python terminal/command line usecases. Very often we work with command line python scripts to process a significantly high volume of data or files. Expectation is to have a way to track how many files are processing and what’s the speed of every process.</p><p>The command line progress bars are here to rescue us.There are multiple progress bars available in the market and you can <a href="http://singlequote.blog/">read more about open source python commandline progress bars</a>.</p><h3>How to create a progress bar on the command line in Python?</h3><p>In this blog, we will discuss <a href="https://pypi.org/project/atpbar/">atpbar</a>. Python multiprocessing enabled progress bar for terminal. Atpbar provides following features:</p><ul><li>Easy to install.</li><li>Minimalistic progress bar without any fancy UX thus quite simple to implement.</li><li>Compatible with multi-processing and multi-threading.</li><li>Can add name to every subprocess in multiprocessing and multithreading.</li><li>Python terminal progress bars simultaneously grow to show the progress of iterations of loops in <a href="https://docs.python.org/3/library/threading.html">threading</a> or <a href="https://docs.python.org/3/library/multiprocessing.html">multiprocessing</a> tasks.</li><li>Compatible with <a href="https://jupyter.org/">Jupyter Notebook</a>.</li><li>On TTY devices where progress bar is not compatible, it can show the status with numbers without progress bar.</li><li>The object atpbar is an iterable that can wrap another iterable and shows the progress bars for outer and inner iterations.</li><li>Break and exception exit the code and progress bar will stop right there.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e6tHuV0vP-MO1bm3.png" /><figcaption>atpbar by <a href="http://singlequote.blog/">singlequote.blog</a></figcaption></figure><h3>How to install python atpbar for commandline progress bar?</h3><p>Create virtualenv, if not present, using the following command:</p><pre>virtualenv -p python3.9 <br>venv source venv/bin/activate <br>python3 --version</pre><p>Now install atpbar using below command for multi-processing python terminal/command line progress bar.</p><pre>pip install -U atpbar</pre><h3>How to use atpbar?</h3><p>you can find more details on exact implementation on<a href="https://pypi.org/project/atpbar/"> python foundation website</a> or on <a href="https://github.com/alphatwirl/atpbar">github page of atpbar</a>. In this article I will explain the functionality in brief.</p><h4>One loop</h4><pre>import time, random<br>from atpbar import atpbar<br>n = random.randint(1000, 10000)<br>for i in atpbar(range(n)):<br>    time.sleep(0.0001)</pre><p>A python terminal progress bar will look something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x-JS9unlMPDCnOkg.png" /><figcaption>Single loop: <a href="http://singlequote.blog/">Singlequote.blog</a></figcaption></figure><p>In order for atpbar to show a progress bar, the wrapped iterable needs to have a length. If the length cannot be obtained by len(), atpbar won&#39;t show a progress bar.</p><h4>Nested loops</h4><p>atpbar can show progress bars for nested loops as shown in the below example.</p><pre>for i in atpbar(range(4), name=&#39;outer&#39;):<br>    n = random.randint(1000, 10000)<br>    for j in atpbar(range(n), name=&#39;inner {}&#39;.format(i)):<br>        time.sleep(0.0001)</pre><p>In this example, outer loop will iterate 4 times while inner loops are processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R4yBejQC74OWfsPg.png" /><figcaption>Nest loop: <a href="http://singlequote.blog/">Singlequote.blog</a></figcaption></figure><h4>Threading</h4><p>atpbar can show multiple progress bars for loops concurrently iterating in different threads.</p><pre>from atpbar import flush<br>import threading<br><br>def run_with_threading():<br>    nthreads = 5<br>    def task(n, name):<br>        for i in atpbar(range(n), name=name):<br>            time.sleep(0.0001)<br>    threads = [ ]<br>    for i in range(nthreads):<br>        name = &#39;thread {}&#39;.format(i)<br>        n = random.randint(5, 100000)<br>        t = threading.Thread(target=task, args=(n, name))<br>        t.start()<br>        threads.append(t)<br>    for t in threads:<br>        t.join()<br>    flush()<br><br>run_with_threading()</pre><p>As shown in below screenshot, tasks are running concurrently and python terminal progress bar will show the staus of each tasks simultaneously.</p><p>One important thing to notice here is flush() function that returns when loops have finished and informs main thread or main program to finish updating progress bars.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RBC20GaPAY2GoTV_.png" /><figcaption><a href="http://singlequote.blog/"><em>Threading atpbar</em></a></figcaption></figure><p>As a task completes, the progress bar for the task moves up. The progress bars for active tasks are at the bottom.</p><h4>Multiprocessing</h4><pre>import multiprocessing<br>multiprocessing.set_start_method(&#39;fork&#39;, force=True)<br><br>from atpbar import register_reporter, find_reporter, flush<br><br>def run_with_multiprocessing():<br>    def task(n, name):<br>        for i in atpbar(range(n), name=name):<br>            time.sleep(0.0001)<br>    def worker(reporter, task, queue):<br>        register_reporter(reporter)<br>        while True:<br>            args = queue.get()<br>            if args is None:<br>                queue.task_done()<br>                break<br>            task(*args)<br>            queue.task_done()<br>    nprocesses = 4<br>    ntasks = 10<br>    reporter = find_reporter()<br>    queue = multiprocessing.JoinableQueue()<br>    for i in range(nprocesses):<br>        p = multiprocessing.Process(target=worker, args=(reporter, task, queue))<br>        p.start()<br>    for i in range(ntasks):<br>        name = &#39;task {}&#39;.format(i)<br>        n = random.randint(5, 100000)<br>        queue.put((n, name))<br>    for i in range(nprocesses):<br>        queue.put(None)<br>        queue.join()<br>    flush()<br><br>run_with_multiprocessing()</pre><p>With multiprocessing enabled with atpbar, two more functions come into play:</p><ul><li><strong>find_reporter()</strong> — This function is required to be called into main thread or main process. This intimate main thread of atpbar to look for subprocesses.</li><li><strong>register_reporter()</strong> — This function is required to be called inside every new subprocesses. Every call from subprocess will be tracked by main thread and a new python terminal progress bar will be created.</li></ul><p>Simultaneously growing python terminal-based progress bars will look something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9bvNpl4Kcr_nbFYA.png" /><figcaption><a href="http://singlequote.blog/"><em>multiprocessing atpbar</em></a></figcaption></figure><p><strong>[AUTHOR’S CORNER]</strong></p><p><em>This article is part one of the </em><a href="http://singlequote.blog/"><em>progress bar in Python series</em></a><em>. Stay tuned for more such articles on </em><a href="http://singlequote.blog/"><em>singlequote.blog</em></a><em>.If you find this exercise helpful then motivate me to write more such posts for you. Share this with your friends, family, and colleagues.</em></p><p><em>Originally published at </em><a href="https://singlequote.blog/terminal-commandline-tricks-multiprocessing-progress-bar-python-atpbar/"><em>https://singlequote.blog</em></a><em> on September 2, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ac8b76b9076" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Personal Growth: Journey From Burnout to Breakthrough]]></title>
            <link>https://arglee.medium.com/personal-growth-journey-from-burnout-to-breakthrough-2a8c818b9288?source=rss-16fea3dfb80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a8c818b9288</guid>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[personal-growth]]></category>
            <category><![CDATA[burnout]]></category>
            <category><![CDATA[successful-people]]></category>
            <category><![CDATA[personal-development]]></category>
            <dc:creator><![CDATA[Ashish Mishra]]></dc:creator>
            <pubDate>Fri, 01 Sep 2023 14:21:24 GMT</pubDate>
            <atom:updated>2023-09-02T02:02:41.914Z</atom:updated>
            <content:encoded><![CDATA[<p>Personal Growth — How to Reclaim Your Energy and Purpose in life to achieve more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tfxP3MyA2zuFZXZB" /><figcaption>Photo by <a href="https://unsplash.com/@nublson?utm_source=medium&amp;utm_medium=referral">Nubelson Fernandes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the last blog, I discussed the <a href="https://singlequote.blog/be-5-times-more-productive-stepwise-guide/">steps to achieve maximum output by investing significantly less time</a> and<a href="https://singlequote.blog/be-5-times-more-productive-stepwise-guide/"> how to improve your productivity at work</a>.</p><p>In this blog, we will discuss the next topic for productivity and personal growth. That is “burnout”.</p><h3>What is burnout?</h3><p>“ <strong>Burnou</strong>t” — Is it a real thing or is it another excuse for <em>Absenteeism</em>?</p><p>According to a study, Approximately 28% of workers say they burnout “very often” or “always” at work and 24% of workers report that they “rarely” or “never” feel burnout at work.</p><p>There are a few days when we feel productive and energetic even after working for long hours and on the other hand, there are also a few drenched days when we feel burned out even before lunchtime. This happens to all of us. Agreed?</p><p>Burning out directly impacts our productivity and personal growth. I have published a productivity tips blog on <a href="https://singlequote.blog/be-5-times-more-productive-stepwise-guide/">How to increase your productivity at least 5 times without any extra effort</a>.</p><p>In this blog, I am not considering frequent burning out due to health issues. This blog is for people who tend to burnout very easily due to overwhelming tasks either professionally or personally.</p><h3>What are the burnout coping strategies?</h3><p>Let’s try to understand this using an example of 4 candidates(Sandra, Dave, John, and Laura) working in a corporate/company. All 4 candidates work in the same environment and have similar facilities. Their performance is also competitive. Now let’s observe how they behave whenever they face burnout or frustration during their work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Cc3Zody3bw0dY-pB.png" /><figcaption>Image by <a href="https://medium.com/u/16fea3dfb80f">Ashish Mishra</a> on singlequote.blog</figcaption></figure><p><strong>Sandra</strong> tries to escape from work and go for a run or the gym and this helps her think straight and now she feels more energetic and motivated once she is back to work.</p><p><strong>Dave</strong> indulges with more people outside the work who are in a similar field and tries to seek help by discussing the situation.</p><p><strong>John,</strong> on the other hand, tries to discuss the situation with his team and tries to understand the problem better from his current team.</p><p><strong>Laura</strong> escapes from all distractions, gets herself a silent corner, and thinks about the situation.</p><p>Every working professional suffers from burning out from time to time. The key is how to cope. People adopted multiple coping strategies to avoid burnout. The above examples depict the coping strategies of each individual.</p><p>According to an article published in Gallup’s on <a href="https://www.gallup.com/cliftonstrengths/en/472067/fighting-burnout-strengths.aspx">Fighting Burnout with Strengths</a>: People have different types of coping strategies when it comes to dealing with burnout. A survey was conducted on 3000 such employees to figure out their coping strategies. These coping strategies were categorized into 4 themes, also known as CliftonStrengths:</p><h4>Executing Theme:</h4><ul><li>In order to cope with burnout or frustration, People tend to return to work as quickly as possible or do some physical activity (exercise). Anything that could give them a sense of accomplishment. People in this category take immense satisfaction in being busy or productive.</li></ul><h4>Influencing Theme:</h4><ul><li>People who tend to spend more time with their family or friends outside of work or talk about their work with them to seek help on how their work can contribute to their future goals. People with dominating influencing themes also try to speak up for others and make sure they are heard. Talking more about the future gives them a sense of a bright future and they tend to make a bright future their strength and work towards that.</li></ul><h4>Relationship-Building Theme:</h4><ul><li>People with dominating Relationship-building themes show awareness of how involving others can create good relationships among team members. These people try to take some time to think about how others will feel at the same time. They take pride in including more people in the conversation.</li></ul><h4>Strategic Thinking Theme:</h4><ul><li>Strategic thinkers tend to allow themselves the space to think through their frustration when burned out. They are more likely than others to stop and take time to think through their situation or take more breaks during the workday to relax.</li></ul><h3>Which coping strategy is suitable for personal growth?</h3><p>No wonder people have various coping strategies. However, as per another research, there were a few more interesting facts:</p><ul><li>The most common coping strategies were not most effective for them, and still, people preferred to stick with these ineffective approaches.</li><li>This becomes more interesting with the fact that people were aware of the “not so effective” nature of the approach and yet they went ahead with that.</li><li>The same person was not choosing the same theme for all the situations. At multiple times, they tend to choose 1 strength in 4 themes.</li></ul><p>Now, if you look closely at the survey result below, you will find no matter what the coping whim of each theme, but people always tend to do one common thing “Stop and take time to think through their situation”.</p><p>Hence, There are multiple techniques to cope with the burnout. You just need to follow one of the strategies to overcome. There is no good or bad theme, and the choice does not reflect the personality of a person. So, next time whenever you are having a burnout attack, take your time and go for any of the strategies that you feel is right and viable option.</p><h3>Conclusion</h3><p>So, when was the last time, you considered thinking about the burnout you are having? If you are reading this blog then you are planning something to overcome this issue or you are on your path for personal growth. I have curated a <a href="https://singlequote.blog/be-5-times-more-productive-stepwise-guide/">handmade plan for personal development and time management</a>. This will help you create a plan and analyze the issues with your daily schedule.</p><p>An important point — The above plan is not a silver bullet that can resolve everything. It needs your full attention. A line from the song <a href="https://genius.com/Sons-of-the-east-nothing-comes-easy-lyrics">Nothing comes easy</a> rightly describes it</p><blockquote><em>“And nothing comes easy, no nothing at all. But if we believe it, we’re a hundred foot tall”</em></blockquote><blockquote><em>Sons of the East</em></blockquote><p><strong>[AUTHOR’S CORNER]</strong></p><p>I<em> think, I am more of an “Influencing Theme” person, and most of the time, I tend to discuss the situation with a person outside the work to get an unbiased view, quite a few times, I am also an “executing theme” person as I like going for the gym or for a run during such situations.</em></p><p><em>Few bonus articles to read:</em></p><ul><li><a href="http://no-nonsense%20guide%20to%20measuring%20productivity/"><em>No-Nonsense Guide to Measuring Productivity</em></a><em> by </em><a href="https://hbr.org/1988/01/no-nonsense-guide-to-measuring-productivity"><em>Harward Business Review</em></a>.</li><li><a href="https://www.simplypsychology.org/maslow.html"><em>Maslow’s Hierarchy of needs</em></a><em> is one of the best models for understanding personal development and growth.</em></li></ul><p><strong>Courtesy</strong>: <a href="https://www.gallup.com/cliftonstrengths/en/472067/fighting-burnout-strengths.aspx">Gallup.com</a> for survey results, videos, and text suggestions.</p><p><em>Originally published at </em><a href="https://singlequote.blog/personal-growth-journey-from-burnout-to-breakthrough/"><em>https://singlequote.blog</em></a><em> on September 1, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a8c818b9288" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Be 5 times more Productive: Stepwise Guide & Tips — Single Quote]]></title>
            <link>https://arglee.medium.com/be-5-times-more-productive-stepwise-guide-tips-single-quote-9d95a83990d1?source=rss-16fea3dfb80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d95a83990d1</guid>
            <category><![CDATA[productivity-tools]]></category>
            <category><![CDATA[eisenhower-matrix]]></category>
            <category><![CDATA[productivity-tips]]></category>
            <category><![CDATA[productivity-hacks]]></category>
            <category><![CDATA[productivity-improvement]]></category>
            <dc:creator><![CDATA[Ashish Mishra]]></dc:creator>
            <pubDate>Sat, 20 May 2023 13:43:54 GMT</pubDate>
            <atom:updated>2023-05-22T18:18:34.142Z</atom:updated>
            <content:encoded><![CDATA[<h3>Be 5 times more Productive: Stepwise Guide &amp; Tips</h3><p>The project delivery deadline is a few days away and you are racing against time. Each and every second has become highly valuable. During these overwhelming times, we often ask ourselves:</p><p><strong>How can I deliver more in less time? What can I do to improve my productivity at work? How can I improve my decision-making power?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Gp-k5JUcW96Ypwzb" /><figcaption>Photo by <a href="https://unsplash.com/@joszczepanska?utm_source=medium&amp;utm_medium=referral">Jo Szczepanska</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Don’t we…?</p><p>What if I say, This is possible and I have a few productivity tips and answers to all the above questions. A very simple 4-step exercise can help you to become at least 5 times more productive. But in order to achieve this I need your full attention for 10 days while we are doing this exercise.</p><h3>How has this productivity tip helped me?</h3><p>I have been practicing this exercise for last past couple of years. This helped me systematically design my life to give me almost desired productivity without impacting the balance between my personal and professional life.</p><p>Prior to this exercise, very often I used to feel overwhelmed with work. This often forced me to skip lunch or not give enough time to my family or friends and even lead to sleep deprivation. During that time, I knew, that if I want to spend my life with satisfaction and peace, then somehow I need to manage things without falling into a pit of these unhealthy habits.</p><p>I started doing research, and unsurprisingly, there is a common name for such a situation: “ <strong>Urgency Trap</strong> “.</p><h3>How this productivity tip can help you?</h3><p>Very often we are overwhelmed with work, and new work already becomes high priority task even before we could finish the last one. This is called the “Urgency Trap” and this creates huge problems in our decision-making in day-to-day life.</p><blockquote><strong><em>Urgency Trap</em></strong><em> is a paradox because it limits the very thing that could help us be more innovative, efficient, and effective: </em><strong>Our critical thinking</strong><em>.</em></blockquote><blockquote><a href="https://www.harvardbusiness.org/to-improve-critical-thinking-dont-fall-into-the-urgency-trap/"><em>Harward Business Review</em></a></blockquote><p>Thus, the target for this exercise is to keep yourself free from this “Urgency Trap”.</p><p>Now a bit of back story about this exercise. This exercise is originally based on Eisenhower’s Method of decision-making. I have made a few modifications to the original Eisenhower method to make it more user-friendly and easy to use. Let’s dive deep into the stepwise process.</p><h3>Stepwise Guide/Tips to improve productivity</h3><h3>Step 1: Download the Eisenhower Matrix Excel Template</h3><p>On the internet, there are multiple Excel templates available. We will discuss a few of them which I find good. Both of the templates mentioned below are compatible with Microsoft Excel and Google Sheets. Gumroad SingleQuote Excel Template is cheaper:</p><ul><li><strong>Someka Template</strong>: You can download the template from <a href="https://www.someka.net/products/eisenhower-matrix-google-sheets-template/">here</a>. This cost $29.95.</li><li><strong>Gumroad Excel Template:</strong> You can <a href="https://arglee.gumroad.com/l/EisenhowerMatrixExcelTemplate">download Eisenhower Matrix Excel Template</a>. This cost $0.99.</li></ul><p>Once you click on the above link you will land on the Gumroad screen which will look something like the image below. At the bottom right, fill amount in the price box and click on “I want this”. Once done you can download the Excel template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FJIs291bYjD5jE90.png" /><figcaption>Eisenhower Matrix Download Screen</figcaption></figure><h3>Step 2: Explore Excel/Google Sheet Productivity Template</h3><p>Double-click on the downloaded Excel sheet to open it in <a href="https://www.microsoft.com/en-us/microsoft-365/excel">Microsoft Excel</a> or you can also open this in <a href="https://sheets.google.com/">Google Sheets</a>.</p><p>To open this in Google Sheets, open a new sheet and click <strong><em>File</em></strong> and then <strong><em>Open</em></strong> to import it from local.</p><p>Once opened, at the bottom of the sheet, you will find multiple tabs as shown in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k-hdZLrorjXeZK3W.png" /><figcaption>Tabs on Excel</figcaption></figure><p>Every tab represents something, Let’s find out how these tabs will be used in this exercise.</p><p><strong>Instructions:</strong> The instruction tab explains in brief how to use the template.</p><p><strong>Example Day:</strong> Example day is useful if you are a first-time user of this template. This can help you categorize your tasks with some examples. Example days will help you in 2 ways:</p><ul><li><a href="https://singlequote.blog/eisenhower-method-to-dodge-all-the-blues/">How to categorize what is urgent/important vs non-urgent/unimportant</a>?</li><li>How to categorize what are the things related to work vs non-work?</li></ul><p><strong>Day 1 — Day 10:</strong> This is where you need to fill in your daily activities during the 10-day exercise. You need to fill in what have you done every half an hour.</p><p><em>30 mins window might seem very aggressive initially, but there is a reason for this. Originally, I started with the 1-hour window, but later I realized if I have done something productive for 40–45 mins and have not done something important/productive for the next 15–20 mins then it becomes difficult to track that time, and these multiple 15–20 mins windows can consume more than 1.5–2.0 hrs throughout the day.</em></p><p><strong>Analysis:</strong> Once you click there you will find a graph. This graph shows time spent on urgent/important(Quadrant 1) of Eisenhower Matrix available on tasks per day over the 10-day period.</p><blockquote><em>As per Eisenhower Matrix, our day-to-day activities should fall under Quadrant 1 and prioritization of tasks must be smart enough. But as a newbie to this we can fall into a trap where we think everything is important and this exercise will help you avoid exactly that.</em></blockquote><p>The analysis tab will provide you details over time, that how much time are you spending on the urgent+important tasks. The target is to increase this percentage number over the exercise and if you feel that this number is not increasing then go back to the tasks of the last day and see what all the tasks have not helped you complete something of utmost importance as stated above.</p><h3>Step 3: Let’s start with day one</h3><p>By now, we understood how and what this exercise is about. Before we start with day 1 there are a few prerequisites.</p><h4>Step 3.1: Decide your productive hours in the day</h4><p>Decide what are the hours in a day you want to be productive. We are not robots to track each and every moment of the day as this could be overwhelming and we do not want to fall into the <a href="https://singlequote.blog/be-productive-by-avoiding-the-urgency-trap/">urgency trap</a> of adding tasks while we are avoiding it.</p><p><strong>Tip:</strong> Most of the people, I have researched with on this template. They mentioned that they started their working hours around 1 hr before the actual office hour and 1 hr after the working hour. Yours could be different.</p><h4>Step 3.2: Start adding your tasks</h4><p>Now, you are ready with the task addition. Your template will look something like below. By the end of every 30 mins, add how you spent your last 30 mins by choosing the options available. Let’s discuss what each option stands for and how to use them:</p><p>There are 6 columns in the sheet:</p><p><strong>Time Slot Column:</strong> Very obvious, nothing to explain here. Time slots are already part of the defined template. No user intervention is required at this point.</p><p><strong>Task Column:</strong> A brief description of the task. This should be detailed enough so you can identify it later and brief enough that it is not taking much time to add.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gncm4eBe8uK5Vyxd.png" /><figcaption>Eisenhower Exercise Tasks Example</figcaption></figure><p><strong>Urgent Column:</strong> If the task falls into urgent criteria then mark it “Y” else mark it “N”. This is an important column and all the tasks can not be urgent. Choose it wisely or <a href="https://singlequote.blog/eisenhower-method-to-dodge-all-the-blues/(opens%20in%20a%20new%20tab)">refer to this document to help you guide how to choose urgent/ important or non-important tasks</a>.</p><p><strong>Important Column:</strong> If you think that the task you just completed was important then mark it “Y” else mark it “N”.</p><p><strong>WH Column:</strong> This stands for “Working Hours”. There are 3 options for this “Work”, “Meeting” and “Learnings”. This will help you understand how are you spending your day.</p><p><strong>NWH Column:</strong> This stands for “Non-Working hours”. if this task was not related to work or office then mark “Y”. For example. “Call MOM” or “Gym” falls under NWH.</p><h4>Step 3.3: End your day</h4><p>At the end of the day, there are 3 things that you need to take care of:</p><ol><li>Observe how you spent your time (in minutes) on some productive work vs meetings vs learning. Refer to the image below.</li><li>On the basis of tasks and time division between work/meeting or learnings, add details on “According to you how was your day? Productive/Not-Productive/Average.”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/0*AhF9nKFBADSma0ZU.png" /><figcaption>Image by singlequote.blog</figcaption></figure><p>Also, at the end of the day, it will automatically create an Enisehhower Matrix to help you guide where you spent your time in all 4 quadrants. This is the time when you need a few minutes to analyze if you are not spending a lot of time in <strong>Quadrant 1</strong> which is the <strong>left-top box</strong> then there is an issue with your prioritization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/0*YIKigHXhWshtZYHv.png" /><figcaption>Result for the task distribution</figcaption></figure><h3>Step 4: Start your next day</h3><p>Next day before starting the day, go to the “Analysis” tab and check how much time you spent on the Quadrant 1(Urgent+Important) task yesterday. The target should be to avoid activities or tasks that were not falling into Quadrant 1 or at least Quadrant 2.</p><p>During this exercise, once we are done with tasks, then we will retrospect if this was really an urgent task and if you would have skipped it, then would it have impacted anything? or can it be delegated to someone else in the team? or can this be moved to some other time in future?</p><p>We are required to ask these questions to ourselves.</p><p><a href="https://singlequote.blog/eisenhower-method-to-dodge-all-the-blues/">You can read more about the Quadrants of Eisenhower Matrix and what task to put into what quadrant.</a></p><p>With this in mind, check your calendar and remove or move such meetings or tasks from your tasks list.</p><p>At the end of the 10th day, if you are dedicatedly working with the template, then you will find that you have a pattern figured out like what kind of tasks or meetings are consuming your time and how they can be avoided.</p><h3>Productivity Tips: What’s next, once you are done with Excercise?</h3><p>The above productivity tip is not a silver bullet. If you think that once you are done with this 10-day exercise it will resolve all your problems and you will not have to do anything in the future. Then, my friend, You are mistaken, at different points in time, our responsibilities at the workplace keep on changing.</p><p>So, we are required to repeat this 10 days exercise every year or a few months or whenever we feel like we are losing control of our time and we need to go back to our schedule where we can achieve more in less time.</p><p><strong>Quick Tip: </strong>If you are not using Excel on your Desktop, and you are using a browser for this sheet then use the browser which you do not use for your work. This will help you quickly find the browser using CMD+tab and will save time while entering task details. For example, if you are using Chrome for your official work on Macbook then you can use <a href="https://www.apple.com/in/safari/">Safari</a> for the sheet.</p><p>If you find this exercise helpful then motivate me to write more such posts for you. Share this with your friends, family, and colleagues to help them be more productive in life.</p><p>Ciao…</p><p><strong><em>[Author’s Corner]</em></strong></p><p><em>The 4×4 Matrix we used in our exercise is also known as the “Eisenhower Matrix”.</em></p><p><em>34th President of the United States </em><a href="https://singlequote.blog/you-like-ike-i-like-ike-everybody-likes-ike-president-eisenhower/"><strong><em>Dwight D. Eisenhower</em></strong></a><em> conceptualized Eisenhower Matrix or Eisenhower Decision Matrix during one of his speeches and then decades later, author Stephan Covey created a framework and popularized this framework in his book </em><a href="https://en.wikipedia.org/wiki/The_7_Habits_of_Highly_Effective_People"><em>The 7 Habits of Highly Effective People</em></a><em>.</em></p><p><em>That is the reason it is also popularized with the name “ </em><strong><em>Covey Eisenhower Matrix</em></strong><em>” or sometimes just the “ </em><strong><em>Covey Matrix</em></strong><em> “.</em></p><p><em>So, now from now on, if anyone asks these questions to you- “Can the Eisenhower method help me improve my productivity? What is the right way to use the Eisenhower Matrix? or How can we use Eisenhower Matrix in the most optimized way to improve my decision-making power?”</em></p><p><em>You can share these productivity tips with them to help them achieve good things in life.</em></p><p><em>Originally published at </em><a href="https://singlequote.blog/be-5-times-more-productive-stepwise-guide/"><em>https://singlequote.blog</em></a><em> on May 20, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d95a83990d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You like Ike, I like Ike, everybody likes Ike]]></title>
            <link>https://arglee.medium.com/you-like-ike-i-like-ike-everybody-likes-ike-454e5013315e?source=rss-16fea3dfb80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/454e5013315e</guid>
            <category><![CDATA[eisenhower]]></category>
            <category><![CDATA[eisenhower-matrix]]></category>
            <category><![CDATA[productivity-hacks]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[productivity-tools]]></category>
            <dc:creator><![CDATA[Ashish Mishra]]></dc:creator>
            <pubDate>Mon, 01 May 2023 18:54:51 GMT</pubDate>
            <atom:updated>2023-05-21T06:18:57.203Z</atom:updated>
            <content:encoded><![CDATA[<p>Bit of an unusual title for a blog? True, Now for some context — <a href="https://www.youtube.com/watch?v=YP7WaUPACuY">watch this short clip</a> shared by New York Historical Society and come back. This was a political public announcement of President Eisenhower ( <a href="https://www.whitehouse.gov/about-the-white-house/presidents/dwight-d-eisenhower/">Dwight David Eisenhower</a>) during his 34th presidential campaign.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mu8bJA9WIHvPrcuT1EbRxA.jpeg" /></figure><p>As per the sources on the Internet, between the years 1892–1909, in Kansas, when Dwight and his elder brother were in school, Dwight’s older brother was nicknamed “Big Ike” and he became “Little Ike”. This nickname followed him to West Point to the United States Military Academy where “little” was dropped and this followed him till his time to the presidency of the United States from <em>January 20, 1953-January 20, 1961</em>.</p><h3>A quick glance at President Eisenhower’s achievements</h3><p>During his two terms as president, he led many important contributions like the construction of interstate highway System, creating NASA, bringing armistice to Korean War; promoting Atoms for Peace; dealing with crises in Lebanon, Suez, Berlin, and Hungary, establishing the U.S. Information Agency, welcomed Alaska and Hawaii into the union and managed to keep the cold war with Russia cold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*T0PnMWOJiG9YXa2MyXDMtw.jpeg" /><figcaption><em>Dwight D. Eisenhower. Image Courtesy: </em><a href="http://dwight%20d.%20eisenhower/"><em>whitehouse.gov</em></a></figcaption></figure><p>Before becoming President, he served as a general in the United States Army and as the Allied Forces Supreme Commander during World War II. He also later became NATO’s first supreme commander.</p><p>Amazed! Yes? I was too when I first read about <strong>President Eisenhower’s accomplishments</strong> during one of my research.</p><p>You can read more about President Eisenhower at <a href="https://www.eisenhowerlibrary.gov/eisenhowers">Eisenhower library</a> If you wish to know more about his life.</p><h3>How President Eisenhower was able to achieve this much in his lifetime?</h3><p>Thanks to social media, very often we hear about so many notorious personalities like President Dwight. We hear they have accomplished so many things. Achieving in their lifetime which will not be possible for any of us to even imagine.</p><p>Have you ever wondered how some of these legends were able to knot their life in such a poetic manner. What these guys were doing that others were not?</p><p>All of us have the same 24 hours in a day, yet only a few have done so much. How many times, has it happened to you when you have spent all of your time managing crises or fires and at the end of the day, you feel completely drained and yet have nothing to find of real significance.</p><p>President Eisenhower during one of the speeches stated:</p><blockquote><strong><em>What is important is seldom urgent and what is urgent is seldom important.</em></strong></blockquote><blockquote><em>- Dwight D. Eisenhower</em></blockquote><p>I find this particular line left a deep impact on me, and this may be the difference between people like President Dwight and people like us.</p><p>Very often, I find myself questioning where my priority lies in any given situation? If there are multiple crises — then everything is important and during such time how to prioritize and plan for long goals to achieve the most? Yes, this is a tricky problem. Let us now see what President Eisenhower has to say about this:</p><blockquote><strong><em>Who can define for us with accuracy the difference between the long and short term! Especially whenever our affairs seem to be in crisis, we are almost compelled to give our first attention to the urgent present rather than to the important future.</em></strong></blockquote><blockquote><em>- Dwight D. Eisenhower, 1961 address to the Century Association</em></blockquote><p>To make it more clear, President Eisenhower explained that it is imminent to see what is urgent now or what can be pushed to later. Basically trick lies in finding what is most beneficial for the future time.</p><p>Today, we know that theory as the “<a href="https://singlequote.blog/eisenhower-method-to-dodge-all-the-blues/"><strong>Eisenhower Matrix</strong></a>” or “<a href="https://singlequote.blog/eisenhower-method-to-dodge-all-the-blues/"><strong>Eisenhower Method</strong></a>” of time management.</p><p>Per President Dwight, this theory helped him prioritize and deal with many high-stake crises he faced as US Army General, as President of the United States, and eventually, as Supreme Allied Commander of NATO Forces.</p><p>Though President Eisenhower has only conceptualized this. Decades later, author Stephan Covey created a framework and popularized it in his book <a href="https://en.wikipedia.org/wiki/The_7_Habits_of_Highly_Effective_People">The 7 Habits of Highly Effective People</a>.</p><h3>What we can do to align our time with important things?</h3><p>I know what you are thinking “This is straightforward and someone else can not categorize this for me”.</p><p>And Yes, you are absolutely correct. A person himself/herself needs to measure what is important to them using the framework. We will discuss this framework in the later part of the blog.</p><p><a href="https://singlequote.blog/be-5-times-more-productive-stepwise-guide/">How to use Eisenhower Matrix to measure and improve productivity</a> — can help you design your Day in the most productive way. I have tried to simplify the above concepts and created a template in the most easy-to-understand and use format.</p><p>This is a 10-day exercise where you add your activities every hour during your work day or for the time you want to be optimized. With this activity, you may also analyze your daily tasks. For example — if this was really a meeting or task that needed your time OR if could it be done without your presence?</p><p>Thus, categorizing and prioritizing your tasks accordingly. At the end of the day check the pattern of your most productive tasks along with the least ones, trying to enhance the former and fade out on the latter.</p><p>At the end of the few days(around the 5th day), you will start seeing an impact where you will start to get more time for tasks of real significance.</p><p><a href="https://singlequote.blog/eisenhower-method-to-dodge-all-the-blues/">Eisenhower Method to avoid/dodge ‘Monday Blues’</a> — can help you categorize the task on the right quadrant of the Eisenhower Matrix.</p><p>If you wish to know more about the Eisenhower matrix and how can we use it in the most optimized way then you can check out this page for the — <a href="https://singlequote.blog/be-5-times-more-productive-stepwise-guide/">stepwise process to use Eisenhower and improve productivity</a>.</p><p>If you love to work on Excel and it is your bread and butter then this — <a href="https://arglee.gumroad.com/l/EisenhowerMatrixExcelTemplate">Excel template for the Eisenhower Matrix</a> is nothing less than a treat for you. This Excel template not only lets you add your hourly tasks but also gives you a graphical presentation of your tasks. Read more about it <a href="https://singlequote.blog/be-5-times-more-productive-stepwise-guide/">here</a>.</p><p><em>Originally published at </em><a href="https://singlequote.blog/you-like-ike-i-like-ike-everybody-likes-ike-president-eisenhower/"><em>https://singlequote.blog</em></a><em> on May 1, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=454e5013315e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Dynamic Configuration — Python-Trick]]></title>
            <link>https://arglee.medium.com/python-dynamic-configuration-python-trick-c9a8b29fcb0a?source=rss-16fea3dfb80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9a8b29fcb0a</guid>
            <category><![CDATA[python-web-developer]]></category>
            <category><![CDATA[python-tricks]]></category>
            <category><![CDATA[python-scripting]]></category>
            <category><![CDATA[python-setup]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Ashish Mishra]]></dc:creator>
            <pubDate>Tue, 04 Apr 2023 07:19:08 GMT</pubDate>
            <atom:updated>2023-04-04T07:33:36.169Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python Dynamic Configuration — Python-Trick</h3><p>In this blog, we will discuss one easy-to-use python trick that could be very handy for a quick program or repository you are creating for your individual project or for your organization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JA6uvyFyidZaYk1w" /><figcaption>Photo by <a href="https://unsplash.com/@jantined?utm_source=medium&amp;utm_medium=referral">Jantine Doornbos</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I am sure you are already aware of the importance of configuration files in any programming language. Managing configuration files is the most important part of any software development process.</p><p>In order to understand this, we will first discuss the traditional approach and then we will discuss how a small class in python can help you avoid multiple iterations in your config file.</p><h3>Traditional Approach</h3><p>In order to make both approaches more intelligible, we will take an example code and will implement both approaches to see the impact of the trick.</p><p>Let’s create a folder configuration and add these 2 files inside it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/0*q_CHkvYAzmfWN3Hm.png" /></figure><p><strong><em>settings.ini</em></strong><em> </em>file looks something like this:</p><pre>[RUN]<br>num_cores = 2<br>num_files = -1</pre><p>Now to parse the configuration, we use another file. let’s say config.py</p><pre>import os<br>import configparser<br><br>parser = configparser.ConfigParser()<br>parser.read_file(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), &quot;settings.ini&quot;)))<br><br>NUM_CORES = parser.get(&#39;RUN&#39;,&#39;num_cores&#39;)<br><br>print (&quot;Number of cores available : &quot;, parser.get(&#39;RUN&#39;,&#39;num_cores&#39;))</pre><p>The output of the above script will look something like this:</p><pre>➜  configuration python config.py<br>Number of cores available :  2</pre><p>This is straightforward and easy, now every time, we want to add a new config, there is an easy way just to add a new variable and use that inside code. so, let’s consider now we also want the value of <em>NUM_FILES</em> in the code, then new code will look something like this:</p><pre>import os<br>import configparser<br><br>parser = configparser.ConfigParser()<br>parser.read_file(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), &quot;settings.ini&quot;)))<br><br>NUM_CORES = parser.get(&#39;RUN&#39;,&#39;num_cores&#39;)<br>NUM_FILES = parser.get(&#39;RUN&#39;,&#39;num_files&#39;)<br><br>print (&quot;Number of cores available : &quot;, parser.get(&#39;RUN&#39;,&#39;num_cores&#39;))<br>print (&quot;Number of cores available : &quot;, parser.get(&#39;RUN&#39;,&#39;num_files&#39;))</pre><p>and now the NUM_FILES variable can be used across your project to get the value of this variable.</p><p>But how many times has this happened to you that you have to add these same lines every time you want to add a new variable, you would agree that this could be painful sometimes and it could halt your train of thought.</p><h3>Dynamic configuration:</h3><p>What if I tell you there is an easy way out and you can initialize the whole .ini file dynamically and there is no need to parse every variable explicitly.</p><p>Now, in order to do that, I have added a new file <strong>dynamic_config_parser.py</strong> and its content will look something like this:</p><pre>import configparser<br><br>class DynamicConfig:<br>    def __init__(self, conf):<br>        if not isinstance(conf, dict):<br>            raise TypeError(f&#39;dict expected, found {type(conf).__name__}&#39;)<br><br>        self._raw = conf<br>        for key, value in self._raw.items():<br>            setattr(self, key, value)<br><br>class DynamicConfigInit:<br>    &quot;&quot;&quot;<br>    This class is used to dynamically load static variables from the settings.ini file. Any va<br>    variable declared in the settings.ini can be parsed directly.<br>    &quot;&quot;&quot;<br>    def __init__(self, conf):<br>        if not isinstance(conf, configparser.ConfigParser):<br>            raise TypeError(f&#39;ConfigParser expected, found {type(conf).__name__}&#39;)<br><br>        self._raw = conf<br>        for key, value in self._raw.items():<br>            setattr(self, key, DynamicConfig(dict(value.items())))</pre><p>and now your <strong>config.py</strong> will look something like this:</p><pre>import os<br>import configparser<br>from dynamic_config_parser import DynamicConfigInit<br><br>parser = configparser.ConfigParser()<br>parser.read_file(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), &quot;settings.ini&quot;)))<br>STATIC_CONFIG = DynamicConfigInit(parser)<br><br>print(&quot;Number of cores from dynamic config: &quot;, STATIC_CONFIG.RUN.num_cores)</pre><p>Viola! That’s it. We are done.</p><p>As you see, now there is no requirement to add every variable every time into config.py, and dynamic config initialization is handling this for you and you can save a long repetitive file with a huge configuration.</p><p><em>Originally published at </em><a href="https://singlequote.blog/python-dynamic-configuration/"><em>https://singlequote.blog</em></a><em> on April 4, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9a8b29fcb0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Continuous Data Load from S3 to Snowflake(Snowpipe): Stepwise Process, Benchmarks & Cost]]></title>
            <link>https://arglee.medium.com/continuous-data-load-from-s3-to-snowflake-snowpipe-stepwise-process-benchmarks-cost-c63828c74b8e?source=rss-16fea3dfb80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c63828c74b8e</guid>
            <category><![CDATA[realtime]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[data-warehous]]></category>
            <category><![CDATA[snowpipe]]></category>
            <category><![CDATA[s3]]></category>
            <dc:creator><![CDATA[Ashish Mishra]]></dc:creator>
            <pubDate>Tue, 21 Feb 2023 02:02:44 GMT</pubDate>
            <atom:updated>2023-02-24T10:04:43.438Z</atom:updated>
            <content:encoded><![CDATA[<p>What is continuous data load in Snowflake? What are the ways to achieve the continuous data load in snowflake? What are the cost and benchmarks for the solution? What are the ways to reduce the significant cost of continuous data load to snowflake? and last but not least what are the limitations of the solution?</p><p>We will discuss each of these questions in this blog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yxhcVaB-42xGEkAE" /><figcaption>Photo by <a href="https://unsplash.com/@aaronburden?utm_source=medium&amp;utm_medium=referral">Aaron Burden</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><a href="https://singlequote.blog/bulk-data-load-from-s3-to-snowflake-stepwise-process-benchmarks-cost/">In the last post on bulk data load</a>(<a href="https://arglee.medium.com/bulk-data-load-from-s3-to-snowflake-stepwise-process-benchmarks-cost-2bbb77b16ac7">medium link</a>), we discussed 2 things:</p><ol><li>How to load bulk data (micro-batches) having a high frequency, on snowflake using copy command?</li><li>What will be the cost for the solution if the frequency is higher?</li></ol><p>Please go through the last post <a href="https://singlequote.blog/bulk-data-load-from-s3-to-snowflake-stepwise-process-benchmarks-cost/">here</a>, If you are reading my article for the first time. It will help you to create an understanding of how AWS and Snowflake create handshake to share data between the 2 technologies.</p><h3>What is Continuous Data Load in Snowflake?</h3><p>Snowflake provides a serverless solution, where files coming on the Object Storage(like S3 in this case) will be loaded on Snowflake table without using any external resource and Snowflake will charge for compute usage while data loading.</p><p>Continuous data load can be achieved by Snowflake using these different ways:</p><ol><li><strong>Snowpipe: </strong>Easiest and one of the most popular solutions as it requires the least effort and is categorized as a zero code solution.</li><li><strong>Kafka Connector for Snowflake: </strong>Reads data from Apache Kafka topics and loads the data into a Snowflake.</li><li><strong>Third-Party Data Integration Tools: </strong><a href="https://docs.snowflake.com/en/user-guide/ecosystem-etl.html">Read more about these integrations on Snowflake official website</a> about existing and new integrations.</li></ol><h3>How Does Snowpipe Work?</h3><p>Snowpipe loads data from files as soon as data or files are available in the stage and runs a copy statement to load the data into the Snowflake. But how does Snowflake knows that there are new staged files available?</p><p>There are 2 ways for detecting staged files:</p><ol><li>Event Notification from S3 bucket. <a href="https://singlequote.blog/listing-billion-number-of-s3-objects-into-sqs-challenges-benchmarks/#Challenges_with_the_Process">Read more about s3 event notification and cost of the process here</a>.</li><li>Calling Snowpipe REST endpoints.</li></ol><p>In this blog, we will discuss around the first point, where we will utilize the event notification from cloud storage (S3 in this case) to automate the continuous data load using Snowpipe. At the end of this blog, we will also discuss which solution should be preferred for high-frequency data and which solution is cost-effective.</p><h3>What are the Steps to load Continous Data using Snowpipe?</h3><p>Continuous data load in Snowflake using Snowpipe is a 5 step process.</p><p>Few of the initial steps to configure the access permission are similar to the <a href="https://arglee.medium.com/bulk-data-load-from-s3-to-snowflake-stepwise-process-benchmarks-cost-2bbb77b16ac7">Bulk load data using Copy Command</a>. In this blog, we will refer few of the previous post links to keep this blog precise.</p><h3>Step 1: Create Storage Integration &amp; Access Permissions</h3><p>Refer to <a href="https://arglee.medium.com/bulk-data-load-from-s3-to-snowflake-stepwise-process-benchmarks-cost-2bbb77b16ac7">step 2 in this document</a> (<a href="https://arglee.medium.com/bulk-data-load-from-s3-to-snowflake-stepwise-process-benchmarks-cost-2bbb77b16ac7">Medium Link</a>) for storage integration.</p><h3>Step 2: Create Stage Objects</h3><p>Refer to <a href="https://arglee.medium.com/bulk-data-load-from-s3-to-snowflake-stepwise-process-benchmarks-cost-2bbb77b16ac7">step 3 in this document</a> (<a href="https://arglee.medium.com/bulk-data-load-from-s3-to-snowflake-stepwise-process-benchmarks-cost-2bbb77b16ac7">Medium Link</a>) for stage objects.</p><h3>Step 3: Create a Pipe with Auto-Ingest Enabled</h3><p>The pipe uses the <a href="https://arglee.medium.com/bulk-data-load-from-s3-to-snowflake-stepwise-process-benchmarks-cost-2bbb77b16ac7">COPY INTO &lt;table&gt; command</a> internally to load data in an automatic fashion whenever a new notification for file ingestion gets received.</p><pre>create pipe mypipe auto_ingest=true as<br>  copy into employee_data<br>  from @my_csv_stage<br>  file_format = (type = &#39;CSV&#39;);</pre><p>The <em>AUTO_INGEST=TRUE</em> is important to specify to read event notifications sent from an S3 bucket to an SQS queue when new data is ready to load.</p><h3>Step 4: Provide Permission to the user which will run Snowpipe</h3><p>If you are an account admin or have a higher access level (because you are trying this on a newly created personal Snowflake), in that case, you can skip this step, else you can give permission to the current role and user as follows:</p><pre>-- Create a role to contain the Snowpipe privileges<br>use role securityadmin;<br><br>create or replace role snowpipe1;<br><br>-- Grant the required privileges on the database objects<br>grant usage on database snowpipe_db to role snowpipe1;<br><br>grant usage on schema snowpipe_db.public to role snowpipe1;<br><br>grant insert, select on snowpipe_db.public.mytable to role snowpipe1;<br><br>grant usage on stage snowpipe_db.public.mystage to role snowpipe1;<br><br>-- Grant the OWNERSHIP privilege on the pipe object<br>grant ownership on pipe snowpipe_db.public.mypipe to role snowpipe1;<br><br>-- Grant the role to a user<br>grant role snowpipe1 to user jsmith;<br><br>-- Set the role as the default role for the user<br>alter user jsmith set default_role = snowpipe1;</pre><h3>Step 5: Configure S3 for Event Notification for Snowpipe Configuration</h3><p>This is an important step. For ease of the user, Snowflake managed SQS can be used to send new events from your S3 bucket.</p><p><strong>How Snowpipe Loads Data into Snowflake?</strong></p><p>As depicted in the below diagram, as soon as new files come to the external stage(in this case, this is personal or your organization’s bucket), an event notification gets triggered and the notification gets stored in the SQS Queue(which is Snowflake managed or on Snowflake AWS cloud and outside your organization account and VPC).</p><p>A pipe(consumer) is configured at the Snowflake end which keeps on listening to the SQS queue and sends a notification to snowflake for compute provisioning and starts ingesting data into Snowflake using copy command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t8wqedFBQivs24NNOE8k5g.png" /><figcaption>Image Courtesy: snowflake.com</figcaption></figure><p>Thus, what is pending now is to create an S3 event notification and configure SQS queue.</p><p>In order to get SQS ARN (managed by snowflake), run the following command on Snowflake and copy the SQS ARN from notification_channel column as shown in the picture below.</p><pre>show pipes;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NAUEaZcl4Z4v4PbFfU0ytg.png" /></figure><p>Now follow this sequence to add and create S3 notification</p><blockquote>AWS S3 console &gt;&gt; Properties &gt;&gt; Event Notification &gt;&gt; Create Event Notification &gt;&gt; add path &amp; SQS ARN &gt;&gt; Save/Submit</blockquote><p>If you are still with me then we have completed all the steps and now is the time to test the continuous load by uploading files on the S3 bucket.</p><h3>Step 6: Validate the Data Load using Snowpipe</h3><p>Now, if you have uploaded files on S3 then you will start seeing the data on the table, If the data is still not loaded, then you probably have these questions in your mind.</p><ul><li><strong>How to check if Snowpipe is successfully established?</strong></li></ul><p>Run the following command on Snowflake to check if the connection is successfully established. Here ‘mypipe’ is the name of the pipe created in Step 3.</p><pre>select SYSTEM$PIPE_STATUS(&#39;mypipe&#39;);</pre><p>This command will return a JSON response, where “executionState”:”RUNNING” denotes if everything has been setup properly and as expected.</p><ul><li><strong>I have uploaded the file on S3, but why the data is still not visible in the table using Snowpipe?</strong></li></ul><p>If you have uploaded the file on S3, but data is not yet loaded onto the table, then check the issue with the content using this command:</p><pre>select * from table(validate_pipe_load(<br>  pipe_name=&gt;&#39;MYPIPE&#39;,<br>  start_time=&gt;dateadd(hour, -24, current_timestamp())));</pre><p>This command returns result, a sample of which is shown below, which shows if there was any problem with data or compatible schema.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*eqMqmeEh_ouNMhSCIuKsiw.png" /><figcaption>Image by <a href="https://medium.com/u/16fea3dfb80f">Ashish Mishra</a></figcaption></figure><ul><li><strong>SYSTEM$PIPE_STATUS command is showing the last ingested file but why data is not visible in the target table?</strong></li></ul><p>There are chances that <strong>SYSTEM$PIPE_STATUS </strong>command will show <em>lastIngestedFilePath</em> and <em>lastForwardedFilePath</em><strong><em> </em></strong>as the correct path but the file is not loaded, this happened due to reason that there is some problem with the file as mentioned in the above question.</p><ul><li><strong>When using Snowpipe, why am I not able to see any entry in load_history table for success or failure?</strong></li></ul><p>All the data loaded or failed using Snowpipe do not create an entry in load_history instead it uses ‘<em>pipe_usage_history</em>’ for this purpose.</p><pre>select *<br>  from table(information_schema.pipe_usage_history(<br>    date_range_start=&gt;dateadd(&#39;hour&#39;,-24,current_timestamp()),<br>    pipe_name=&gt;&#39;mypipe&#39;));</pre><h3>How Snowpipe Cost is Calculated?</h3><ul><li>Compute resources is necessary to decompose, decrypt and transform the new data. Snowflake adds costing for compute usage.</li><li>Apart from this an overhead cost for managing files in the internal Snowpipe queue is also included and this overhead charge increases with proportion to the number of files queued for loading and the size of files loaded(more time to load a file will increase queue time and thus cost).</li></ul><p>In order to validate and get some approximation, I have run a few experiments as below:</p><p><strong>Snowpipe charges approximately 0.06 USD per 1000 files queued.</strong></p><p>With my experiment, it consumed around 0.000287202 Credits = 0.001148808 USD for 10K rows CSV file.</p><blockquote>One important point that I noticed while doing this experiment is that there is no definite latency on Snowpipe load and sometime it takes unabruptly more time to load data and there is not much you can do during that time. I guess Snowflake should add more transparancy during the whole process.</blockquote><h3>How to reduce cost in Snowpipe?</h3><ul><li>File size should be roughly 10–100MB(Snowflake Documentation has referred to around 100–250MB, but my recommendation is to keep the file size smaller) in size compressed.</li><li>Try to reduce the total time to aggregate file data within 1 min. One way to try this is if your source application takes more than 1 minute to accumulate the data, then consider creating split data files once per minute.</li><li>If there are more frequent files at the stage location and more than one file is coming within a minute, in this case Snowpipe will utilize the internal load queue to manage these files and overhead cost will increase.</li><li>Snowflake recommends enabling S3 event filtering for Snowpipe to reduce event noise, latency, and finally cost.</li><li>If file size in the above range is not possible, then consider removing <strong>“SKIP_FILE”</strong> as the default option for Snowpipe, as it might waste a lot of resources and credits and might cause a huge delay. The better option would be <strong>“CONTINUE”</strong> for such cases.</li></ul><h3>Things to Note:</h3><ul><li>Only Snowflake hosted on AWS supports AWS S3 event notification for Snowpipe(by the time this blog was posted).</li><li>When you use AWS SQS notification then data moves out of your current VPC and this traffic is not protected by your VPC.</li><li>All data types are supported, including semi-structured data types such as JSON and Avro.</li><li>Snowpipe does not load a file with the same name if it has been modified later, because Snowpipe maintains metadata for itself and changing the name doesn’t modify this metadata.</li><li>Snowpipe maintains load history only for 14 days, a modified file can be loaded after 14 days as metadata will not be valid then. While bulk data load keeps this metadata for 64 days.</li><li>Snowpipe does not guarantee that files will be loaded in the same order they were staged, though if files are not getting staged at exceptionally high velocity, then order violation will be visible or detectable. In order to handle this it is recommended to load smaller files once per minute. Load order is not maintained due to multiple processes pulling files from the queue and depending upon the time to load, the sequence of data load could appear as different.</li><li>By default, Snowflake applies <strong>“SKIP_FILE” </strong>when there is an error in loading files, while copy command uses <strong>ABORT_STATEMENT</strong> as the default behavior.</li><li>Snowflake caches the temporary credentials for a period that cannot exceed the 60 minutes expiration time. If you revoke access from Snowflake, users might be able to list files and load data from the cloud storage location until the cache expires.</li></ul><h3>Conclusion:</h3><p>After my experiment with Snowpipe, These are my takes:</p><ul><li>It was not able to handle high-velocity files, where a lot of files are coming at a higher pace and of course, maintaining the order was a big issue.</li><li>When the file size is higher(between 100MB to 200MB) then it takes an unexpectedly huge time to load, while the same file can be loaded in less time using copy command.</li><li>Once a file is loaded on S3, there is not much visibility of the files status and queue length and it becomes tricky to check why files are not loaded and debugging becomes tricky. (If you have found any solution for this then please comment).</li><li>Snowpipe is good for very small files with the very low frequency where the latency of file ingestion is not a determining factor.</li></ul><h4>References:</h4><ol><li><a href="https://docs.snowflake.com/en/user-guide/data-load-snowpipe-auto-s3#step-3-configure-security">Snowflake Official Documentation</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c63828c74b8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>