<?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 CAW Blogs on Medium]]></title>
        <description><![CDATA[Stories by CAW Blogs on Medium]]></description>
        <link>https://medium.com/@CAWBlogs?source=rss-9543bec17908------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Y4CRDWSCti8CHPtzIJWujA.png</url>
            <title>Stories by CAW Blogs on Medium</title>
            <link>https://medium.com/@CAWBlogs?source=rss-9543bec17908------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 16:03:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@CAWBlogs/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[Why Conversational AI Implementation Teams are needed for Achieving Business Excellence?]]></title>
            <link>https://medium.com/@CAWBlogs/why-conversational-ai-implementation-teams-are-needed-for-achieving-business-excellence-3e12b103243d?source=rss-9543bec17908------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e12b103243d</guid>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[chatbots-for-business]]></category>
            <category><![CDATA[chatbot-platforms]]></category>
            <category><![CDATA[chatbot-development]]></category>
            <category><![CDATA[chatbot-design]]></category>
            <dc:creator><![CDATA[CAW Blogs]]></dc:creator>
            <pubDate>Wed, 23 Aug 2023 08:05:48 GMT</pubDate>
            <atom:updated>2023-08-25T07:17:12.826Z</atom:updated>
            <content:encoded><![CDATA[<p>Original work by Deeksha Shriwas <br>Rework and Edits: <a href="https://medium.com/u/bc845376bb85">Hamna Naseer</a> || <a href="https://medium.com/u/94f40e78ee2b">Allan Harold Rex</a></p><p>This is part of a series of Blogs from CAW Studios on Conversational AI Implementation solutions.</p><p>Chapter 1: <strong><em>Why Conversational AI Implementation Teams are needed for Achieving Business Excellence? (You are here)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YAFl_SCc7A_SmBkF41FZCQ.jpeg" /><figcaption>Conversational AI Implementation Teams — a need of the hour.</figcaption></figure><blockquote><strong><em>CAW Studios stands as a dynamic Product Engineering firm with a primary commitment to realizing Conversational AI in action. Collaborating closely with leading Global Vendors, CAW Studios excels in providing innovative conversational AI solutions that cater to diverse business needs.</em></strong></blockquote><blockquote><a href="https://calendly.com/caw-studios-consulting/30min"><strong><em>Talk to us for a free consultation</em></strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s-Ux3v079DBCTEc82UNbFw.jpeg" /><figcaption>Conversational AI Projects Require Collaborative Teams of Developers and Conversation Designers</figcaption></figure><p>In today’s business landscape, it’s important to grasp the concept of conversational assistants such as chatbots and voice bots. New AI advancements like ChatGPT and DALL-E have demonstrated their capabilities. But have you delved sufficiently into their potential for your business?</p><p>If you’ve got the basics down and are curious about their fit for established companies, concerns about privacy, or the potential for employee replacement, then this article is tailored to your needs. Let’s dive in!</p><p><strong>Let us look at a scenario to understand how AI can help Businesses:<br></strong>Picture yourself managing a worldwide travel company. Suddenly, a crisis emerges in a country where your travelers are. Your customers are stranded, anxious, and seeking aid. In response, your company launches a WhatsApp alert, guiding all clients to an intelligent WhatsApp bot. This bot offers instant updates, personalized help, multilingual voice aid, emergency contacts, automated rescheduling, and round-the-clock support. This chatbot becomes a crucial element for boosting customer contentment, efficiently managing crises, and enhancing the overall experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6UEfWsaQ0w4e58WDu-Aj5Q.jpeg" /><figcaption>Chatbot Communications can get as cumbersome as real world communication.</figcaption></figure><p><strong>AI for Business Optimization:</strong></p><p>In today’s digital world, customers expect quick responses and 24/7 availability. Automation tools like chatbots have been in use for quite some time. The first chatbot, ELIZA, was developed in the 1960s by Joseph Weizenbaum. The possibilities of this technology for your business are vast and limited only by your imagination. Oh, the things you can do!</p><blockquote><strong><em>AI consultant firms like CAW Studios help businesses pick the best conversational AI technologies for your firms.</em></strong></blockquote><h3><strong>To start off, let us also look at two conversational interfaces:</strong></h3><h4><strong>Text-based chatbots:</strong></h4><p>These bots communicate through text, suitable for non-urgent conversations and when users prefer text. AI models use natural language processing techniques (NLP) to generate human-like responses.</p><p><em>Chatbot — Think of a Medical Assistant:</em></p><ul><li>A chatbot is like having a smart assistant in the provider’s computer system.</li><li>It can help patients by scheduling appointments, answering common questions, and guiding them on medication refills.</li><li>Just like a real medical assistant makes administrative tasks easier, a chatbot makes patient interactions quicker and more accurate.</li></ul><h4><strong>Voice-based Chatbots:</strong></h4><p>A voice bot is programmed to interact with its users via spoken language. It can be implemented on voice-enabled gadgets. Natural language understanding (NLU) and text-to-speech (TTS) technologies generate spoken responses for voice chatbots using automatic speech recognition (ASR). These bots use spoken language and are ideal for time-sensitive situations or when texting isn’t practical.</p><p><em>Voicebot — Think of a Healthcare Concierge:</em></p><ul><li>A voicebot is like having a friendly healthcare expert who talks to patients.</li><li>It can ask about symptoms, remind patients to take their medicine, and even help book follow-up appointments.</li><li>Similar to how a healthcare concierge provides personalized care, a voicebot adds a human touch to interactions.</li></ul><p><strong>How to choose the right technology?</strong><br>To choose the right technology, the healthcare provider needs to think about what their patients want. If they need fast, straightforward help with appointments and basic questions, a chatbot is great. But if they want a more focused conversational experience that deals with health concerns, a voicebot might be better.</p><p>And remember, you can also use a combination of chatbots and voicebots together for the best of both worlds!</p><p><strong>Let us look at some of the benefits of this:</strong></p><ul><li><strong>24/7 Availability</strong>: Bots are always ready to help, even when your team isn’t.</li><li><strong>Scalability</strong>: They can handle lots of conversations at once, without needing more people.</li><li><strong>Cost Efficiency:</strong> Bots save money by doing repetitive tasks, so you don’t need to pay extra staff.</li><li><strong>Consistency</strong>: Bots always give the same, correct answers, reducing mistakes.</li><li><strong>Data Insights:</strong> They learn from talking to people, so you can make smarter decisions.</li></ul><h3><strong>Despite implementing your company’s chatbot, how likely are you to expect error-free communication from it?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*hIEH_xmH0QB5ZW_H5StHZw.png" /><figcaption>Will ChatGPT and A.I. ‘hallucinations’ will ever go away?</figcaption></figure><p>Yes! There exists major implementation challenges of Chatbots and LLMs:</p><ul><li><strong>Bot breaks</strong>- A “bot break” is a pause/break in your conversation when the chatbot cannot understand your input.</li><li><strong>AI Hallucinations-</strong> AI hallucination is when the chatbot says things that aren’t true because it’s confused about user input.</li><li><strong>Linguistic barrier</strong>: A linguistic barrier is when bots find it hard to understand user input because they speak a different language or can’t understand colloquial slang words.</li></ul><p><strong>Why is this happening?</strong></p><p>Yes, despite the buzz, a Forbes study shows AI projects fail nearly 50% of the time.<br>Key causes include:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eSrsHvGSmX1Rf_3oURkrlg.jpeg" /><figcaption>Narrow focus, <strong>neglecting </strong>broader <strong>digital integratio</strong>n in Conversational AI projects</figcaption></figure><ul><li><strong>Creating MVP bots</strong> with narrow focus, <strong>neglecting </strong>broader <strong>digital integratio</strong>n.</li><li><strong>Bots </strong>should <strong>reflect </strong>brand <strong>gradually </strong>with <strong>governance </strong>to avoid damage like Microsoft’s TAY.</li><li><strong>ML-based bots</strong> need<strong> extensive training </strong>for coherent conversations.</li><li>Prioritizing <strong>Proof of Concept over Proof of Value</strong> results in rushed, under-analyzed implementation.</li></ul><h4><strong>The Mythical Vendor vs Client Misalignment challenge</strong></h4><p>That is not it; if these are implementation challenges, there can be some vendor vs client-level challenges too. Sometimes, it’s about how the company making the chatbot (we call them the “vendor”) and the company using it (we call them the “client”) work together.</p><p><strong>Here’s an example:</strong> The vendor has a product, like the platform used to build the chatbot. They also have a team of people who design, train conversations, write the code, and check everything to make sure it works well. But sometimes, even with all this, the vendor might agree to do a project for the client and then not finish it.</p><p>There can be a bunch of reasons for this. Maybe the <strong>vendor platform</strong> doesn’t have <strong>enough capabilities</strong> or their product can’t do what the client needs. Or maybe there was a <strong>misalignment </strong>on what was <strong>offered</strong>.</p><p>When this happens, it’s not good for anyone. It wastes time, money, and resources. So, clients need to be careful and pick the right vendors. They should also make sure everything is clear in the project plan from the start to avoid problems later on.</p><h4><strong>How CAW Studios can help you in implementing AI Solutions?</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mFUKrTBqsiQrQnUELxQ-Dw.jpeg" /><figcaption>Multimodal conversational design like real life conversation. Easily switch across contexts, capabilities, or even devices.</figcaption></figure><p><strong>Address challenges in Building Chatbots<br></strong>We recognize that the process of developing chatbots poses difficulties.</p><p><strong>Expert AI Consultation<br></strong>Such a firm can identify and address the challenges effectively.</p><p><strong>Optimal Solutions for Your Company<br></strong>Emphasising that tailored solutions can be found for your company’s needs.</p><p><strong>Natural Language Understanding and Specialised training for Bots<br></strong>To interact with users in a human-like manner, bots are extensively trained.</p><p>CAW Studios ensures that Chatbots and Voicebots can understand natural language, interact with people naturally, and feel emotions. They extensively train the bots on the platform specifically designed for them. So what is the wait? Reach out to us to book a consultation!</p><blockquote><strong><em>CAW Studios stands as a dynamic Product Engineering firm with a primary commitment to realizing Conversational AI in action. Collaborating closely with leading Global Vendors, CAW Studios excels in providing innovative conversational AI solutions that cater to diverse business needs.</em></strong></blockquote><blockquote><a href="https://calendly.com/caw-studios-consulting/30min"><strong><em>Talk to us for a free consultation</em></strong></a></blockquote><p>About <a href="https://medium.com/u/bc845376bb85">Hamna Naseer</a> || <a href="https://medium.com/u/94f40e78ee2b">Allan Harold Rex</a></p><p><strong><em>Hamna Naseer </em></strong><em>is a Conversational AI Consultant @</em><a href="https://medium.com/u/9543bec17908"><em>CAW</em></a><em> Studios, driving Conversational projects. <br></em><strong><em>Allan HR</em></strong><em> is a Manager @CAWStudios, Hyderabad, driving CAI projects &amp; partnerships</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e12b103243d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Web Apps should have Versioning?]]></title>
            <link>https://medium.com/@CAWBlogs/why-web-apps-should-have-versioning-ae69b3e212d7?source=rss-9543bec17908------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae69b3e212d7</guid>
            <category><![CDATA[web-app-development]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[bug-fixes]]></category>
            <category><![CDATA[app-development]]></category>
            <dc:creator><![CDATA[CAW Blogs]]></dc:creator>
            <pubDate>Mon, 19 Jun 2023 11:33:37 GMT</pubDate>
            <atom:updated>2023-06-19T11:54:06.983Z</atom:updated>
            <content:encoded><![CDATA[<p>By <a href="https://medium.com/u/f57849c16598">Kartik Bansal</a> <a href="https://medium.com/u/40fde1c0e6f6">Mathura Das</a></p><p><strong>This is a two-part blog series. <br><em>In the first part, we look at the reasons why we do versioning for Web Apps at CAW Studios (</em></strong><a href="https://medium.com/u/9543bec17908"><strong><em>CAW Blogs</em></strong></a><strong><em>)</em></strong></p><p>In the second part, we talk about our versioning strategy.</p><p>Maybe imagine the versioning of apps as a battle between Dr. Strange and Dormammu from the climax of the movie “Doctor Strange.” Dr. Strange represents the app developer, and Dormammu symbolizes the new version of the app.</p><p>Dr. Strange, the developer, possesses the ability to manipulate time and outcomes, just like how app developers have the power to shape the future of their applications. Each time a new version of the app is released, it is like Dr. Strange entering into a confrontation with Dormammu.</p><p>Dormammu, the new version of the app, is a powerful entity that brings both challenges and opportunities. Just as Dormammu presents Dr. Strange with new obstacles and threats, a new app version may introduce bugs, compatibility issues, or design flaws that need to be addressed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9WKtat_VDQEvmRq_vAkfNw.jpeg" /><figcaption>Web apps are not static entities; they evolve over time</figcaption></figure><p>Yes, maintaining a stable and reliable web app can be challenging in the fast-paced world of web development, where updates and changes are frequent.</p><p>Implementing versioning in web applications is one effective way to mitigate risks and ensure smooth operations. Versioning allows developers to track and manage changes, maintain compatibility, and provide a seamless user experience.</p><p>In this blog post, we will explore the significance of versioning in web apps and why it should be integral to every developer’s toolkit.</p><h3><strong>Facilitating Continuous Development:</strong></h3><p>Web apps are not static entities; they evolve over time to meet changing requirements, add new features, and address bugs or security vulnerabilities.</p><blockquote><strong>By assigning version numbers to different releases, developers can track the progress and growth of their applications.</strong></blockquote><p>Many of the Web Apps at CAW move to production several times a week. Versioning plays a crucial role in facilitating continuous development. This enables them to implement new features, fix bugs, and deploy updates while maintaining a structured and organized development process.</p><h3><strong>Enabling Compatibility and Dependency Management</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*GwI_DyNvRedTrLaHj40EJQ.png" /><figcaption>Web apps rely on libraries, frameworks, and third-party dependencies.</figcaption></figure><p>Web apps often rely on various libraries, frameworks, and third-party dependencies. These external components are subject to updates, bug fixes, and new releases, which may introduce changes incompatible with the existing codebase.</p><blockquote>By implementing versioning, developers can manage and control these dependencies effectively.</blockquote><p>With versioning, developers can define the compatibility requirements of their app with specific versions of external dependencies. This ensures that updates to those dependencies do not break the app’s functionality. Additionally, versioning enables developers to communicate compatibility expectations to other developers and users, reducing the chances of integration issues and facilitating seamless collaboration.</p><p><strong>Streamlining Bug Fixes and Maintenance:</strong></p><p>No application is immune to bugs and issues. When a bug is discovered, versioning allows developers to pinpoint the exact app version where the problem arose, making it easier to identify and resolve the issue. By maintaining a history of versions, developers can quickly roll back to a previous version, patch the problem, and release an updated version with the fix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*xezruQqQ8FJsxAJNpBpKAQ.png" /><figcaption><strong>Maintaining a history of versions helps release an updated version with the fix.</strong></figcaption></figure><p>Versioning also helps in managing the lifecycle of an application by distinguishing between major and minor updates. Major version releases may include significant changes, such as new features or architectural modifications, while minor versions focus on bug fixes, security updates, and performance improvements. This distinction helps users understand the implications of each update and plan their own upgrade strategy accordingly.</p><p><strong>Building Trust and Communication:</strong></p><p>Versioning fosters trust between developers and users by promoting transparency and clear communication. When developers adhere to a versioning scheme and release notes, users can easily understand what changes have been made in each update and make informed decisions about when to upgrade. Transparent versioning also enhances accountability, as developers can clearly track the impact of their changes and take responsibility for any issues that may arise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*lItSxSH1TkhH9KVgaBq_Xg.png" /><figcaption><strong>Versioning fosters trust between developers</strong></figcaption></figure><p>Moreover, versioning helps in establishing a reliable support system. Users encountering problems or seeking assistance can provide the specific version number, making it easier for developers to identify and resolve issues efficiently. The ability to reference specific versions enhances troubleshooting capabilities and streamlines the process of providing support.</p><p>Versioning is an essential aspect of web app development, enabling developers to manage changes, maintain compatibility, and provide a seamless user experience. By implementing versioning, developers can streamline continuous development, manage dependencies effectively, streamline bug fixes and maintenance, build trust with users, and improve communication. Embracing versioning as a best practice in web app development allows developers to create robust, stable, and reliable applications that can adapt and grow with the evolving needs of their users.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae69b3e212d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Conversational AI Enabled Digital Transformation for an Indian Chamber of Commerce?]]></title>
            <link>https://medium.com/@CAWBlogs/how-conversational-ai-enabled-digital-transformation-for-an-indian-chamber-of-commerce-be3714046968?source=rss-9543bec17908------2</link>
            <guid isPermaLink="false">https://medium.com/p/be3714046968</guid>
            <category><![CDATA[user-research]]></category>
            <category><![CDATA[conversation-design]]></category>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[chatbot-design]]></category>
            <category><![CDATA[conversational-ai]]></category>
            <dc:creator><![CDATA[CAW Blogs]]></dc:creator>
            <pubDate>Tue, 04 Apr 2023 15:21:37 GMT</pubDate>
            <atom:updated>2023-04-04T15:24:10.615Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Experience the power of Conversational AI with CAW Studios, your go-to partner for building chatbots and virtual assistants. Our exclusive focus on the Indian market allows us to explore the vast possibilities of this technology and share our experiences and learnings with you.</em></p><p><a href="https://www.linkedin.com/company/caw-studios"><em>Follow </em></a><em>our informative blog series as we delve into the intricacies of Conversational AI and its implementation in various use cases. Stay tuned for our upcoming posts and elevate your business to the next level with CAW Studios.</em></p><p><strong><em>1.Digital Transformation of an Indian Chamber of Commerce (You are here)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*bli0u5s6y8WxkymS1lo1cw.jpeg" /><figcaption>Whatsapp Chatbots Gaining Momentum in India (Disclaimer: Pictures shown for illustration)</figcaption></figure><p>In this case study, we share our experience of working with a large Chamber of Commerce in one of the biggest states in India to transform their business with conversational AI. The client approached us with the objective of deploying a Whatsapp chatbot to leverage the capabilities of conversational AI.</p><h4><strong>Obstacles Encountered by the Business</strong></h4><p>The client was facing several challenges in their business, which they hoped to address through the deployment of a conversational AI chatbot. These challenges included:</p><blockquote><em>Difficulty in communicating their business model to potential clients</em></blockquote><blockquote><em>Inability to publicize their industrial events and services</em></blockquote><blockquote><em>Problems in disseminating information from the government</em></blockquote><blockquote><em>Difficulty in gauging economic activity in their state</em></blockquote><blockquote><em>Limited knowledge about government schemes</em></blockquote><blockquote><em>Potential of offering Hall booking</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DtjUlzX07T7iYPq-tn3NDg.jpeg" /><figcaption>Transform your business with the power of Conversational AI — Experience analytics like never before!</figcaption></figure><h4><strong>Our UX Research Approach</strong></h4><p>To address the challenges faced by the client, we began by conducting group and individual level interviews to identify the target persona for this particular brand.<br>In addition to these interviews, we also reviewed chat scripts of support agents and reviewed call center data.<br>Furthermore, we interacted with the logistics and operational teams to understand the pain points of the customers and loopholes in their processes.</p><h4><strong>Identifying the Brand Persona and the Channel of Choice</strong></h4><p>Identifying the channel of choice for the chatbot was critical for us. This was interlinked to identifying the user persona of the customer base.</p><p>Through our research, we identified the target persona to be someone who is <br>a) middle-aged,<br>b) living in a suburban city in India, and<br>c) running MSMEs in sectors such as retail, clothing, spices, and manufacturing.</p><p>We also discovered that the target persona preferred usability over quirkiness and was already facing challenges due to unsupportive government policies and running businesses on overdrafts. Based on these insights, we created a user profile of the target persona.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V1OB-cvHdsc9ewvIXxWP_w.jpeg" /><figcaption>User Persona: “Meet Mr. Sharma — the “Midas Touch” of SMEs and a master of chai breaks!”</figcaption></figure><p>WhatsApp was chosen as the preferred channel for the chatbot due to the ease of access it provides to merchants who are always on the move.</p><p>The popularity of WhatsApp as a communication channel in India was another key factor that influenced our decision to configure the chatbot on this platform.</p><p>We also considered the fact that other channels like websites or Facebook would not provide a good user experience for this particular persona, making WhatsApp the ideal choice for our chatbot implementation.</p><h4><strong>Our Solution</strong></h4><p>To address the challenges faced by the client, we offered the following conversational AI solutions:</p><p><strong>Brand Awareness</strong>: To help prospective clients understand the line of business that the client dealt with, we developed a use case in the chatbot solely focused on exploring the business line.<br><strong>Avail Services</strong>: We shared the contact email of the SPOC for a particular business to help clients easily access any service or advisory they required.<br><strong>Disseminating Government Information</strong>: We structured government information on the chatbot and used APIs to update the information periodically, compensating for the bad UX of government websites in India.<br><strong>Gauging Economic Activity</strong>: We created a WhatsApp survey template for the customers to gauge the economic activity in the state.<br><strong>Hall Booking</strong>: Through the chatbot, we offered the experience of booking halls across the city with offline and online payment options.</p><h4><strong>Team Structure</strong></h4><p>To ensure the success of the chatbot, we offered a multidisciplinary team that included a conversation designer, bot developer, project manager, and quality assurance team.</p><h4><strong>Results</strong></h4><p>Through the deployment of the chatbot, the client was able to reduce 42–60% agent escalation on product queries. Furthermore, there was a substantial increase in hall bookings via the bot, which increased to 35% over a span of 3 months, while agent-assisted hall booking reduced to 50%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EIX9RmJYrF7heDJGfDWMMg.jpeg" /></figure><h4><strong>Conclusion</strong></h4><p>This case study demonstrates how conversational AI can help transform businesses by providing solutions that improve customer engagement and satisfaction. With the right strategy, implementation, and team, businesses can leverage conversational AI for doing good business.</p><p><strong>Don’t miss out on creating engaging and personalized user experiences! Let’s build your conversational AI team or schedule a consultation today.</strong></p><p>Reach out to us at <strong>hello@cawstudios.com</strong> and follow our journey on <strong>LinkedIn</strong>. <a href="https://www.linkedin.com/company/caw-studios">https://www.linkedin.com/company/caw-studios</a></p><p><strong>Read more about chatbots and conversation design from here:</strong></p><ul><li><a href="https://medium.com/caw-cxd-blogs/what-is-conversation-design-an-introduction-to-conversation-design-at-caw-studios-921a4bac89ce">What is Conversation Design? An Introduction to Conversation Design at CAW Studios</a></li><li><a href="https://medium.com/caw-cxd-blogs/how-brands-are-using-chatbots-in-businesses-6-great-examples-3de4e5eabe30">How Brands Are Using Chatbots in Businesses — 6 Great Examples</a></li><li><a href="https://medium.com/caw-cxd-blogs/the-5-best-chatbot-platforms-to-watch-out-for-5e1aa25c8537">The 5 Best Chatbot Platforms to Watch Out For</a></li></ul><p><em>This Blog was written by </em><a href="https://www.linkedin.com/in/allanharold/"><em>Allan Harold Rex</em></a><em> (</em><a href="https://cawstudios.com/"><em>CAW Studios</em></a><em>)</em></p><p><em>CAW Studios is a Product Engineering Company of 100+ geeks based out of Hyderabad. We run engineering for other start-ups.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be3714046968" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vacuum Wars: PostgreSQL’s Quest for Optimization]]></title>
            <link>https://medium.com/caw-engineering-blogs/vacuum-wars-postgresqls-quest-for-optimization-3b8065319186?source=rss-9543bec17908------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b8065319186</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[vacuum]]></category>
            <category><![CDATA[database-administration]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[postgres]]></category>
            <dc:creator><![CDATA[CAW Blogs]]></dc:creator>
            <pubDate>Tue, 28 Mar 2023 07:00:33 GMT</pubDate>
            <atom:updated>2023-03-28T07:11:59.761Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By </em><a href="https://www.linkedin.com/in/prathapchandra/"><em>Prathap Chandra</em></a><em> (</em><a href="https://cawstudios.com/"><em>CAW Studios</em></a><em>)</em></p><p><em>We love PostgreSQL in CAW Studios. Its our go to DB when the product warrants a RDBMS. We have come across many surprises (and some shocks) as we explore the under-the-hood implementation of this awesome DB. We are starting a series where we share our learning with wider community. We hope you enjoy this blog which will be part of a series.</em></p><blockquote>1. <a href="https://medium.com/caw-engineering-blogs/connection-pooling-in-postgresql-9047bd697c32">Connection Pooling In PostgreSQL</a><br><strong>2. Vacuum Wars: PostgreSQL’s Quest for Optimization (You are here)</strong></blockquote><p>Quick question: Let’s say there is a table “<strong>Employees”</strong> in your PostgreSQL database with 4 records in it and as part of a transaction you’re supposed to update 2 of them.</p><p>How many records do you think will actually be present in the “<strong>Employees” </strong>table by the end of the transaction? You’re about to discover something new today if your response is 4.</p><h3>Dead Tuples PostgreSQL</h3><p>When you update a row, PostgreSQL just marks it as a dead tuple (like a soft delete) and <strong>creates a new record for the values to be updated</strong>. So the answer is 6<strong>. </strong>The below GIF is an illustration of the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oPOOTNn_zCGZAzrO.gif" /></figure><p>PostgreSQL creating a new row upon updating a row</p><pre>CREATE TABLE employees (id SERIAL PRIMARY KEY, name TEXT, salary INTEGER);<br>INSERT INTO employees (name, salary) VALUES (&#39;Alice&#39;, 50000), (&#39;Bob&#39;, 60000), (&#39;Matt&#39;, 42000), (&#39;Chris&#39;, 86000);</pre><pre>SELECT xmin, xmax, ctid, * FROM employees;</pre><pre>UPDATE employees SET salary = 65000 WHERE id = 2;<br>UPDATE employees SET name = &#39;Bob&#39; WHERE id = 4;</pre><p>Any table in PostgreSQL contains a few hidden columns. xmin, xmax, and ctid are a few of them.</p><p><strong>Here’s what each of those columns mean:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*ps7QChqSW-IAbwhjxW61QQ.png" /><figcaption>Hidden columns in PostgreSQL</figcaption></figure><p>For example, if a row has a ctid value of (0,5), that means the row is located in block 0 (A block is often referred to as <strong>page</strong>) i.e, the first block in the table and 5th row within that block.</p><p><strong>But why does PostgreSQL behave this way? </strong>That’s because PostgreSQL uses a<strong> multi-version concurrency control</strong> <strong>(MVCC) mechanism</strong>.</p><p>But what’s the point of not deleting those dead tuples?<br>We will be trying to systematically assess how to answer this in this blog.</p><h3>Multi-Version Concurrency Control</h3><p>Multi-Version Concurrency Control (MVCC) is a technique used by PostgreSQL to allow multiple transactions to access the same data simultaneously without interfering with each other. MVCC is implemented using a combination of snapshot isolation and versioning.</p><p>In MVCC, each transaction sees a snapshot of the database at a certain point in time, rather than the current state of the database. This snapshot copies the state of the database at the beginning of the transaction and stores it in memory. As the transaction reads and writes data, it sees only the version of the data that was current at the beginning of the transaction.</p><p>In MySQL, if Transaction A wants to read some data from Table X while Transaction B wants to simultaneously add new data to Table X, as long as the data being read and written are from distinct rows of the table, neither transaction will stop the other.</p><p>However, if the data being read and written are in the same row, then Transaction B will need to wait for Transaction A to release its lock on the row before it can acquire an exclusive lock and modify the row.</p><p>In PostgreSQL, Transaction A can read the data from Table X without blocking Transaction B, even if the data being read and written are in the same row. This is because PostgreSQL’s MVCC mechanism allows multiple transactions to read the same data simultaneously, while still ensuring consistency and preventing conflicts between transactions. Transaction B can acquire an exclusive lock on the row it wants to modify, and other transactions can still read the previous version of the row until Transaction B commits its changes.</p><p>MVCC in PostgreSQL is a powerful mechanism that allows for high concurrency and scalability in a multi-user environment. However, it also has some overheads in terms of storage and processing requirements, as multiple versions of each row must be stored in the database.</p><p><em>By now you must’ve understood why </em><strong><em>SELECT COUNT(*) </em></strong><em>could be a bad idea, especially in PostgreSQL</em>. Instead, you can use the below query if you don’t need an exact number. You can read more about <a href="https://wiki.postgresql.org/wiki/Slow_Counting">Slow Counting</a> and <a href="https://wiki.postgresql.org/wiki/Count_estimate">Count Estimate</a>.</p><pre>SELECT reltuples AS estimate FROM pg_class WHERE relname = &#39;table_name&#39;;</pre><h3><strong><em>When it comes to storage, PostgreSQL is like a teenager’s bedroom — it’s full of bloat and clutter that you have to clean up every once in a while.</em></strong></h3><h3>PostgreSQL Bloat: An Overview of its Types</h3><p>In PostgreSQL, bloat refers to the storage inefficiencies that can occur as tables and indexes grow over time. There are several different types of bloat that can occur in PostgreSQL:</p><ol><li><strong>Dead rows</strong>: <em>As discussed above</em>, when rows are updated or deleted, they are not immediately removed from the table. Instead, they are marked as “dead” and left on the table until the next time that VACUUM is run. This can lead to tables that contain a large number of dead rows, which can consume disk space and slow down queries.</li><li><strong>Index bloat</strong>: As indexes grow, they can become inefficient and consume more disk space than necessary. This can be caused by fragmentation, where index pages become partially filled, or by the presence of duplicate index entries.</li><li><strong>Table bloat</strong>: Tables can become bloated when they contain a large number of dead rows or when the statistics used by the query planner become outdated. This can lead to slower queries and increased disk usage.</li><li><strong>Transaction ID wraparound</strong>: PostgreSQL uses a 32-bit transaction ID to track changes to the database. If the transaction ID counter reaches its maximum value, it will wrap around to zero, which can cause problems if there are still live transactions with IDs greater than the wraparound point. This can lead to data corruption and the need for a manual VACUUM or VACUUM FULL operation.</li><li><strong>Toast table bloat</strong>: Large values stored in TEXT, VARCHAR, and BYTE <strong>columns are stored in a separate table called the “toast” table</strong>. If these values are updated frequently or are very large, the toast table can become bloated and slow down queries.</li></ol><p>To check if a table is making use of the toast table in PostgreSQL, you can use the below query. The pg_class catalog table contains information about all tables in the database, including their attributes, indexes, and storage options.</p><pre>SELECT relname, relkind, reltoastrelid <br>FROM pg_class <br>WHERE relname = &#39;tableName&#39;;</pre><p>If the reltoastrelid column is not null, it means that the table is using the toast table. The relkind column will also show &#39;r&#39; for a regular table or &#39;t&#39; for a toast table.</p><p>Note that a table may use the toast table for some columns but not others. You can check the attstorage column in the pg_attribute catalog table to see which columns are stored in the toast table. A value of &#39;x&#39; in this column indicates that the column is stored in the toast table.</p><p><strong>But what do we do about this bloat data? <br></strong>The answer is Vaccuum.</p><h3>Yes, Vacuum the Saviour</h3><p><strong>Vacuum is used to optimize and improve PostgreSQL performance.</strong> This reclaims storage space and optimizes the performance of the database by removing dead rows, updating statistics, and compacting pages. Vacuum is essential for preventing performance degradation and keeping the database running smoothly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F8LKb38PLUIczaVF9m2skg.png" /><figcaption>Vacuum is used to optimize PostgreSQL</figcaption></figure><p>In short, vacuum takes care of the bloat data in PostgreSQL. <strong><em>Why did we even discuss all of this then?</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*oDPh2V59KG8s949b.gif" /></figure><p>While vacuuming is an important maintenance task in PostgreSQL, there are some potential downsides and trade-offs to consider.</p><p>Here are some of the downsides of vacuuming in PostgreSQL:</p><ol><li><strong>Resource usage</strong>: Vacuuming can be a resource-intensive operation, especially for large tables with many dead rows. The process can consume significant CPU, memory, and I/O resources, which may impact the performance of other processes running on the same system.</li><li><strong>Locking</strong>: Vacuuming requires an exclusive lock on the table being vacuumed, which means that no other processes can read from or write to the table while the vacuum is running. This can cause contention and delays if the table is frequently accessed by multiple processes.</li><li><strong>Index maintenance</strong>: As wementioned earlier, vacuuming can have an impact on indexes, as it involves scanning the indexes to find obsolete entries and removing them. This can be an expensive operation, especially for large tables with many indexes, and can increase the time required to complete the vacuum.</li><li><strong>Slowdowns during peak usage</strong>: If you vacuum a large table during peak usage hours, it can impact the performance of the application or service using the table. In this case, it is recommended to schedule vacuuming during off-peak hours to minimize any potential impact on users.</li><li><strong>Increased storage requirements</strong>: When you vacuum a table, PostgreSQL creates a new version of the table file without the dead rows. This new file may be larger than the original file, as it may contain empty space that has not yet been reclaimed. This can result in increased storage requirements for the table, which may be a concern for systems with limited disk space.</li></ol><p>PostgreSQL uses a lock called the <strong>AccessExclusiveLock</strong> on the table being vacuumed. This lock prevents other sessions from performing any operations on the table, including read and write operations, until the vacuum operation is complete.</p><p>The AccessExclusiveLock is a heavyweight lock that prevents any other session from acquiring any lock on the same table, including shared locks, until the lock is released. This is necessary to ensure that the vacuum operation has exclusive access to the table and can perform all necessary maintenance tasks without interference from other sessions.</p><p>It is important to note that the AccessExclusiveLock is a very strong lock and can cause contention in a heavily used database. Therefore, it is recommended to schedule vacuum operations during low-usage periods or to use alternative methods for performing maintenance on large tables, such as table partitioning or table archiving.</p><p>It is important to balance the benefits of vacuuming against the downsides and to carefully plan and schedule vacuuming operations to minimize any potential impact on the system.</p><p>Usually, If a company’s operations are fewer updates and thousands and millions of inserts in a day, then turning off the auto-vacuum is the first thing you should do rather than letting auto-vacuum kick in in the middle of bulk operations and lock everything down. Instead, <strong>have a cron job that does </strong><strong>VACUUM ANALYZE just like </strong><a href="https://zerodha.com/"><strong>Zerodha</strong></a><strong>, the largest stock broker in India does</strong>. For more information on this read this <a href="https://zerodha.tech/blog/working-with-postgresql/">article</a> by their tech team.</p><p>On an ending note, while there are many things to discuss and understand about MVCC, Bloat Data, and Vacuum in PostgreSQL, we’ve avoided to cram in too many things into one blog to make it clear and easy to follow.</p><blockquote>This Blog was written by <a href="https://www.linkedin.com/in/prathapchandra/">Prathap Chandra</a> (<a href="https://cawstudios.com/">CAW Studios</a>)</blockquote><blockquote>CAW Studios is a Product Engineering Company of 100+ geeks based out of Hyderabad. We run engineering for other start-ups.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b8065319186" width="1" height="1" alt=""><hr><p><a href="https://medium.com/caw-engineering-blogs/vacuum-wars-postgresqls-quest-for-optimization-3b8065319186">Vacuum Wars: PostgreSQL’s Quest for Optimization</a> was originally published in <a href="https://medium.com/caw-engineering-blogs">CAW Engineering Blogs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connection Pooling in PostgreSQL]]></title>
            <link>https://medium.com/caw-engineering-blogs/connection-pooling-in-postgresql-9047bd697c32?source=rss-9543bec17908------2</link>
            <guid isPermaLink="false">https://medium.com/p/9047bd697c32</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[database-development]]></category>
            <category><![CDATA[database-administration]]></category>
            <category><![CDATA[connection-pooling]]></category>
            <dc:creator><![CDATA[CAW Blogs]]></dc:creator>
            <pubDate>Wed, 22 Feb 2023 13:36:16 GMT</pubDate>
            <atom:updated>2023-03-23T09:22:50.205Z</atom:updated>
            <content:encoded><![CDATA[<h3><em>Why do we re</em>commend <em>to do connection pooling with PostgreSQL DB</em></h3><p><em>By </em><a href="https://www.linkedin.com/in/prathapchandra/"><em>Prathap Chandra</em></a><em> (</em><a href="https://cawstudios.com/"><em>CAW Studios</em></a><em>)</em></p><p><em>We love PostgreSQL in CAW Studios. Its our go to DB when the product warrants a RDBMS. We have come across many surprises (and some shocks) as we explore the under-the-hood implementation of this awesome DB over the years. We are starting a series where we share our learning with wider community. We hope you enjoy this blog which will be part of a series.</em></p><blockquote>1. Connection Pooling In PostgreSQL (You are here)<br>2. Vacuum Wars: PostgreSQL’s Quest for Optimization</blockquote><p>You might have seen many articles on how and why to use connection pooling in databases. This article, unlike the others, focuses mostly on why it should be sort of mandatory when it comes to PostgreSQL<strong>.</strong> To understand that, we need to understand a few things about PostgreSQL.</p><h3>Process per connection</h3><p>Unlike MySQL or Oracle which uses a thread-based architecture, where each connection is assigned a thread from a thread pool whenever a new connection is established, PostgreSQL creates one <strong>PROCESS PER CONNECTION. </strong>The reasons being :</p><ol><li><strong>Isolation</strong>: Each connection to a PostgreSQL database is isolated from other connections, meaning that one connection’s operations won’t interfere with another. By using a separate process for each connection, PostgreSQL ensures that each connection has its own memory space and can’t accidentally access another connection’s data.</li><li><strong>Security</strong>: Each connection to a PostgreSQL database requires authentication, and by using a separate process for each connection, PostgreSQL can ensure that each connection is properly authenticated and authorized to access the database.</li><li><strong>Scalability</strong>: By using a process for each connection, PostgreSQL can handle many simultaneous connections without overwhelming the system. Each process can manage its own resources, and if one process crashes or becomes unresponsive, it won’t affect the other processes or connections.</li><li><strong>Flexibility</strong>: PostgreSQL supports a variety of different connection types, including TCP/IP, Unix domain sockets, and shared memory. By using a separate process for each connection, PostgreSQL can support these different connection types without having to write specialized code for each one.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*Zuc1KVryciyAQ6pX.png" /><figcaption>PostgreSQL Architecture</figcaption></figure><p>PostgreSQL uses the fork() system call to create a new process for each new client connection. The parent process creates a copy of itself (the child process) and then the child process initializes a new connection to the client. Forking a process can be an expensive operation in terms of system resources because it involves creating a new process and duplicating the parent process’s memory space, file descriptors, and other system resources.</p><p>PostgreSQL is designed to manage system resources efficiently, and it uses various techniques to reduce the overhead of forking new processes. For example, it uses a technique called <strong><em>“copy-on-write”</em></strong> to avoid duplicating memory pages unless they are modified, which can significantly reduce the amount of memory required to start a new process.</p><p>In addition, PostgreSQL provides various configuration parameters that can be used to control the number of processes and other resources used by the system. For example, you can set the maximum number of client connections allowed, adjust the size of the process pool, or set limits on the amount of memory used by each process.</p><p>By default, there is a limit on the no of connections PostgreSQL can handle, which is 100. This means if there are 100 open requests, you will encounter the below error for the subsequent requests</p><pre>psql: FATAL: remaining connection slots are reserved for non-replication superuser connections</pre><p>As Linus Torvalds says, “ <strong>Talk is cheap</strong>. <strong>Show me the code</strong>.”, I’ve added a code snippet below to simulate the same.</p><pre>const { Pool } = require(&#39;pg&#39;);<br><br>// Set up a database connection pool<br>const pool = new Pool({<br>    user: &#39;postgres&#39;,<br>    host: &#39;localhost&#39;,<br>    database: &#39;testdb&#39;,<br>    password: &#39;mypassword&#39;,<br>    port: 5432,<br>    max: 100,  // max_connections setting<br>});<br><br>// Define a function to execute a simple query<br>async function runQuery(clientId) {<br>    const client = await pool.connect();<br>    try {<br>        const res = await client.query(`SELECT ${clientId}`);<br>        console.log(`Client ${clientId} result: ${res.rows[0][clientId]}`);<br>    } finally {<br>        client.release();<br>    }<br>}<br><br>// Spawn multiple promises to simulate multiple clients<br>const numClients = 101;  // One more than the max_connections setting<br>const promises = [];<br>for (let i = 0; i &lt; numClients; i++) {<br>    promises.push(runQuery(i));<br>}<br>Promise.all(promises);</pre><p>When you run this code, it should simulate the scenario where multiple clients are trying to connect to a PostgreSQL database with limited resources. Depending on the actual system resources available, some promises might have to wait for an available connection slot before they can execute their query. The output of the code will show the results of each client’s query, along with the client ID, to demonstrate that the queries are being executed concurrently.</p><p>If you need to support more concurrent connections than the default value of <em>max_connections</em>, you can increase the value of this parameter in the <em>postgresql.conf</em> configuration file or at runtime using the ALTER SYSTEM command or the SET command. However, you should be careful not to set the value too high, as this can lead to resource contention and degrade the performance of the server.</p><p>Overall, while forking a process can be an expensive operation in general, PostgreSQL is designed to manage the overhead of forking new processes efficiently and effectively against the benefits of isolation, security, scalability, and flexibility.</p><blockquote>If you know what connection pooling is you can skip the rest of the article as you might have understood why it is important to use connection pooling in PostgreSQL by now.</blockquote><h3>Connection Pooling</h3><p>When a client makes a database call, an API call, or any other type of network request, it typically establishes a TCP connection to the server and uses this connection to exchange data. This connection remains open for the duration of the request and may be reused for subsequent requests to the same server.</p><p>The below image looks familiar, right? Yes, it’s a TCP 3-way handshake protocol and every new request has to go through this. But, why is this relevant now?</p><p><strong>Connection Pooling </strong>in simple terms is making use of some open TCP connection rather than initiating a new one. <strong>This means you’re skipping most of the layer 4 authentication, which makes your request response rate extremely faster if implemented properly.</strong></p><figure><img alt="TCP 3-way handshake" src="https://cdn-images-1.medium.com/max/875/0*Vs7NOQlEegDnTZr6.png" /><figcaption>TCP 3-way handshake</figcaption></figure><p>For stateless queries, you don’t have to worry about which connection is being used. But when working with transactions, you can request a dedicated client from the pool. We should also make sure we release it back to the pool so that other requests can use the same connection before the connection eventually times out.</p><p>As we’ve discussed earlier, be it a DB call or an API call, or any other network request for that matter, it typically establishes a TCP connection. So the same can be done for API calls as well (HTTP connection pooling or persistent connections). We just need to make sure we handle it properly.</p><blockquote>This Blog was written by <a href="https://www.linkedin.com/in/prathapchandra/">Prathap Chandra</a> (<a href="https://cawstudios.com/">CAW Studios</a>)</blockquote><blockquote>CAW Studios is a Product Engineering Company of 100+ geeks based out of Hyderabad. We run engineering for other start-ups.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9047bd697c32" width="1" height="1" alt=""><hr><p><a href="https://medium.com/caw-engineering-blogs/connection-pooling-in-postgresql-9047bd697c32">Connection Pooling in PostgreSQL</a> was originally published in <a href="https://medium.com/caw-engineering-blogs">CAW Engineering Blogs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Brands Are Using Chatbots in Businesses — 6 Great Examples]]></title>
            <link>https://medium.com/@CAWBlogs/how-brands-are-using-chatbots-in-businesses-6-great-examples-3de4e5eabe30?source=rss-9543bec17908------2</link>
            <guid isPermaLink="false">https://medium.com/p/3de4e5eabe30</guid>
            <category><![CDATA[conversation-design]]></category>
            <category><![CDATA[chatbot-design]]></category>
            <category><![CDATA[chatbots-for-business]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[chatbot-development]]></category>
            <dc:creator><![CDATA[CAW Blogs]]></dc:creator>
            <pubDate>Mon, 20 Feb 2023 15:08:43 GMT</pubDate>
            <atom:updated>2023-02-20T15:08:43.651Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>How Brands Are Using Chatbots in Businesses — 6 Great Examples</strong></h3><p><em>By Siddharth Bhatacharjee (</em><a href="https://cawstudios.com/"><em>CAW Studios</em></a><em>)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*clbuFF0AzdwvGEBfFOMWvw.png" /></figure><p>All industries are seeing an increase in the use of chatbots, but e-commerce is one where this rise truly stands out.</p><p>Chatbot capabilities are being adopted by more and more e-commerce and retail companies. Insider Intelligence estimates retail customers will spend over $142 billion using e-commerce chatbots by 2024! That’s worth an entire industry in itself and then some.</p><p>That astounding share of the market suggests that chatbots will quickly take over the e-commerce industry, to say the least.</p><h3><strong>Effectiveness of Chatbots</strong></h3><p>Since their inception, chatbots have advanced significantly. They are becoming better at understanding clients and providing the right responses as a result of significant breakthroughs in machine learning and natural language processing.</p><p>Some brands already appear to be striking the correct balance. A bot must rapidly grab the user’s attention and exhibit a healthy curiosity about their new acquaintance, but excessive curiosities can easily tip them over the edge into, some might say, a creepy territory and alienate users.</p><p>While we’re still in the early stages, the most recent statistics about usage and the number of available bots all point to one thing: you can purchase food, book flights, and get suggestions for just about anything you can think of. Adoption rates are rising through the roof!</p><p>Today, conversing with an e-commerce chatbot is akin to conversing with a person because they are extremely efficient, can tell jokes, and have personalities.</p><p>Chatbots are consequently becoming more and more prominent in the field of online customer support. As mentioned earlier, they can be utilized to accomplish a variety of objectives for retail and e-commerce firms.</p><p><strong>Here are some examples of how brands are using chatbots to boost their marketing efforts:</strong></p><h3><strong>1.</strong> <strong>Spotify</strong></h3><p>Spotify has a number of bots that they developed for a variety of purposes. Spotify’s Facebook Messenger bot, for instance, streamlines the process of finding, listening to, and sharing music for its users. As soon as you begin, you will receive playlist suggestions based on your mood, what you are doing, or any type of music you choose.</p><p>Some of the better-known Spotify bots are UseViral, Media Mister, and AIO Stream.</p><p>You may increase your Spotify plays by using the UseViral Spotify bot. According to UseViral, they specialize in expanding social media sites and assisting brands and influencers to boost the quantity of interactions on their social media networks.</p><p>Media Mister can help users spread their wings on all of the various social networks available. This indicates that you have options other than Spotify for launching your music career, including SoundCloud and YouTube.</p><h3><strong>2.</strong> <strong>Domino’s</strong></h3><p>Domino’s developed Dom, a pizza ordering bot that allowed users to place orders directly through Facebook Messenger, in an effort to better leverage chatbot technology.</p><p>The benefit of the bot is that it enables both one-time and recurring consumers to place orders without needing to register or build a profile, and without ever having to leave the comfort of their preferred app.</p><p>Despite not being Domino’s first attempt at an ordering bot, Dom was the first to allow consumers to order from the whole restaurant menu without requiring an account — a major step forward in enhancing customer experience.</p><h3><strong>3.</strong> <strong>HDFC</strong></h3><p>We can all agree that it takes a lot of effort to navigate a banking website with all of its options, especially if it’s your first time around. It appears to be an enormous undertaking that will consume a lot of mental energy to obtain even the most basic information from the website.</p><p>With the launch of EVA (Electronic Virtual Assistant), India’s first and largest AI-powered banking chatbot, HDFC has liberated clients from this aimless browsing, repeated clicks, and hours of waiting on hold to speak with an agent.</p><p>Customers can contact EVA at any time for information regarding their accounts, cards, or any other service they have signed up for or are curious about. It offers help with paying bills, filing complaints, and much more. It can be found on Amazon Echo and Google Assistant gadgets as well.</p><h3><strong>4.</strong> <strong>Dr. Lal Path Labs</strong></h3><p>Since the pandemic, health has taken the front seat in all our lives. And nowadays, an increasing number of people prefer to receive their medical care virtually rather than in person.</p><p>As such customers can get assistance from the Dr. Lal Path Labs intelligent chatbot with COVID-related information, finding the closest center, tracking reports, etc. It also provides instructions on the different tests and their costs. An easy way for customers to get the information they require before visiting any outlet or having to wait long hours to get some basic details.</p><h3><strong>5.</strong> <strong>eBay</strong></h3><p>Another illustration of a virtual shopping assistant is eBay’s shopbot. The bot has been designed to make buying easier, as there are billions of listings placed on the site every day.</p><p>Users can begin by typing a term or phrase that describes what they are looking for. After that, the bot looks for similar listings, reducing the number of items the user must sort through, thereby simplifying their searches.</p><p>Results can also be found using photographs. The chatbot can be used to upload a photo and identify listings that are comparable. For instance, submitting a picture of a pair of black high heels will result in listings for — you guessed it — black high heels. A simplified version of eBay is provided by the chatbot to users on Facebook Messenger as well.</p><p>It’s a good illustration of how to use a bot to identify products that fit customers’ requirements. An e-commerce chatbot is a great tool for assisting clients in sorting through your product catalog if you sell a lot of different items.</p><h3><strong>6.</strong> <strong>Sephora</strong></h3><p>Cosmetics retailer Sephora has set the bar for beauty shops everywhere by becoming one of the first companies to launch bots on Kik and Facebook Messenger.</p><p>Since then, it has fully utilized the development of chatbot technology by creating two cutting-edge e-commerce chatbots: <strong>Sephora Reservation Assistant</strong> and <strong>Sephora Virtual Artist</strong>.</p><p>Users can utilize the bot to schedule a makeover appointment at a nearby Sephora location. The bot can find the closest Sephora site based on either information as it was designed to recognize postcodes and cities.</p><p>After making a reservation, the user receives a confirmation email in their inbox. The bot has an 11% greater conversion rate than the other channels Sephora employs for in-store reservations, making the entire booking process quick and simple.</p><h4><strong>Conclusion</strong></h4><p>Chatbots provide the ideal solution: an amiable bot partner to gain data from and/or practice conversing with at any time of day without worrying about looking foolish.</p><p>The use of chatbots is expanding across all industries and has a wide range of applications in many different fields. One of their key benefits is that they significantly improve customer experiences, which helps to build brand recognition, foster customer loyalty, and increase conversions rather rapidly.</p><p>However, for a bot to be successful, it must be able to improve customer satisfaction and service and have the capacity to learn from each interaction in order to tailor the user experience.</p><p>Now is the perfect time to look at how chatbots may be used in businesses to save time and money as their use grows and your time to cash in on it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3de4e5eabe30" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 5 Best Chatbot Platforms to Watch Out For]]></title>
            <link>https://medium.com/@CAWBlogs/the-5-best-chatbot-platforms-to-watch-out-for-5e1aa25c8537?source=rss-9543bec17908------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e1aa25c8537</guid>
            <category><![CDATA[chatbots-for-business]]></category>
            <category><![CDATA[chatbot-development]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[conversation-design]]></category>
            <category><![CDATA[chatbot-design]]></category>
            <dc:creator><![CDATA[CAW Blogs]]></dc:creator>
            <pubDate>Thu, 16 Feb 2023 14:54:16 GMT</pubDate>
            <atom:updated>2023-02-16T14:54:16.312Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Siddharth Bhatacharjee (</em><a href="https://cawstudios.com/"><em>CAW Studios</em></a><em>)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rFA1CX1fYZB1AO-RkKJnjw.png" /></figure><p>As the world around us continues to evolve, so does the technology with it. One such piece of tech that has flabbergasted all domains as we know it, is the innovation in the space of Conversational AI.</p><p>Artificial Intelligence is a highly revered tool in the business world today and implementation of the same via chatbots has helped many businesses kick things up a notch or two.</p><p>Because chatbots can speak with customers and provide common answers, artificial intelligence chatbots are often adopted by businesses trying to boost sales or service productivity. In businesses, customer is king, and designing &amp; reinventing chatbots that can understand the customers better and help resolve their queries is what is making all the difference in the world.</p><p>Many experts anticipate that chat-based communication methods will become more popular as customers turn away from conventional modes of communication with the passage of time. Businesses are increasingly using chatbot-based virtual assistants to complete straightforward tasks, freeing up human agents to concentrate on other, more crucial duties that really need a human touch.</p><p>For those that are still under even a tad bit of apprehension as to what a chatbot really is, this next section is for you.</p><h3><strong>What is a chatbot and what does it do?</strong></h3><p>A chatbot is nothing more than a piece of software or a computer program that mimics human conversation through voice or text exchanges and is regarded as a sort of virtual assistant. It is a bot designed to handle chats, hence “chatbot”.</p><p>More and more users are using chatbot virtual assistants to complete simple tasks in business-to-business (B2B) and business-to-consumer (B2C) environments. Chatbot assistants allow businesses to provide customer care when live agents aren’t accessible and/or cut down on overhead costs and make better use of support staff time.</p><h3><strong>The Best Chatbot Platforms</strong></h3><p>With that out of the way, now let’s take a look at some of the best chatbot platforms in 2022 that you definitely need to keep an eye out for.</p><h4><strong>1.</strong> <strong>Chatfuel</strong></h4><p>A great, simple-to-use software that is being used for creating Facebook-specific bots without coding is Chatfuel. As you can imagine, this platform quickly became a crowd favorite. Chatfuel has a variety of editing tools so you may create the chatbots you want in any specific design. It also lets you create conversational rules on the dashboard.</p><p>A bot created by Chatfuel will use natural language processing (NLP) to recognize and comprehend phrases and send consumers prepared answers. A chatbot can be created to act as a personal avatar, event assistant, or customer service representative. The ability to add users who interact with the chatbot to your database so you may contact them later is a useful feature. The analytics technology of Chatfuel provides information on the effectiveness of the bot thereby enhancing the aforementioned capabilities of the chatbot.</p><h4><strong>2.</strong> <strong>Aivo</strong></h4><p>One of the top Conversation AI systems — Aivo helps you develop multilingual bots for your business needs. Additionally, it also enables you to customize the bots exactly how you want them to be.</p><p>Aivo comes with a number of intuitive dashboards that help with data interpretation whilst allowing you to visualize information so you can derive better insights from your data. You can use it to study consumer feedback and enhance the chatbot’s future responses which is an essential requirement for business needs.</p><p>This platform provides a seamless user experience across numerous channels. Via a single platform, you can respond to inquiries from web chats, mobile apps, WhatsApp, and Facebook Messenger. Additionally, your AI bot will automatically adapt responses across all channels to provide prompt and seamless support.</p><h4><strong>3.</strong> <strong>Infobip</strong></h4><p>By delivering a new level of automation, speed, and availability, Infobip’s intelligent chatbot building platform enables you to develop and deploy a smart virtual assistant that supports your customer service and sales performance.</p><p>With an AI chatbot like Infobip that can recognize intent on customers’ preferred channels like WhatsApp, Facebook Messenger, Apple Messages for Business, Viber, Instagram Messages, Twitter Direct Messages, Telegram, LINE, Live Chat, SMS, RCS, and Google’s Business Messages, you can significantly lower customer support costs and raise customer satisfaction. Its heightened level of accessibility and ease of use makes it one of the best AI chatbot platforms of the year.</p><h4><strong>4.</strong> <strong>Imperson</strong></h4><p>Imperson has been recognized as one of the top providers of business AI chatbots and rightfully so. It supports text, audio, video, augmented reality, and virtual reality on all popular messaging platforms. Imperson hosts and deploys your bot with its full-service creative studio, which also offers a comprehensive analytics dashboard with real-time performance statistics. They regularly adjust your chatbot’s performance based on user behavior and help monitor its progress as well.</p><p>In order to guide conversations, the Conversation Navigator makes use of connection memory, NLP user intents, and deep dialogue context. Additionally, an AI moderator aids in consumers’ goal-achieving.</p><p>Imperson claims that in order to establish relationships with customers, it builds its bots to speak in natural language that is customized to each brand’s authentic voice which is an imperative characteristic to have for a chatbot to make a dent in the AI and business world.</p><h4><strong>5.</strong> <strong>Drift</strong></h4><p>Last, but certainly not least, we have Drift — one of the most intuitive AI chatbots ever to be designed for carrying out conversations from a marketing standpoint. What makes it stand out is its drag-and-drop bot builder which makes designing bots super easy and swift.</p><p>Drift provides a video communication tool, live chat, chatbots, and an email marketing solution as well. Multiple inboxes can be created, internal notes can be added to conversations, and pre-written answers to frequently asked queries are readily available to make for seamless communication.</p><p>By installing a bot, posing inquiries, and automatically sending the lead to the sales team for follow-up procedures, this no-code chatbot platform aids in developing qualified leads for your business. As you can tell, this qualifies Drift to make it onto our list of the best AI chatbot platforms of 2022.</p><h3><strong>Conclusion</strong></h3><p>This sums up our list of the fastest-moving AI chatbots that are certain to make a difference in the world of business and AI.</p><p>Wish to learn more about the most happening developments in Conversational AI? Want us to cover more such topics? Leave your suggestions in the comments below and we’ll be sure to take them up in our next article.</p><blockquote>This Blog was written by Siddharth Bhatacharjee (<a href="https://cawstudios.com/">CAW Studios</a>)</blockquote><blockquote>CAW Studios is a Product Engineering Company of 100+ geeks based out of Hyderabad. We run engineering for other start-ups.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e1aa25c8537" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Conversation Design? An Introduction to Conversation Design at CAW Studios]]></title>
            <link>https://medium.com/@CAWBlogs/what-is-conversation-design-an-introduction-to-conversation-design-at-caw-studios-921a4bac89ce?source=rss-9543bec17908------2</link>
            <guid isPermaLink="false">https://medium.com/p/921a4bac89ce</guid>
            <category><![CDATA[conversational-ai]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[chatbot-development]]></category>
            <category><![CDATA[conversation-design]]></category>
            <category><![CDATA[chatbot-design]]></category>
            <dc:creator><![CDATA[CAW Blogs]]></dc:creator>
            <pubDate>Wed, 15 Feb 2023 16:08:33 GMT</pubDate>
            <atom:updated>2023-02-16T15:05:33.596Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Siddharth Bhatacharjee, Allan Harold (</em><a href="https://cawstudios.com/"><em>CAW Studios</em></a><em>)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B6dLgp_HDz61JVIZEJZJaw.png" /></figure><h3><strong>What is Conversation Design?</strong></h3><p>Conversation Design (CxD) is the process of creating effective, engaging, and natural conversations between humans and digital systems, such as chatbots, voice assistants, and other conversational interfaces. It involves designing the interaction flow, the language and tone of the conversation, and the responses of the system to the user’s input.</p><p>Conversation Designers (CDs) use a variety of tools and techniques to create effective conversations, including user research, prototyping, user testing, and data analysis. They also draw from fields such as linguistics, psychology, and human-computer interaction to ensure that the conversation feels natural and intuitive to the user.</p><p>The goal of conversation design is to create a user-friendly and seamless conversation that meets the user’s needs and expectations. This requires a deep understanding of the user’s needs, the context of the conversation, and the capabilities of the digital system.</p><h3><strong>Why Conversation Design?</strong></h3><p>That being said, Conversation Design isn’t as simple as adding voice input and text-to-speech (TTS) output to an existing working graphical user interface (GUI). That isn’t good design since it will most certainly throw an array of jargonized bugs and will end up being the farthest thing from conversational.</p><p>Conversation design is fundamentally concerned with the flow of the conversation and its underlying logic. As a result, when designing a conversational interface, one must start from the bottom up.</p><p>The rationale that works for a graphical interface will nearly never work for a conversational interface as is. As such, the conversation should not be an afterthought; rather, it should serve as a road map for what is feasible in terms of design and how designers can get there.</p><h3><strong>Inception of Conversation Design</strong></h3><p>As intriguing as the future of CxD looks, we must know where Conversation Design has come from, in order to leverage its powers for further development.</p><p>The history of conversation design is closely tied to the evolution of conversational interfaces, such as chatbots, voice assistants, and virtual assistants. The earliest examples of conversational interfaces can be traced back to the 1960s and 1970s when computer scientists began experimenting with natural language processing (NLP) and developing rudimentary chatbots.</p><p>However, it wasn’t until the rise of the internet and the widespread adoption of mobile devices that conversational interfaces began to gain wider acceptance. In the early 2000s, instant messaging platforms and text-based chatbots became popular among users.</p><p>The launch of Apple’s Siri in 2011 and Amazon’s Alexa in 2014 marked a major turning point in the history of conversation design. As conversational interfaces have become more sophisticated and widely used, many organizations use chatbots and voice assistants to handle customer support, provide information, and streamline business processes.</p><h3><strong>Conversation Design at CAW</strong></h3><p>Modern organizations require teams that can constantly innovate, adapt and evolve. The only way for firms to thrive is to remain continual innovators.</p><p>CAW Studios is the engineering team driving innovative startups. We are a group of 100 geeks based in Hyderabad working to solve issues, design things, and then develop them on the cloud. To help our clients get a quality product to market faster, we invest substantially in automation, project management, and DevOps.</p><p>At CAW we do NOT shy away from trying new things and experimenting with the status quo. As a group of chimps that like to go out into the wild jungle of tech seeking newer tools and methodologies to tackle the constantly growing wave of information requirements, we were not afraid of venturing into the Conversation Design domain, and here’s what we’ve accomplished so far.</p><p>We collaborated with <a href="https://www.haptik.ai/">Haptik</a> to create bots for a number of well-known household names that are industry leaders.; Fortis, Adani Electricity, Godrej, Haptik, Tata 1mg Labs, IndiaShoppe, and Coin DCX, to name a few.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/0*KyZyOEyuGueHonVe" /></figure><h3><strong>Our Conversation Design Philosophy</strong></h3><p><em>To deliver exceptional customer experiences by curating data-driven solutions that resolve business challenges.</em></p><p>The Conversation design team at CAW Studios is dedicated to creating amazing interactions that result in a positive customer experience and intuitive products.</p><p>Our strong belief in driving-purposeful dialogues enables us to create Al-powered products that have received industry recognition.</p><h3><strong>Our Offerings and Solutions</strong></h3><p>At CAW Studios we have worked to design the perfect environment to nurture and grow your business with Conversation Design.</p><p>We cater to Small Business Startups, Scalable Startups, Early Stage Startups, and Bootstrapped startups for Conversational Design &amp; Development, and also provide a more elaborate and enterprise-level support to Midstage Startups and Large Scale Enterprises.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/0*Wnl3mTI_-DzP0e4g" /></figure><p>In doing so, we have developed the following offerings:</p><p><strong><em>Conversational Al strategy</em></strong></p><ul><li>Content and Structure</li><li>Journey Mapping</li><li>Bot Persona Development</li><li>User Persona Identification</li></ul><p><strong><em>Deploy and Develop</em></strong></p><ul><li>NLP Matrix</li><li>Intent Identification and Design</li><li>Low-code drag-and-deploy Solutions</li><li>Advanced Integrations</li><li>Post-launch Bot Tuning</li><li>Natural Language Processing Strategy</li></ul><p><strong><em>Consultation/ Workshops — Conversational Al</em></strong></p><ul><li>On-site / Virtual Workshops and Training</li><li>Al Trainer Training</li></ul><h3><strong>Is your company ready to take its conversational AI experience to the next level?</strong></h3><p>Companies need to keep two aspects in check while dealing with conversational AI experiences starting 2023.<br> a)<strong>The rise of omnichannel platforms:</strong> Companies must evaluate if they want to opt in for an omnichannel experience and invest in them.<br> b) <strong>Emergence of Immersive experiences:</strong> Augmented reality, virtual reality and computer vision etc. are taking precedence in driving experiences that are immersive as well as conversational.</p><p>Companies now need to understand that launching a virtual assistant is a journey rather than a destination. Curating attractive conversations based on research and continual improvement is also crucial in order to make virtual assistants intuitive, more rational, and more fascinating.</p><blockquote>This Blog was written by Siddharth Bhatacharjee, Allan Harold (<a href="https://cawstudios.com/">CAW Studios</a>)</blockquote><blockquote>CAW Studios is a Product Engineering Company of 100+ geeks based out of Hyderabad. We run engineering for other start-ups.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=921a4bac89ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hosting a Static Website using AWS CloudFront and S3 Bucket]]></title>
            <link>https://medium.com/caw-engineering-blogs/hosting-a-static-website-using-aws-cloudfront-and-s3-bucket-7ad45b1d744a?source=rss-9543bec17908------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ad45b1d744a</guid>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[hosting]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloudfront]]></category>
            <dc:creator><![CDATA[CAW Blogs]]></dc:creator>
            <pubDate>Tue, 14 Feb 2023 14:04:13 GMT</pubDate>
            <atom:updated>2023-02-16T14:59:30.200Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By </em><a href="https://www.linkedin.com/in/aayush-bajaj-505/"><em>Aayush Bajaj</em></a><em> (</em><a href="https://cawstudios.com/"><em>CAW Studios</em></a><em>)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LEJAvwhyOrxDbY9k5YB_og.jpeg" /></figure><h3>Introduction</h3><p>With growing options these days, there are infinite ways to host a site. You could use a basic hosting provider like GitHub Pages or Netlify. This is good enough for smaller sites, as this requires minimal setup, and the site can be live in mere minutes.</p><p>But what if the size is much larger and you don’t want to compromise on load times? In that case, using Amazon Web Services (AWS) CloudFront and S3 Bucket is an efficient way to ensure that your website is always available to users with low latency and high performance.</p><h3>Overview</h3><p>We will explore how to set up hosting for a static website using AWS CloudFront and S3 Bucket, along with it using CloudTrail to log all changes. Additionally, we will look at the process of provisioning the infrastructure for Static hosting using IaaC tools like Terraform in GitOps, with some shift-left practices in CI pipelines.</p><p>Let’s start by getting to know the tools we’ll be using.</p><h3>Cloud Front</h3><p>CloudFront is a service by Amazon that speeds up static and dynamic web content distribution. It includes HTML, CSS, JS, images, and other media content.</p><p>CloudFront delivers content through a worldwide network of data centers called <strong><em>Edge Locations</em></strong>. This helps reduce <strong><em>Latency,</em></strong> which is the time delay between the user’s request for content and the delivery of that content from the server.</p><h3>Route 53</h3><p>Amazon Route 5 is a highly available and scalable Domain Name System (DNS) web service. You can use Route 53 to perform three main functions in any combination: domain registration, DNS routing, and health checking.</p><h3>Certificate Manager</h3><p>AWS Certificate Manager (ACM) is a service that lets you easily provision, manage, and deploy public and private Secure Sockets Layer/Transport Layer Security (SSL/TLS) certificates for use with AWS services and your internal connected resources.</p><h3>Cloud Trail</h3><p>CloudTrail enables auditing, security monitoring, and operational troubleshooting by tracking user activity and API usage. CloudTrail logs, continuously monitors, and retains account activity related to actions across your AWS infrastructure, giving you control over storage, analysis, and remediation actions.</p><h3>WAF</h3><p>AWS WAF is a web application firewall that lets you monitor the HTTP(S) requests that are forwarded to your protected web application resources</p><h3>S3</h3><p>Amazon Simple Storage Service (Amazon S3) is an object storage service that offers data scalability, availability, security, and performance. Customers of all sizes and industries can use Amazon S3 to store and protect any amount of data for various use cases, such as data lakes, websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics.</p><h3>TerraForm</h3><p>Terraform is an open-source infrastructure-as-code software tool created by HashiCorp. Users define and provide data center infrastructure using a declarative configuration language known as HashiCorp Configuration Language, or optionally JSON.</p><h3><strong>GitHub Actions</strong></h3><p>GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline. You can create workflows that build and test every pull request to your repository, or deploy merged pull requests to production.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LclhZoBLFSfK2mSfTFzyXg.png" /></figure><p>The above diagram represents the two pipelines being run to host a static website we are focussing on the infrastructure deployment here. But the deployment.yaml file comes into play after our infra is provisioned; it is used to push the code into the bucket so that the website can be hosted .</p><p>Note: Here the builder in deployment.yml refers to any builder for the technology you are working on for example: hugo, npm etc.</p><h3>Block Diagram</h3><p>The below diagram explains the high level AWS Architecture diagram including all the AWS services that will be used to host a static website. This diagram depicts the AWS services that will be used to host the static content and the static content is pushed to S3 bucket using CodePipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GUokvkbkn5_7BPlU1MqdDg.png" /><figcaption>Flow of actions with Github, Amazon S3, and CloudFront</figcaption></figure><h3>A high-level overview of Infra Provisioning via Terraform</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NAteoo3ShMSBJcZx1ogbfg.png" /></figure><p>The above diagram represents an end to end CI pipeline to provision the required AWS infrastructure required for hosting a static website using CloudFront and S3 bucket. The diagram shows the Git Pull Request approach which triggers a GitHub actions job to clone the Terraform code and execute the TF plan after passing the TFsec gating in the CI pipeline. The TFsec gating is added to ensure it meets an organization security standard with regards to static code analysis.</p><p>The Github Actions job will run the TF plan and seek an approval from the users to validate the Terraform plan, once approved the TF apply is run again to provision the final infrastructure. The plan output is logged in GH Actions for audit purposes and the required notifications are sent via Email or Slack Notification.</p><h3>CloudFront + S3 via Terraform &amp; GitHub Actions Pipelines:</h3><p>The general steps are as follows:</p><ol><li>The repo has Terraform code for Cloudfront, S3, AWS WAF, Cloudtrail etc. Read the Readme.md file in the repository for more details.</li><li>The first step is to create a s3 bucket where our state file for terraform infrastructure will be saved and set up a backend configuration. Refer Terraform state file documentation on Statefile and State File locking using AWS DynamoDB.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BzhNOfOnc10sxF2KNoBp6A.png" /></figure><p>We also need to enable bucket versioning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xN4dbb3JVBS5PsYxJmVWYw.png" /></figure><p>3. Once the bucket is created we set up the backend configuration for terraform in backend.tf. Here the bucket parameter contains the name of the bucket and the key parameter contains the name with which the state file will be created.</p><pre>terraform {<br> backend &quot;s3&quot; {<br>   bucket     = &quot;caw-aws-aps1-demo-s3-tfstate&quot;<br>   key        = &quot;s3-backend-demo-infra-module.tfstate&quot;<br>   region     = &quot;ap-south-1&quot;<br> }<br>}</pre><p>4. We also set up the provider in provider.tf. Alias is used to set up providers for two different aws regions as WAF needs to be configured in us-east-1. (<a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_web_acl#scope">https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_web_acl#scope</a>). For more information on multiple provider configuration — <a href="https://developer.hashicorp.com/terraform/language/providers/configuration#alias-multiple-provider-configurations">Link</a></p><pre>terraform {<br> required_providers {<br>   aws = {<br>     source  = &quot;hashicorp/aws&quot;<br>     version = &quot;~&gt; 4.45.0&quot;<br>   }<br> }<br>}<br>provider &quot;aws&quot; {<br> region     = &quot;ap-south-1&quot;<br> access_key = var.access_key_id<br> secret_key = var.access_key_secret<br>}<br><br><br>provider &quot;aws&quot; {<br> alias = &quot;aws-waf-web-acl-provider&quot;<br> region     = &quot;us-east-1&quot;<br> access_key = var.access_key_id<br> secret_key = var.access_key_secret<br>}</pre><p>5. Creating the bucket for static website hosting in s3.tf :</p><pre>resource &quot;aws_s3_bucket&quot; &quot;this-s3-bucket&quot; {<br> bucket        = &quot;${local.parent_org_name}-${local.cloud_provider}-${local.region}-${local.environment}-s3-${local.project}-${var.s3_bucket_name}&quot;<br> force_destroy = true<br>}<br>Resource&quot;aws_s3_bucket_website_configuration&quot; &quot;this-s3-website-configuration&quot; {<br> bucket   = var.bucket-name<br> index_document {<br>   suffix = &quot;index.html&quot;<br> }<br> error_document {<br>   key = &quot;index.html&quot;<br> }<br> depends_on = [<br>   aws_s3_bucket.this-s3-bucket<br> ]<br>}<br>resource &quot;aws_s3_bucket_policy&quot; &quot;this-s3-policy&quot; {<br> bucket=var.bucket-name<br> policy   = &lt;&lt;POLICY<br>{<br>   &quot;Version&quot;: &quot;2008-10-17&quot;,<br>   &quot;Id&quot;: &quot;PolicyForCloudFrontPrivateContent&quot;,<br>   &quot;Statement&quot;: [<br>       {<br>           &quot;Sid&quot;: &quot;AddPerm&quot;,<br>           &quot;Effect&quot;: &quot;Allow&quot;,<br>           &quot;Principal&quot;: &quot;*&quot;,<br>           &quot;Action&quot;: &quot;s3:GetObject&quot;,<br>           &quot;Resource&quot;: &quot;arn:aws:s3:::${var.bucket-name}/*&quot;<br>       }<br>   ]<br>}<br>POLICY<br> depends_on = [<br>   aws_s3_bucket.this-s3-bucket<br> ]<br>}<br>resource &quot;aws_s3_bucket_acl&quot; &quot;this-s3-acl_policy&quot; {<br> bucket=var.bucket-name<br> access_control_policy {<br>   grant {<br>     grantee {<br>       id   = data.aws_canonical_user_id.current.id<br>       type = &quot;CanonicalUser&quot;<br>     }<br>     permission = &quot;READ&quot;<br>   }<br>   grant {<br>     grantee {<br>       id   = data.aws_canonical_user_id.current.id<br>       type = &quot;CanonicalUser&quot;<br>     }<br>     permission = &quot;READ_ACP&quot;<br>   }<br>   grant {<br>     grantee {<br>       id   = data.aws_canonical_user_id.current.id<br>       type = &quot;CanonicalUser&quot;<br>     }<br>     permission = &quot;WRITE&quot;<br>   }<br>   grant {<br>     grantee {<br>       id   = data.aws_canonical_user_id.current.id<br>       type = &quot;CanonicalUser&quot;<br>     }<br>     permission = &quot;WRITE_ACP&quot;<br>   }<br>   grant {<br>     grantee {<br>       type = &quot;Group&quot;<br>       uri  = &quot;http://acs.amazonaws.com/groups/global/AllUsers&quot;<br>     }<br>     permission = &quot;READ_ACP&quot;<br>   }<br>   grant {<br>     grantee {<br>       type = &quot;Group&quot;<br>       uri  = &quot;http://acs.amazonaws.com/groups/global/AllUsers&quot;<br>     }<br>     permission = &quot;READ&quot;<br>   }<br>   owner {<br>     id = data.aws_canonical_user_id.current.id<br>   }<br> }<br>}</pre><p>6. Creation of the CloudFront distribution in cloudfront.tf . Note: These parameters are for demo / blog purpose only follow CloudFront best practices for production use.</p><pre>resource &quot;aws_cloudfront_distribution&quot; &quot;this-cdn-portal&quot; {<br> origin {<br>   domain_name = data.aws_s3_bucket.demo-portal-s3-bucket.bucket_domain_name<br>   origin_id   = data.aws_s3_bucket.demo-portal-s3-bucket.bucket_domain_name<br> }<br> wait_for_deployment = false<br> enabled             = true<br> is_ipv6_enabled     = true<br> default_root_object = &quot;index.html&quot;<br> default_cache_behavior {<br>   allowed_methods        = [&quot;GET&quot;, &quot;HEAD&quot;]<br>   cached_methods         = [&quot;GET&quot;, &quot;HEAD&quot;]<br>   target_origin_id       = data.aws_s3_bucket.demo-portal-s3-bucket.bucket_domain_name<br>   compress               = true<br>   cache_policy_id        = data.aws_cloudfront_cache_policy.cache_policy_cloudfront.id<br>   viewer_protocol_policy = &quot;allow-all&quot;<br> }<br> web_acl_id = aws_wafv2_web_acl.this-waf-web-acl.arn<br> price_class = &quot;PriceClass_All&quot;<br> viewer_certificate {<br>   cloudfront_default_certificate = true<br> }<br> restrictions {<br>   geo_restriction {<br>     restriction_type = &quot;none&quot;<br>   }<br> }<br>}</pre><p>7. Createion of WAF in aws-waf.tf:</p><pre>resource &quot;aws_wafv2_web_acl&quot; &quot;this-waf-web-acl&quot; {<br> provider = aws.aws-waf-web-acl-provider <br> name        = &quot;${local.parent_org_name}-${local.cloud_provider}-${local.region}-${local.environment}-waf_web_acl&quot;<br> description = &quot;Bot Control waf aws acl&quot;<br> scope       = &quot;CLOUDFRONT&quot;<br><br><br> default_action {<br>   allow {}<br> }<br>  rule {<br> name = &quot;AWS-AWSManagedRulesBotControlRuleSet&quot;<br> priority = 0<br> statement {<br>   managed_rule_group_statement {<br>     vendor_name = &quot;AWS&quot;<br>     name = &quot;AWSManagedRulesBotControlRuleSet&quot;<br>   }<br> }<br> override_action {<br>   count {}<br> }<br> visibility_config {<br>   sampled_requests_enabled = true<br>   cloudwatch_metrics_enabled = true<br>   metric_name = &quot;AWS-AWSManagedRulesBotControlRuleSet&quot;<br> }<br>}<br> visibility_config {<br>   sampled_requests_enabled = true<br>   cloudwatch_metrics_enabled = true<br>   metric_name = &quot;AWS-AWSManagedRulesBotControlRuleSet&quot;<br> }<br>}</pre><p>8. We create a workflow to rebuild the site and deploy it automatically after each update with main.yml. The workflow will only be triggered if files are modified after a push action in these directories</p><pre>name: Plan using Terraform<br>on:<br> pull_request:<br>   branches:<br>     - develop<br>   paths:<br>     - &#39;terraform/dev/**&#39;</pre><p>9. The terraform code is checked for security issues using <a href="https://github.com/aquasecurity/tfsec">TFSEC (https://github.com/aquasecurity/tfsec)</a> This is the static code analysis phase of Terraform code.</p><pre>- name: Clone repo<br>  uses: actions/checkout@master<br><br>- name: tfsec<br>  id: tfsec<br>  uses: aquasecurity/tfsec-action@v1.0.0<br>  with:<br>    soft_fail: true</pre><p>10. More gatings like this can be added to the CI pipeline, for ex: Tfcost, etc which can project approx. cost of the infra being provisioned by Terraform. If the security check fails, the build is halted.</p><p>11. Use GitHub Actions Setup Terraform project to run Terraform jobs in GitHub Actions. (https://github.com/hashicorp/setup-terraform.git)</p><pre>- name: Check out code<br>     uses: actions/checkout@v2<br><br><br> - name: Setup Terraform<br>   uses: hashicorp/setup-terraform@v2<br>   with:<br>     terraform_version: 1.3.7</pre><p>12. Configure AWS credentials and Initialize Terraform.</p><pre>- name: Configure AWS Credentials<br>       uses: aws-actions/configure-aws-credentials@v1<br>       with:<br>         aws-region: ap-south-1<br>         aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}<br>         aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}<br><br><br> - name: Initialize Terraform<br>   id: init<br>   run: |<br>     terraform init \<br>     -backend-config=&quot;access_key=&quot;${{ secrets.AWS_ACCESS_KEY_ID }}&quot; \<br>     -backend-config=&quot;secret_key=&quot;${{ secrets.AWS_SECRET_ACCESS_KEY }}&quot;</pre><p>13. The credentials are being sourced from github secrets, so that sensitive information does not end up on a public repository even by mistake. To set these up head to your repository-&gt;settings-&gt;secrets and variables-&gt;actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4iJjIxk_oSnUZhiAvKl_Mw.png" /></figure><p>14. Configure Terraform Plan and Github outputs that comment on the changes to be made in infrastructure.</p><pre>- name: Plan Terraform<br> id: plan<br> continue-on-error: true<br> run: |<br>   terraform plan -no-color</pre><p>15. Once we create a new branch and create a pull request.The Pull request triggers a github action which provisions GitHub Action Runners.</p><pre>git branch checkout -b demo-project<br>git add .<br>git commit -m &quot;First commit&quot;<br>git push origin demo-project</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NWP92gUX9YysyhwIs6BAFg.png" /></figure><p>16. Output of the plan is logged in a PR comment automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L4Hqq4KbSBTSbA6cYoguNg.png" /></figure><p>With the help of an action github script which basically saves the output from previous steps of Tfsec, init and plan and publishes it as a comment shown above.</p><pre>  - uses: actions/github-script@v6<br>       if: github.event_name == &#39;pull_request&#39;<br>       env:<br>         PLAN: &quot;terraform\n${{ steps.plan.outputs.stdout }}&quot;<br>       with:<br>         script: |<br>           const output = `#### Terraform Tfsec 🤖\`${{ steps.tfsec.outcome }}\&#39;<br>           #### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`<br><br><br>           #### Terraform Plan 📖\`${{ steps.plan.outcome }}\`<br><br><br>           &lt;details&gt;&lt;summary&gt;Show Plan&lt;/summary&gt;<br><br><br>           \`\`\`\n<br>           ${process.env.PLAN}<br>           \`\`\`<br><br><br>           &lt;/details&gt;<br><br><br>           *Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*`;<br><br><br>           github.rest.issues.createComment({<br>             issue_number: context.issue.number,<br>             owner: context.repo.owner,<br>             repo: context.repo.repo,<br>             body: output<br>           })</pre><p>17. An Email and a slack notification are sent to reviewers to review the changes.</p><p>18. After approval of the reviewers the Pull request is merged and another pipeline is triggered which provisions the infrastructure.</p><pre>     - name: Apply Terraform<br>       if: steps.plan.outcome == &#39;success&#39;<br>       id: apply<br>       continue-on-error: true<br>       run: |<br>         terraform destroy -auto-approve</pre><p>19. After manual approval has been given and the infrastructure changes are applied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oQA476PjDyq3ENpQIG20BQ.png" /></figure><p>20. Post the infrastructure deployment, route53 entries need to be configured with the ACM Certificate and added to cloudfront. Terraform Code for route 53 is beyond the scope for this blog and can be configured manually.</p><p>21. After the Infrastructure has been deployed the next step would include pushing the built code to the s3 bucket so that it can be hosted. For that we need another pipeline where we synchronize the build files of the project to S3</p><pre> aws s3 sync --follow-symlinks --delete --no-progress ./dist/apps/&lt;foldername&gt;/ s3://${{ secrets.&lt;bucketname&gt;  }}/</pre><p>22. And create an invalidation for cloudfront using the following commands.</p><pre>aws cloudfront create-invalidation --distribution-id ${{secrets.&lt;distribution_idName&gt;}} --paths &quot;/*&quot;</pre><h3>Github Repositoy</h3><ul><li><a href="https://github.com/cawstudios/static-website-hosting-using-cloudFront-and-s3-bucket.git">https://github.com/cawstudios/static-website-hosting-using-cloudFront-and-s3-bucket.git</a></li></ul><h3>References</h3><ul><li><a href="https://github.com/aquasecurity/tfsec">https://github.com/aquasecurity/tfsec</a></li><li><a href="https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-serve-static-website/">https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-serve-static-website/</a></li><li><a href="https://developer.hashicorp.com/terraform/tutorials/automation/github-actions">https://developer.hashicorp.com/terraform/tutorials/automation/github-actions</a></li></ul><h3>Conclusion</h3><p>The combination of Terraform and GitHub Actions has provided a powerful and secure way to set up a static website using AWS CloudFront and S3 buckets. By using Terraform’s Infrastructure as Code (IaC) approach and GitOps practices, the process of provisioning and configuring the necessary resources is automated and secure. Additionally, security checks like TFSEC are added to CI pipelines to ensure the code is secure. This is an efficient solution for anyone looking to set up a static website in a similar way.</p><blockquote>This Blog was written by <a href="https://www.linkedin.com/in/aayush-bajaj-505/">Aayush Bajaj</a> (<a href="https://cawstudios.com/">CAW Studios</a>)</blockquote><blockquote>CAW Studios is a Product Engineering Company of 100+ geeks based out of Hyderabad. We run engineering for other start-ups.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ad45b1d744a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/caw-engineering-blogs/hosting-a-static-website-using-aws-cloudfront-and-s3-bucket-7ad45b1d744a">Hosting a Static Website using AWS CloudFront and S3 Bucket</a> was originally published in <a href="https://medium.com/caw-engineering-blogs">CAW Engineering Blogs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Apache Airflow for running data jobs at scale]]></title>
            <link>https://medium.com/caw-engineering-blogs/using-apache-airflow-for-running-data-jobs-at-scale-408060266306?source=rss-9543bec17908------2</link>
            <guid isPermaLink="false">https://medium.com/p/408060266306</guid>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[apache-airflow]]></category>
            <category><![CDATA[aws-glue]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[CAW Blogs]]></dc:creator>
            <pubDate>Thu, 09 Feb 2023 06:33:11 GMT</pubDate>
            <atom:updated>2023-02-16T15:05:59.225Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By </em><a href="https://www.linkedin.com/in/kartikbansal/"><em>Kartik Bansal</em></a><em>, </em><a href="https://medium.com/linkedin.com/in/amar-jaiswal-065b37112/"><em>Amar Jaiswal</em></a><em> (</em><a href="https://cawstudios.com/"><em>CAW Studios</em></a><em>)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vJb9oP4eyjnACSGONnH_SA.jpeg" /></figure><p>At CAW, we work on hard problems. Sometimes, the problem is simple, but when we have to implement it at a scale with consistent reliability, a simple problem can grow into a hard one.</p><p>This is the case with one of our products. The problem was implementing data collection and processing jobs at scale. Each job either scraps data from a website, calls an API, downloads a file, or gets data from RSS or Twitter feeds.</p><p>Individually, they are small and simple problems. But traditional approaches break down when you have to consistently add 100+ new jobs every month and have the ability to orchestrate 1000+ jobs in production with reliability.</p><p>We evaluated several solutions on the following dimensions -</p><ol><li>Complex Scheduling with retry logic</li><li>Horizontal scale as we added newer data sources</li><li>Real-time monitoring for failures</li><li>Instrumentation so we could optimize slow-performing jobs</li><li>Visibility on the overall health of the system</li></ol><p>We narrowed it down to two — AWS Glue and Apache Airflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hm-n0Tv-jDCxTK0JV0uRng.png" /></figure><p>It was a tough battle between the two.</p><p>However, Airflow being an Open Source solution that allowed us to avoid vendor lock-in, we decided to go with it.</p><h3>Apache Airflow</h3><p>Apache Airflow was conceived at Airbnb. It is a batch workflow orchestration platform with each job represented as a Directed Acyclic Graph or DAG.</p><p>The Airflow framework contains operators to connect with many technologies and is easily extensible for connecting with new technology. If the workflows have a clear start and end and run at regular intervals, they can be programmed as an Airflow DAG.</p><p>Airflow Docs: <a href="https://airflow.apache.org/docs/apache-airflow/stable/index.html">https://airflow.apache.org/docs/apache-airflow/stable/index.html</a></p><h3>Architecture</h3><p>Apache Airflow, as some people like to call it, “CRON on steroids” works on a fundamental principle of DAGs (Directed Acyclic Graphs). In this, one can create functions/methods which will act as Nodes of the DAG.<br>And we can define the direction using simple arrow notations “&gt;&gt;”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8KxSzvJMRz0K7-mzrVJATw.png" /></figure><ul><li><a href="https://docs.aws.amazon.com/mwaa/latest/userguide/get-started.html">Get started with Amazon Managed Workflows for Apache Airflow (MWAA)</a></li><li>Writing and Running DAGSs: <a href="https://airflow.apache.org/docs/apache-airflow/stable/best-practices.html#best-practices">Best Practices — Airflow Documentation</a></li></ul><p>Airflow has a variety of provider packages that helps in easy integration with third-party projects, including AWS, Microsoft Azure, Facebook, Google, etc. Full list <a href="https://airflow.apache.org/docs/#providers-packagesdocsapache-airflow-providersindexhtml">here</a></p><h3>Configurability and Observability</h3><p>Airflow comes bundled with a powerful dashboard that enables us to observe and configure schedule time, retry logics, and enable-disable jobs. The same dashboard provides rich metrics <strong>to</strong> monitor the jobs on error rates and performance. We can do custom app logging from individual jobs to troubleshoot easily.</p><p>Monitoring: <a href="https://airflow.apache.org/docs/apache-airflow/stable/logging-monitoring/index.html#logging-monitoring">Logging &amp; Monitoring — Airflow Documentation</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8eD9n4pUyUvHzlGqp02TXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fmtVCSHp1q_aMQaV8kQ4Og.png" /></figure><h3>Implementation</h3><p>We decided to implement our v1 using the <a href="https://aws.amazon.com/managed-workflows-for-apache-airflow/">MWAA (Managed workflows for apache airflow)</a> from AWS with the flexibility to go completely self-hosted in the future.</p><p>MWAA enabled us to ve ops-lite for the v1. We used ECSOperator to help run tasks as an ephemeral ECS task outside Airflow’s network. Traditionally regular tasks would run by Airflow’s worker node, but if our task or job is huge and needs more resources, it might take more processor bandwidth and slow down the execution.</p><p>ECSOperator is a perfect candidate in such cases.</p><ul><li><a href="https://docs.aws.amazon.com/mwaa/latest/userguide/samples-ecs-operator.html#samples-ecs-operator-code">https://docs.aws.amazon.com/mwaa/latest/userguide/samples-ecs-operator.html#samples-ecs-operator-code</a></li><li><a href="https://medium.com/@sohflp/how-to-work-with-airflow-docker-operator-in-amazon-mwaa-5c6b7ad36976">https://medium.com/@sohflp/how-to-work-with-airflow-docker-operator-in-amazon-mwaa-5c6b7ad36976</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uYlA82V0X6X9MjSp4M6hqg.png" /></figure><p><strong><em>Connectors and Converters</em></strong></p><p>For each feed, we created a DAG executing two tasks — a Connector and a Converter.</p><ul><li><strong>Connectors</strong>: They contain the crawler logic, which fetches the raw data from various data sources, including websites, APIs, shred files, RSS feeds, and Twitter, and saves the data to S3.</li><li><strong>Converters: </strong>They download data from s3, perform cleaning and transformation to STIX format, and feed it into a Queue.</li></ul><p>The logic to convert raw data to a structured format takes multiple iterations to stabilize.</p><p>You start with a few data feeds and design your data conversion logic based on their data format. And as you add more feeds, you encounter newer formats and iteratively expand your conversion logic.</p><p>We made a decision upfront to decouple the connectors from the converters so we could rerun the converter’s logic after we added support for the unhandled scenarios without requiring us to re-download the data.</p><p><strong>RAW Data Storage<br></strong>We used AWS S3 buckets to store the raw data scraped from various data sources. The connector task saves the data in the bucket.</p><p><strong>Processed Data Queue<br></strong>Carries structured, cleaned, and valuable information that can be saved into DB. The converter sends the data into the queue for further processing by the Data Injector.<br>We used <strong>AWS SQS </strong>service to carry this data</p><p><strong>Data Injector<br></strong>A consumer to the queue, its job is to de-duplicate, rank, compute the confidence index and insert data into DB. We created an AWS Lambda function with an SQS trigger, so whenever new data is injected into the queue, it does its job automatically.</p><p><strong>Database<br></strong>We used MongoDB to store the final structured data. Since the data was not relational, we wanted it to be highly available. Therefore, a NoSQL DB was the perfect choice for our use case. Hence Mongo DB was a no-brainer here.</p><h3>Challenges</h3><p>The main challenge was that MWAA supports only specific airflow versions, and It comes with out-of-the-box plugins that were no less than a headache to set up manually.</p><p>An array of hurdles would crop up, such as a dependency version mismatch or a Python version mismatch. It was challenging for new developers to get the hang of it and set up a new environment just to write a few DAGs.</p><p>Upon researching, we found a way to mimic a local MWAA setup — <a href="https://github.com/aws/aws-mwaa-local-runner">https://github.com/aws/aws-mwaa-local-runner</a>.</p><p>This repository provides a Command Line Interface (CLI) utility that replicates an Amazon Managed Workflows for Apache Airflow (MWAA) environment locally.</p><p>This repo includes the following:</p><ul><li>A <a href="https://github.com/aws/aws-mwaa-local-runner/blob/v2.4.3/docker/Dockerfile">DockerFile</a> derived from <strong><em>amazonlinux </em></strong>image miming the MWAA server.</li><li>A <a href="https://github.com/aws/aws-mwaa-local-runner/blob/v2.4.3/mwaa-local-env">Command line shell script</a> that can build Airflow Image with predefined dependencies and constraints.</li><li>A <a href="https://github.com/aws/aws-mwaa-local-runner/blob/v2.4.3/docker/docker-compose-local.yml">DockerCompose</a> file with a local Postgres instance and the locally built Airflow Docker image. It mounts the local DAGs directory so we can test and run our DAGs locally.</li></ul><p>Now, to run the airflow instance locally, we have to run two commands:</p><ul><li><strong><em>./mwaa-local-env build-image</em></strong>: This command will generate a docker image using the docker file, as mentioned earlier.</li><li><strong><em>./mwaa-local-env start</em></strong>: This command will run a local env with a Postgres DB and locally mounted DAGs folder.</li></ul><p>This also gave us the flexibility of containerizing our setup, making it easy to migrate to a self-hosted Airflow Setup with minimal configuration changes on any given day.</p><h3>Repository Structure</h3><p>Most data sources had similar patterns for querying, processing, and storing data. We developed a smart codebase structure to ensure code reusability and common standards across data feeds.</p><p>We used a MonoRepo structure for Connector/ Converters and Data Inserters.</p><p>Connectors and Converters run as an Airflow Task.</p><pre>|-common<br>|   |---&gt; A Common pip package that contains common code sharable b/w multiple services<br>|<br>|-data_injector<br>|   |---&gt;  Code for the Serverless that picks STIX entry from SQS and inserts into MongoDB<br>|<br>|-connectors_and_converters/<br>|   |---&gt; This is the Airflow&#39;s DAGs folder, contains code for data feed dags<br>|   |<br>|   |-shared/<br>|   |   |---&gt; Contains common code amongst all DAGs<br>|   |   |<br>|   |   |- utilities<br>|   |   |- providers<br>|   |<br>|   |-feeds/<br>|       |<br>|       |-data_feed_1/<br>|       |   |- _init_.py<br>|       |   |- connector.py<br>|       |   |- convertor.py<br>|       |<br>|       |-data_feed_2/<br>|       |   |- _init_.py<br>|       |   |- connector.py<br>|       |   |- convertor.py<br>|       |<br>|       |-data_feed_3/<br>|           |- _init_.py<br>|           |- connector.py<br>|           |- convertor.py<br>|-aws<br>|   |---&gt; All CloudFormation Scripts required to bring up the infra on AWS<br>|<br>|-docker<br>    |---&gt; Docker Compose files to run the local setup</pre><p>The idea was that all the shared logic between these data feeds sit in the shared folder.</p><p>As we implement more feeds and common patterns emerge, we promote this new logic to the shared and reuse them. We started with a few common utilities for scrapping and uploading data to s3, and as the number of feeds grew, so did our shared logic.</p><h3>Deployment</h3><p>Since we decided to use MWAA, all DAGs code must be deployed to an S3 bucket; we just had to write a Github Action that uses the <strong>AWS CLI </strong>to sync the <strong><em>connectors_and_convertors </em></strong><em>directory to AWS s3.</em></p><pre>aws s3 sync ./connectors_and_converters/ <br>s3://${{secrets.AWS_S3_BUCKET_DAGS}}/dags/ --delete --exclude &quot;*.pyc&quot;</pre><h3>Final Thoughts</h3><p>Apache Airflow helped us achieve a manageable solution to run a large number of feeds.</p><p>So much so that we were able to add two new feeds every week. At this rate, we are positive to reach ten new feeds per week by the next quarter.</p><blockquote>This Blog was written by By <a href="https://www.linkedin.com/in/kartikbansal/">Kartik Bansal</a>, <a href="https://medium.com/linkedin.com/in/amar-jaiswal-065b37112/">Amar Jaiswal</a> (<a href="https://cawstudios.com/">CAW Studios</a>)</blockquote><blockquote>CAW Studios is a Product Engineering Company of 100+ geeks based out of Hyderabad. We run engineering for other start-ups.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=408060266306" width="1" height="1" alt=""><hr><p><a href="https://medium.com/caw-engineering-blogs/using-apache-airflow-for-running-data-jobs-at-scale-408060266306">Using Apache Airflow for running data jobs at scale</a> was originally published in <a href="https://medium.com/caw-engineering-blogs">CAW Engineering Blogs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>