<?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 Alex@TheOther.AI on Medium]]></title>
        <description><![CDATA[Stories by Alex@TheOther.AI on Medium]]></description>
        <link>https://medium.com/@theotherai?source=rss-f6ec838bbca0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*c6aj7wOBzmy31V6a.</url>
            <title>Stories by Alex@TheOther.AI on Medium</title>
            <link>https://medium.com/@theotherai?source=rss-f6ec838bbca0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 21:45:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@theotherai/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[Building Bridges: How Model Context Protocol Connects AI to Your Data]]></title>
            <link>https://medium.com/@theotherai/building-bridges-how-model-context-protocol-connects-ai-to-your-data-f308a54cb4e4?source=rss-f6ec838bbca0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f308a54cb4e4</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[anthropic-claude]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Alex@TheOther.AI]]></dc:creator>
            <pubDate>Thu, 03 Apr 2025 22:46:16 GMT</pubDate>
            <atom:updated>2025-04-03T22:46:16.713Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kDHSeTi62bYKAmqdSWdT0A.png" /></figure><blockquote>With sufficient momentum, MCP could become as fundamental to AI integration as REST APIs have been to web development.</blockquote><h3>The Integration Challenge for AI Assistants</h3><p>“Why can’t my AI assistant just access the data it needs?” This question has persisted since ChatGPT launched in November 2022, with only moderate advancements addressing this challenge. AI models excel at generating content and “reasoning” through problems, but they’re effectively blind to the information locked in our databases, repositories, and business tools. Without access to this context, even the most advanced models produce generic responses when we need specific insights. It’s like having a brilliant consultant who’s never allowed to see your company’s documents.</p><p>The challenge gets worse when you consider the integration landscape. Just as we once struggled with writing custom code for every API — learning unique quirks, authentication methods, and response formats for each service — we now face the same fragmentation with integrating these services with our AI apps. As developers we spend a lot of time building and maintaining connectors rather than focusing on core features. Need to add Slack notifications to your agent? That’ll be a week. Need to make a call to search latest news data? That’ll be another week. Need to have the agent update an opportunity in Salesforce? Forget it. That’ll be an act of congress. The bottom line: integrations are hard, and they’re even harder in AI applications.</p><p>That’s the driving force behind Anthropic introducing Model Context Protocol (MCP) last November (2024). MCP’s purpose is to provide a unified layer that translates between AI models and the systems where our data lives, promising to do for AI what standardized APIs did for web services: create a common language that makes integration straightforward and sustainable.</p><h3>The Problem MCP Solves</h3><p>I joked earlier about how long integrations take. But this isn’t really a joke — it’s the frustrating reality most AI app developers face today.</p><p>Here’s what typically happens: You build a chatbot using your favorite LLM whether it be Anthropic, OpenAI, or others. Everything works great in your test conversations until a user asks it to “check my recent Slack messages” or “update my sales opportunity.” Suddenly, you’re back to square one.</p><p>For each integration, you’re stuck with the same tedious process: learning specific APIs, figuring out authentication, translating between what your LLM understands and what the API expects, parsing responses, and handling all those annoying edge cases and rate limits. This typically requires a custom API integration with each service or capability you would like to include in your AI app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Keu8xn4XayjbuiZTK3HPRw.png" /></figure><p>When you multiply this across every service your users might want to connect to, your “AI assistant” project quickly morphs into an “API integration” project. Your roadmap gets swallowed by integration work rather than improving your core AI experience.</p><p>Anthropic describes this as the “M×N problem” — with M different language models and N different tools, you need M×N different integrations. Each requires custom code and maintenance, which is simply unsustainable. Even worse, these integrations are fragile. When Slack updates their API, you’re scrambling to fix your connector. When Salesforce adds new fields, your integration breaks in subtle ways. And if your user wants to connect to some niche business tool you’ve never heard of? Good luck with that.</p><p>That’s exactly the problem MCP aims to solve. Instead of forcing every AI developer to become an expert in every potential API, what if there was a standard way for services to expose their functionality to AI models? By transforming the M×N problem into a simpler N+M approach, any compliant model could work with any compliant tool — similar to how ODBC revolutionized database connectivity in the 90s by creating one standard that lets any application talk to any database without custom code for each combination.</p><h3>Inside the MCP Architecture</h3><p>At its core, MCP uses a simple client-server architecture that facilitates communication between AI applications and external services. MCP consists of three core components — Host, Client, and Server — that enable AI applications to interact seamlessly with external services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HUlsJGoBOywkhJa59bmwow.png" /></figure><h4>Host</h4><p>Hosts are AI applications like ChatGPT, Claude, or custom assistants that interact with users and leverage LLMs. Their role is to provide the environment where AI operates. Hosts connect to MCP through clients, which handle communication with external services via servers.</p><h4>Client</h4><p>Clients act as a bridge between AI and external services. It has three key responsibilities:</p><ul><li><strong>Connectivity</strong>: Establishes secure connections to MCP Servers, handles authentication, and routes requests.</li><li><strong>Discovery</strong>: Queries servers to find available tools and capabilities.</li><li><strong>Execution</strong>: Executes actions on behalf of the LLM — like making API calls, retrieving data, or applying prompt templates.</li></ul><p>For example, if your AI needs data from Slack, the client:</p><ol><li>Discovers available Slack tools from the server</li><li>Shares them with the LLM along with the user query for the LLM to make a selection</li><li>Sends the selected tool request to the server</li><li>Retrieves the result and returns it to the LLM</li><li>The LLM generates a response for the user</li></ol><p>Each client connects to one server. So if your AI needs access to five services, it uses five separate clients — ensuring clear boundaries and clean implementation.</p><h4>Server</h4><p>MCP Servers are lightweight programs that expose specific capabilities and context via the protocol. Each server typically handles a single data source or service — e.g., Slack, code repositories, or document storage. Alternatively, servers can be organized by use case.</p><p>In the architecture image above, <em>MCP Server 1</em> supports Git access, search, file storage, Slack notifications, and engineering-specific prompts — making it ideal for software development tasks.</p><p>The server’s core job is to translate between the standardized MCP format and the quirks of underlying APIs or data formats. Crucially, services connect to the <strong>server</strong>, not directly to the host or client.</p><p>Ideally, platforms like Slack or Salesforce will provide their own MCP servers. If not, developers can build or use community-maintained ones.</p><h3>Why MCP Isn’t Just Another SDK</h3><p>Many developers ask how MCP compares to tools like LangChain or the OpenAI SDK. The key difference: MCP is a <em>protocol</em>, not a framework.</p><p>Protocols define standardized rules for communication between systems — like HTTP or DNS — enabling interoperability by default. They’re not optional tools, but foundational agreements.</p><p>Frameworks and SDKs, on the other hand, are convenience layers built on top of these protocols. They help with implementation but don’t define how systems <em>should</em> communicate.</p><p>With MCP, you still can (and likely will) use frameworks — but typically within the <strong>server</strong>, not the AI application itself.</p><p>The table below highlights the core differences between frameworks/SDKs and protocols like MCP:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*arCcM23rhe6K1w-GUtHPCg.png" /></figure><p>In short, frameworks help you <em>build</em> integrations, while MCP defines how systems can <em>interoperate</em> reliably at scale. They’re complementary — but not interchangeable.</p><h3>Why This Matters</h3><p>AI integrations today are fragile, fragmented, and time-consuming — every new service means reinventing the wheel. This creates mounting technical debt and slows innovation. MCP changes the game by introducing a standardized, scalable approach that decouples AI apps from the chaos of custom integrations.</p><p>The current integration model leads to significant technical debt:</p><ul><li>Each AI application requires custom code for every service integration</li><li>Developers must maintain separate authentication, data parsing, and API clients</li><li>Code requires updates whenever service APIs change</li></ul><p>MCP fundamentally changes this:</p><ul><li>AI applications implement a single standardized interface</li><li>Service-specific logic is encapsulated behind the protocol</li><li>New services can be added without changing core application code</li></ul><p>This shifts from a many-to-many integration nightmare to a standardized ecosystem where both application developers and service providers can independently innovate while maintaining compatibility.</p><h3>The Real-World Payoff of MCP</h3><p>MCP isn’t just a theoretical improvement — it delivers immediate, tangible benefits for developers building AI systems. By standardizing how models interact with tools and data, MCP reduces complexity, cuts down on maintenance, and makes scaling integrations dramatically easier. Here’s what that looks like in practice:</p><ol><li><strong>Reduced Development Effort</strong>: Implement a single protocol instead of dozens of custom integrations</li><li><strong>Clear Security Boundaries</strong>: Each server operates with well-defined permissions</li><li><strong>Easier Maintenance</strong>: When APIs change, only the corresponding MCP server needs updating</li><li><strong>Scalability</strong>: Adding new data sources is as simple as connecting to a new server</li><li><strong>Standardization</strong>: Teams can develop against a consistent interface rather than learning multiple API patterns</li><li><strong>Deployment Flexibility</strong>: Servers can be deployed locally for sensitive data or remotely for shared services</li></ol><h3>The Future of AI Integration</h3><p>However, these benefits depend entirely on widespread adoption. For MCP to succeed, it needs buy-in from key stakeholders: platform providers like Slack and GitHub, open source developers, and AI application builders. While early adoption from <a href="https://openai.github.io/openai-agents-python/mcp/">OpenAI</a>, <a href="https://zapier.com/mcp">Zapier</a>, and <a href="https://github.com/awslabs/mcp">AWS</a> is promising, the ecosystem needs to reach critical mass. The next 12–18 months will be crucial — developers should watch for official MCP server releases from major platforms and consider contributing to open source implementations for platforms they rely on. With sufficient momentum, MCP could become as fundamental to AI integration as REST APIs have been to web development.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f308a54cb4e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google’s Strategic Move: Betting Big on Character-Driven Chat Experiences]]></title>
            <link>https://medium.com/@theotherai/googles-strategic-move-betting-big-on-character-driven-chat-experiences-7ecaee5c2b86?source=rss-f6ec838bbca0------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ecaee5c2b86</guid>
            <category><![CDATA[venture-capital]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Alex@TheOther.AI]]></dc:creator>
            <pubDate>Tue, 26 Dec 2023 17:05:24 GMT</pubDate>
            <atom:updated>2023-12-26T17:05:24.901Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g9tD1mJvFyJ-shiUnjnvZg.jpeg" /></figure><p>This is a bit late as this happened about a month ago, but recently <a href="https://www.reuters.com/technology/google-talks-invest-ai-startup-characterai-sources-2023-11-10/">Reuters</a> reported that Google was in talks to invest “hundreds of millions” in <a href="http://character.ai/">Character.</a>AI at a $5B+ valuation. This is actually a pretty big deal, for both <a href="http://character.ai/">Character.AI</a> and for Google.<a href="http://character.ai/">Character.AI</a> is an AI platform known for creating interactive, conversational AI characters. These characters are designed to engage users in realistic and dynamic dialogues, simulating human-like conversations. Basically it allows users to have conversations with different personas or avatars as if the user is really talking to that persona.For example, a user can have a conversation with Alexander the great, George Washington, or even create their own character such as a pirate, or your company’s persona and users can chat with them as if it was a real conversation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tDIgn2jQYEw73KIE3cFoyw.png" /><figcaption>Conversation with Alexander the Great using Character.AI</figcaption></figure><p>What value does this bring? On the surface, you may think that is nice, but it’s a toy. What real value does that bring? You are right to a certain extent. The primary use of <a href="http://character.ai/">Character.AI</a> is entertainment. But, the technology they are building can be repurposed for other uses, which is why I believe Google made the investment.Here are a few use cases where this would work.</p><h4>Use Cases</h4><p><strong>Chatbots/Customer Service — </strong>The first use case is to take your company’s brand persona or to provide each user with their own persona for your company. I’ve been in the conversational AI space for some time. When working with many of these companies, the thing they want most after accurate answers and automating the transaction, is to do it in their voice.</p><p>If you talk to the marketing leader at any company, they will tell you how hard they’ve worked to build their brand voice. Some companies choose to be casual and friendly while others may choose to be more buttoned up. Building this into their chatbot has traditionally proved to be difficult as it required so much time to generate content specifically for their bots and the ability to actually test it according to this requirement.</p><p>The other side of the spectrum is to have a persona catered to the user. One of the values of generative AI is having a segment of 1. Having the same brand voice for all customers, regardless of their demographic is not always the best thing. If I’m a 25 year old working with a wealth manager, I may prefer interacting with someone that understands me, my likes and interest, and speak to me in words that I can understand. On the other side, if I’m adept at investing, I may want someone who uses more complicated terms and is more direct. While <a href="http://character.ai/">Character.AI</a> may not have these features today, They have some of these capabilities built out internally, because they would not have the ability to provide the service they do with out being able to test, switch out, and evaluate these without it. It’s just a matter of exposing it.</p><p><strong>Marketing </strong>— building personas and talking to your customers before actually talking to them. Many customers build out user personas when building new products or services, or when they are going to launch a new campaign. Companies can build many of these personas and have conversations with them. Something as simple as asking the persona to play devil’s advocate can help identify things you didn’t think about. <a href="https://roundtable.ai/">Roundtable</a> is doing something similar by allowing you to leverage your data and AI personas to simulate surveys.</p><p><strong>Emotional support </strong>— while the primary use case is chat entertainment, people are using <a href="http://character.ai/">Character.AI</a> for emotional support. They are having conversations with their bot that essentially becomes their friend. The technology can offer this emotional support through AI characters that are available 24/7, providing non-judgmental interaction and stress relief, which can be particularly beneficial for discussing sensitive issues or practicing social skills. This same use case can be exposed via partnerships with companies such as <a href="https://www.calm.com/">Calm</a> for sleep health or <a href="https://www.headspace.com/">Headspace</a> for mental health.</p><p><strong>Education plus Learning &amp; Development </strong>— How cool would it be to talk to a historical figure and learn directly from them. <a href="http://character.ai/">Character.AI</a> can be used to build out these interactive and experiential education. On the other end of the spectrum, it can be used for professional training such as watching how your employees deal with belligerent customers or teaching your hospital staff how to deal with different patient scenarios in medical training.</p><p><strong>Agents and Prompt Building — </strong>when building agents or even simple prompt based applications, you typically start with a persona. These typically start with, “You are a {persona type}”, where persona type is the role such as “you are a doctor” or “you are a marketer”. These types of openings prime the model to have a strong probability of predicting words that are within that space. Here are code examples where you see a <a href="https://github.com/geekan/MetaGPT/tree/main/metagpt/roles">list of roles</a> and some of the <a href="https://github.com/geekan/MetaGPT/tree/main/metagpt/actions">actions</a> followed by an abridged example prompt for a software architect persona.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X0GO5ayYYUHp07sITqwomw.jpeg" /><figcaption>Abridged prompt example using a Software Architect Persona</figcaption></figure><p><strong>More entertainment — </strong>This one maybe a long shot, but what if they can extend this to build out characters for shows, movies, and games. Entertainment companies can build catalogs of characters and then allow writers to pick and choose or remix characters as part of their creative process.</p><p>There is so much that can be done in this space. Much of the examples described assumes <a href="http://character.ai/">Character.AI</a> will pursue other paths beyond consumer into the enterprise space or at least partner with other companies that will, such as Google. To support this, <a href="http://character.ai/">Character.AI</a> will need to build out several capabilities that ease the engineering, testing and evaluating, and managing these personas. This is basically why I believe Google invested. Google has some commercial interest across each of these use cases in some form. While on the surface it seems like fun chatbot experience with historical figures, we’re really peeking into one of the possible futures with AI. It’s still early days, but if <a href="http://character.ai/">Character.AI</a> plays its cards right, we could be watching the rise of another AI platform. Bottom line, I would say watch this one closely.</p><p><em>Originally published on </em><a href="https://blog.summaryresearch.com/googles-strategic-move-betting-big-on-character-driven-chat-experiences/"><em>SummaryResearch</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ecaee5c2b86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leveraging Micro-Acquisitions for Strategic Growth: Risks and Rewards]]></title>
            <link>https://medium.com/@theotherai/leveraging-micro-acquisitions-for-strategic-growth-risks-and-rewards-36cd3461c777?source=rss-f6ec838bbca0------2</link>
            <guid isPermaLink="false">https://medium.com/p/36cd3461c777</guid>
            <category><![CDATA[strategy]]></category>
            <category><![CDATA[acquisition]]></category>
            <category><![CDATA[microsaas]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Alex@TheOther.AI]]></dc:creator>
            <pubDate>Wed, 30 Aug 2023 13:46:07 GMT</pubDate>
            <atom:updated>2023-08-30T13:46:07.716Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MMWw8bManRO31LjQuWQQQw.png" /></figure><p>Sometimes the quickest way to advance your strategy is through a micro-acquisition. This involves buying a small company whose product, service, or capability can be swiftly integrated into your own offerings, thereby accelerating your strategy. Think of it as a strategic acqui-hire, where you acquire smaller teams focused on addressing a specific problem or set of problems.</p><p>Amazon Web Services (AWS), a subsidiary of Amazon.com, exemplifies the successful use of this <a href="https://www.crunchbase.com/search/acquisitions/field/organizations/num_acquisitions/amazon-web-services">micro-acquisition strategy</a> to broaden its services over time.</p><p>Advantages of this approach include:</p><ul><li>Speed to Market: Acquiring an existing product or service can be faster than building one from scratch, offering a swift path to achieving your strategic objectives.</li><li>Talent Acquisition: These small teams often possess specialized skills hard to find elsewhere, providing an efficient way to acquire talent.</li><li>Risk Diversification: Micro-acquisitions can diversify your product range, potentially stabilizing your revenue streams.</li></ul><p>However, there are challenges:</p><ul><li>Cultural Mismatch: Acquired companies may have different corporate cultures, which can lead to integration issues. Cultural shifts should ideally be part of a larger, deliberate strategy, not an accidental byproduct of acquisition.</li><li>Integration Difficulties: Both companies may use disparate technologies, resulting in integration complexities that could delay or inflate the costs.</li><li>Unknown-Unknowns: Besides known risks, there are unknown variables that could impact the acquisition negatively. Due diligence is essential, along with a potential discount on the deal to mitigate unforeseen risks.</li></ul><p>In closing, micro-acquisitions offer a powerful tool for companies looking to accelerate their strategic objectives. They provide a fast-track to market entry, talent acquisition, and risk diversification. However, challenges such as cultural mismatch, integration difficulties, and unforeseen risks should not be overlooked. A balanced approach that includes due diligence and careful planning can maximize the benefits while mitigating potential downsides. Overall, when executed thoughtfully, micro-acquisitions can be a transformative strategy for growth and competitive advantage.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36cd3461c777" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decoding AI: Why One Size Doesn’t Fit All in AI Models]]></title>
            <link>https://medium.com/@theotherai/decoding-ai-why-one-size-doesnt-fit-all-in-ai-models-aa35c03756f6?source=rss-f6ec838bbca0------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa35c03756f6</guid>
            <category><![CDATA[enterprise-technology]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Alex@TheOther.AI]]></dc:creator>
            <pubDate>Mon, 14 Aug 2023 21:25:52 GMT</pubDate>
            <atom:updated>2023-08-14T21:25:52.299Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k4xSRlNaL1T0Cho1uIIYAQ.jpeg" /></figure><p>Recent speculation suggests that <a href="https://news.ycombinator.com/item?id=36675934">ChatGPT might utilize a mixture of experts (MOE)</a> approach, leveraging numerous smaller models instead of one monolithic one. This raises an intriguing question: Is it more efficient to have a singular, multi-capable model or specialized vertical models for different tasks?</p><p>Though ChatGPT appears as a single entity capable of numerous tasks, it’s important to ask if this is the ideal solution. In order to determine which approach is best for you, it’s imperative to let the use case dictate the solution. Often, businesses prematurely adopt and standardize certain technologies, imposing them on every conceivable application. This can lead to suboptimal solutions, poor business practices, and, ultimately, lackluster results. Instead, it’s more prudent to let the specific need determine the most fitting solution, managing and scaling it accordingly.</p><p>Consider a company-wide chatbot, designed to answer questions, file tickets, and handle various other requests. Such a bot demands a robust, highly capable model. Contrast this with a model designed for medical text analysis, which would require domain-specific expertise to discern subtle symptoms and conditions. While a generalized model can be adapted to these tasks, it may not be as effective or cost-efficient.</p><p>Here is a quick comparison of the pros and cons to using general purpose models vs specialized models.</p><h3>General-Purpose Models</h3><h4>Advantages</h4><p><strong><em>Flexibility</em></strong> Large language models (LLMs) can tackle a myriad of tasks, from storytelling to code writing, without being tailor-made for any specific one.</p><p><strong><em>Robustness </em></strong>Acquiring knowledge in one domain can facilitate performance in related ones. This means an LLM can be fine-tuned for specialized tasks more expediently than starting from scratch. This exposure also allows LLMs to handle diverse prompts and use cases.</p><p><strong><em>Economic Feasibility</em></strong> A single LLM can cater to multiple needs, reducing the necessity of individual models for every unique task, thus conserving resources and time.</p><p><strong><em>Quick Deployment</em></strong> They are ideal for rapid prototyping or when a niche model isn’t accessible.</p><h4>Limitations</h4><p><strong><em>Master of None </em></strong>Generally, LLMs can’t match the performance of task-specific models. Achieving comparable accuracy often requires additional groundwork.</p><p><strong><em>Resource Intensiveness</em></strong> Models like GPT-4 demand substantial computational power both for training and execution. Catering to the myriad of use cases means LLMs often need more contextual data, which raises the cost.</p><p><strong><em>Generalization Risks</em></strong> LLMs can sometimes miss out on the subtleties of specialized tasks.</p><p><strong><em>Data Privacy and Bias Concerns</em></strong> Using expansive data might lead to privacy risks or the reinforcement of pre-existing biases.</p><h3>Specialized Models</h3><h4>Advantages</h4><p><strong><em>Performance</em></strong> Being tailored for specific domains, these models can yield more precise outputs.</p><p><strong><em>Efficiency</em></strong> Often smaller in size, they can have lower latency and use fewer resources during inference.</p><p><strong><em>Customizability</em></strong> They can be refined according to domain-specific nuances and terminologies.</p><p><strong><em>Control Over Data</em></strong> Developers have the luxury of ensuring the model uses high-quality, specialized data, optimizing results.</p><h4>Limitations</h4><p><strong><em>Limited Flexibility</em></strong> Specialized models are confined to their designated domains. For instance, a model trained strictly for financial news might falter when tasked with generating sports content.</p><p><strong><em>Lengthier Development</em></strong> Crafting a domain-specific model often demands substantial time. Accumulating relevant data and fine-tuning the model can be prolonged endeavors. For example, creating a model dedicated to aerospace engineering necessitates sourcing specialized datasets and investing ample training time.</p><p><strong><em>Risk of Overfitting</em></strong> Tailoring models too closely to their training datasets can mean they miss wider contexts. A model calibrated exclusively to property insurance may find itself at sea when confronted with other insurance variants, such as medical insurance or investment offerings.</p><p><strong><em>Elevated Costs</em></strong>: Although general-purpose models might incur higher inference costs, the expenses associated with data preparation, not to mention the creation of new models for every domain or topic, can quickly accumulate, driving up the total expenditure.</p><p>As the landscape for AI continues to evolve, the debate between general-purpose and specialized models is not one of superiority, but of applicability. While general-purpose models like ChatGPT offer versatility and adaptability, specialized models bring depth and precision to domain-specific tasks. Businesses and developers need to carefully assess their needs, weighing the strengths and limitations of each approach. Ultimately, the ideal model will always be dictated by the unique demands of the task and the desired outcomes. For decision-makers, this underscores the importance of a nuanced understanding of their organizational needs, and the constraints and opportunities presented by each type of model. It’s about striking a balance — leveraging the vastness of general-purpose models while harnessing the depth of specialized ones where needed.</p><p>As AI continues to advance, it becomes crucial for us to be agile in our approach, ensuring that we harness the full potential of both general and specialized models to drive innovation and achieve optimal results. The most successful leaders will be those who remain adaptable, making informed choices that bring the most value to their organizations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa35c03756f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ahh, an API bit me! (What are APIs?)]]></title>
            <link>https://medium.com/@theotherai/ahh-an-api-bit-me-what-are-apis-f5a4efcfb184?source=rss-f6ec838bbca0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5a4efcfb184</guid>
            <category><![CDATA[api-development]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Alex@TheOther.AI]]></dc:creator>
            <pubDate>Fri, 25 Feb 2022 01:24:04 GMT</pubDate>
            <atom:updated>2022-02-25T01:24:04.864Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AnVauYIVYm9uTsQIRfdVBQ.jpeg" /></figure><p>Let’s say that I’m developing an application that allows me to manage my tasks, essentially a to-do app. As I’m developing this app, I’m going to come across the need to send notifications to alert users that their tasks are coming due. At that point I can either choose to code up my own notifications system or I can make use of a notification system that someone else has coded up, such as Twilio. How exactly can I make use of that? The answer is an API.</p><h3>What’s an API?</h3><p>API stands for <em>application programming interface </em>and they are basically a standardized way for two applications to communicate with each other. If we take the previous notifications example, Twilio is providing my application the ability to notify my users of upcoming tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dr2o4EqCAV6FFOG1-pqObA.png" /></figure><p>There are different forms of APIs such as <a href="https://restfulapi.net/">RESTful</a> (REST), <a href="https://www.microfocus.com/documentation/silk-performer/195/en/silkperformer-195-webhelp-en/GUID-FEFE9379-8382-48C7-984D-55D98D6BFD37.html">SOAP</a>, and <a href="https://www.geeksforgeeks.org/remote-procedure-call-rpc-in-operating-system/">RPC</a>, with REST being the most prevalent. (<strong>For the remainder of the article, when I make reference to <em>API</em>, I’m mainly talking about REST.</strong>)</p><h3>API Benefits</h3><p>There are several benefits including increased collaboration, decreased development time and cost savings, and a technical contract of sorts to name a few.</p><p>When you use APIs, you decrease your development time, which also reduces cost. You decrease your development time because you are literally building on the shoulders of giants. You are making use of functionality that was developed by others and made available for use. In doing so, you can quickly integrate those APIs into your own application, thereby accelerating the time it takes to deliver an application.</p><p>Furthermore, building complex solutions require a lot of resources whether in the form of people, equipment such as servers, and ultimately money. It often makes sense to rely on the work of others to reduce the cost of developing the solution by essentially offloading it to others. This offloading to others lead to greater collaboration both internal and external to your organization.</p><p>Let’s take the to-do list as an example. There are many applications that have some to-do capability built in. For example, a CRM may have tasks for you to follow up with clients or a project management application may have a to-do component in the form of a task manager to allow others to manage their individual tasks. As the developer of such an app, you can expose those as a set of APIs for others to make use of. Here’s block diagram of the CRM making use of the To-do app along with the notifications API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4LG59M7ojtB1oC_DX9biVg.png" /></figure><p>The final, major benefit of APIs are that in the context of development, the API is the contract. Not a contract in the sense of a legal document or smart contract, but more of a technical agreement between the application (client) and the API (service provider). It’s a contract that says, “If I call a particular path of the API with certain data, this is how you are to respond”. This contract essentially dictates how the API will behave within a given context.</p><p>A key benefit of that is the API becomes and abstraction layer and it allows the service provider to improve things on the backend without exposing that to the app. For example, I can build the backend for an API on one database technology, and move to another technology once the latest and greatest is available. I can do this without affecting the applications that use my API. I’ll dive deeper into this in a later post.</p><h3>Conclusion</h3><p>To sum up, APIs are application programming interfaces that provide a standard way for applications to communicate with each other. APIs offer several benefits including increased collaboration, decreased development time and cost savings, and a technical contract.</p><p>In the next post we’re going to lay the foundation for an API by defining the data model and routes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5a4efcfb184" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn DynamoDB in Under 5 Minutes]]></title>
            <link>https://medium.com/@theotherai/learn-dynamodb-in-under-5-minutes-473ce3265d1a?source=rss-f6ec838bbca0------2</link>
            <guid isPermaLink="false">https://medium.com/p/473ce3265d1a</guid>
            <dc:creator><![CDATA[Alex@TheOther.AI]]></dc:creator>
            <pubDate>Sun, 26 Jul 2020 21:27:29 GMT</pubDate>
            <atom:updated>2020-07-26T21:27:29.136Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kn2d699zQmsKr_Q9fdMOPw.png" /></figure><p><a href="https://www.theother.ai/architecting-on-aws-bootcamp"><strong>Learn more about the cloud!</strong></a></p><p>When it comes to databases, many programmers, admins, and IT Pros are familiar with relational databases. These come in various flavors such as MySQL and PostgreSQL when it comes to open source databases, and Oracle, Microsoft SQL, or others when it comes to commercial databases. The thing about many of these databases is that they are difficult to scale, costly when it comes to the commercial databases, and lack flexibility for many of the use cases that are being developed in this hyper-digital age.</p><p>Due to this reason, many developers have switched to NoSQL databases. A NoSQL database is any database that is non-relational. There are different types of NoSQL databases, but the main ones are document databases, key-value stores, column-oriented, and graph databases.</p><p>As a developer it’s important that you choose the right database for the job at hand instead of trying to shove everything into a relational database. In this post, I want to discuss the use of key-value stores, and specifically DynamoDB.</p><p>If you are a developer working in the AWS Cloud, knowing about DynamoDB is a must. Not knowing what DynamoDB is and how to use it is akin to gross negligence in the acquisition of knowledge.</p><h3>What is DynamoDB?</h3><p>So, what is DynamoDB? DynamoDB is a managed NoSQL database that is highly scalable, durable, and highly available NoSQL database that can serve any level of traffic. It provides single-digit millisecond (e.g. &lt; 10 ms) latency at any scale.</p><p>Ok. This is all of the marketing fluff. Why do I really enjoy working with DynamoDB?</p><ol><li>It’s truly <strong><em>serverless</em></strong>. When using DynamoDB, there is not software to install. No servers to procure. No servers to manage. You create a table and you use the APIs to interact with it. There are no operational burdens you have to deal with.</li><li><strong><em>Low cost</em></strong>. When you create the table, you specify the read and write capacity. Capacity is determined by how many reads and writes you make per second. This is different from the traditional server model of having to determine how many CPUs, RAM, and storage volumes required. You have a lot more flexibility when it comes to this model. An added flexibility is that as you grow in size, you can take advantage of other pricing options to meet your use case.</li><li><strong><em>Flexibility</em></strong>. DynamoDB supports a flexible data model. When working with traditional relational databases, you create a schema, which defines how your data is structured. That model forces you to always write that data in a structured format. This is great for an application that will hardly ever change. That is not the same for many applications that are being built today, that change constantly. You don’t require a schema with DynamoDB. DynamoDB requires that you define a key and you can store your attributes as the values for that item. This gives you flexibility to store various attributes to an item, assuming you stay within the size limit of an item.</li></ol><h3>DynamoDB Concepts</h3><p>You start by creating a table. A table is a collection of items. This is similar to the table in a relational database, which is a collection of rows.</p><p>Items are the individual data elements made up of attributes. For example, if you were to create a user management service that holds information about a user, you’ll have several attributes such as their name, address, phone number, user id, etc. Together, these make up an item.</p><p>Within each item, you need at least one attribute that will be the primary key, also known as the partition key or hash. DynamoDB primarily being a key-value store, uses the partition key’s value to determine where the item will be stored in Dynamo’s physical storage. This key is also used to retrieve the item.</p><p>That’s basically all you need to know to get started with DynamoDB. Don’t get me wrong, there are many more advanced features that you will eventually want to master, but this is a good enough start.</p><h3>Create our First Table, Then Add and Read Data</h3><p>Let’s go ahead and create a table and add data using Python. To get started, you will need to have an AWS account, <a href="https://pypi.org/project/boto3/">install boto3</a>, and <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html">configure your AWS command line interface</a>.</p><p>We’ll create a simple user management table that holds information about our users. After configuring all of your credentials, open the Python shell and execute the following commands.</p><pre>import boto3</pre><pre>dynamodb = boto3.resource(&#39;dynamodb&#39;)</pre><pre># create table <br>table = dynamodb.create_table(<br>    AttributeDefinitions=[<br>        {<br>            &#39;AttributeName&#39;: &#39;username&#39;, <br>            &#39;AttributeType&#39;: &#39;S&#39;<br>        }<br>    ],<br>    TableName=&#39;userManagement&#39;, <br>    KeySchema=[<br>        {<br>            &#39;AttributeName&#39;: &#39;username&#39;, <br>            &#39;KeyType&#39;: &#39;HASH&#39;<br>        }<br>    ], <br>    ProvisionedThroughput={<br>        &#39;ReadCapacityUnits&#39;: 1, <br>        &#39;WriteCapacityUnits&#39;: 1<br>    }<br>)</pre><p>This code block shows how to create a table using the boto3 SDK. Boto3 is the Python SDK for AWS. We start by importing the boto3 SDK. We then define the resource <em>dynamodb</em>, which will allow us to interact with the DynamoDB APIs.</p><p>We then create the table. The table definition itself has several attributes defined within it. The <strong>AttributeDefinitions</strong> define the attributes to be stored as part of the item. The only attribute(s) required for this definition are those that make up the key. In our case we are only using the <em>username</em> attribute, so we add that and the data type, which is a string (e.g. ‘S’). We also specify a table name, which we will call <strong><em>userManagement</em></strong> and specify the key, which is <em>username</em> with a <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.PrimaryKey">hash type</a>.</p><p>The last part is the <strong>ProvisionedThroughput</strong>, which is used to specify the read and write capacity as defined earlier. In our case, we define 1 read and 1 write capacity per second.</p><p>Next, we create a function that will be used to write data to the table.</p><pre># write items to the database<br>def add_item(username, first_name, last_name, phone): <br>    response = dynamodb.batch_write_item(<br>        RequestItems={<br>            &#39;userManagement&#39;: [<br>                {<br>                    &#39;PutRequest&#39;: {<br>                        &#39;Item&#39;: {<br>                            &#39;username&#39;: username, <br>                            &#39;firstname&#39;: first_name, <br>                            &#39;lastname&#39;: last_name, <br>                            &#39;phone&#39;: phone<br>                        }<br>                    }<br>                }<br>            ]<br>        }<br>    )<br>    return response</pre><pre>add_item(&#39;username1@mail.com&#39;, &#39;Bob&#39;, &#39;Samuel&#39;, &#39;+15555555555&#39;)</pre><pre>add_item(&#39;tom123@mail.com&#39;, &#39;Tom&#39;, &#39;Digit&#39;, &#39;+15555555555&#39;)</pre><p>We first start with a function called <strong>add_item</strong>, which takes a username, first name, last name, and phone number as arguments. Then we run the <strong>add_item</strong> function to add two users to the table.</p><p>If you then navigate over to DynamoDB in the AWS Management console and select the table we created, you will see that the two items were added to your table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3rDWcJ8-Chi8Ro3RG58rlw.png" /></figure><p>To retrieve an item from the table we created, I created another function called <strong>get_item</strong>. The <strong>get_item</strong> function takes the username as an argument.</p><pre>def get_item(username):<br>    response = dynamodb.batch_get_item(<br>        RequestItems={<br>            &#39;userManagement&#39;: {<br>                &#39;Keys&#39;: [<br>                    {<br>                        &#39;username&#39;: username<br>                    }<br>                ]<br>            }<br>        }<br>    ) <br>    return response</pre><p>Then to retrieve the item, we pass the username for the user we want to retrieve the data for.</p><pre>get_item(&#39;tom123@mail.com&#39;)</pre><p>And the response will look like the following:</p><pre>{<br>   &quot;Responses&quot;:{<br>      &quot;userManagement&quot;:[<br>         {<br>            &quot;firstname&quot;:&quot;Tom&quot;,<br>            &quot;lastname&quot;:&quot;Digit&quot;,<br>            &quot;username&quot;:&quot;<a href="/service/mailto:tom123@mail.com">tom123@mail.com</a>&quot;,<br>            &quot;phone&quot;:&quot;+15555555555&quot;<br>         }<br>      ]<br>   },<br>   &quot;UnprocessedKeys&quot;:{</pre><pre>},<br>   &quot;ResponseMetadata&quot;:{<br>      &quot;RequestId&quot;:&quot;123&quot;,<br>      &quot;HTTPStatusCode&quot;:200,<br>      &quot;HTTPHeaders&quot;:{<br>         &quot;server&quot;:&quot;Server&quot;,<br>         &quot;date&quot;:&quot;Wed, 15 Jul 2020 12:14:00 GMT&quot;,<br>         &quot;content-type&quot;:&quot;application/x-amz-json-1.0&quot;,<br>         &quot;content-length&quot;:&quot;170&quot;,<br>         &quot;connection&quot;:&quot;keep-alive&quot;,<br>         &quot;x-amzn-requestid&quot;:&quot;123&quot;,<br>         &quot;x-amz-crc32&quot;:&quot;123&quot;<br>      },<br>      &quot;RetryAttempts&quot;:0<br>   }<br>}</pre><p>From there, you can work with the attributes like you would normally do in your application. With this, you can build all types of applications and take advantage of the flexibility available with DynamoDB.</p><p>This is pretty much all you need to get started with DynamoDB. I will be writing more about Dynamo later, covering different aspects of the service.</p><p><a href="https://www.theother.ai/architecting-on-aws-bootcamp"><strong>If You Want to Learn more about the cloud</strong></a><strong>!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=473ce3265d1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Storage Options in the AWS Cloud: Elastic Block Storage]]></title>
            <link>https://medium.com/@theotherai/storage-options-in-the-aws-cloud-elastic-block-storage-7595be010d8c?source=rss-f6ec838bbca0------2</link>
            <guid isPermaLink="false">https://medium.com/p/7595be010d8c</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-storage]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Alex@TheOther.AI]]></dc:creator>
            <pubDate>Thu, 05 Mar 2020 01:31:01 GMT</pubDate>
            <atom:updated>2020-03-05T01:31:01.928Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bIVYa1O8TNGqDSDrbVFSig.jpeg" /></figure><p><a href="https://www.theother.ai/architecting-on-aws-bootcamp"><strong>If you would like to learn more about the cloud, sign up for our FREE Architecting on AWS Bootcamp!</strong></a></p><p>When building or deploying applications to the cloud, it’s important that you as the Cloud Architect is familiar with the different options available for storing data. As a good architect and a good builder, you must use the right tool at the right time. There is a saying, “to someone with a hammer, everything is a nail.” This has often been the traditional approach in on-premise architectures, but in the cloud, following this approach is negligent, leaves a lot of value on the table, and could potentially cause issues down the road. When moving to the cloud, you want to take advantage of what is available to you.</p><p>Within AWS, you have various storage options such as block, object, archival, file systems, as well as various integrations for on-premise storage and data migration to and from the cloud. The focus of this article is about the block storage options in AWS.</p><h3><strong>What is Block Storage?</strong></h3><p>What is block storage? In IT, block storage has typically been used in <a href="https://en.wikipedia.org/wiki/Storage_area_network">storage area networks</a> and more recently in cloud environments. Block storage works by breaking up data into blocks and then stores those blocks as separate pieces. Each of these blocks will have their own unique identifier which is later used to recompile the individual blocks into the file that was stored, which is used by the requesting application. Block storage is not the only form of storage used. You also have object storage, which has become very popular in recent years with the wide use of Amazon S3 and file systems storage.</p><p>In the case of AWS, there are two primary forms of block storage. You have Amazon EC2 instance store and Elastic Block Storage (EBS).</p><h3><strong>Instance Store</strong></h3><p>Let’s start with EC2 instance store. When using the AWS cloud, one of the first tasks you will almost always complete is spinning up an EC2 instance. Some instances, not all, have local storage. This local storage, as you would think, is physically attached to the hardware that the instance is running on. This provides several benefits. First, this storage is typically faster because the data has a shorter distance to travel. Second, using local storage is cheaper since it’s included in the price of the instance itself. You aren’t being charged extra for the data stored using instance storage as you would be if you were to use EBS. One of the biggest drawbacks to using instance store is that it is ephemeral, which means that all data stored in instance store is gone whenever an instance is shutdown. <strong>This is normal and to be expected.</strong> This limits the durability of your data.</p><p>For example. let’s say you are running a website where all your data is stored in instance store. Now, let’s say you needed to restart your server because you installed new software. After that restart, the data stored would no longer be there. The reason is that the instance is no longer running on the same physical hardware. When it was restarted, it was provisioned on new hardware. Therefore, it doesn’t have access to the old hardware where the data was initially stored.</p><p>If that’s the case, why exactly would you use instance store? Well, there are some use cases where instance store is still beneficial. For example, instance store is great for use cases where high performance is required such as <a href="https://en.wikipedia.org/wiki/Supercomputer">high-performance computing</a>, or use cases where the architecture is inherently <a href="https://en.wikipedia.org/wiki/Fault_tolerance">fault-tolerant</a>. These types of systems typically replicate data across multiple components as well as perform backups. Another use case where this is useful is where the cost (e.g. time and available resources) of reproducing the data is small.</p><h3>Elastic Block Store (EBS)</h3><p>In most use cases though, you would want to leverage Amazon EBS. EBS is the primary block storage used in AWS and is used to store persistent data. It works by providing highly available, reliable, and predictable block-level storage volumes that can be attached to Amazon EC2 instances. This immediately eliminates some of the drawbacks of using instance storage. EBS accomplishes this by replicating data across multiple availability zones. EBS is well suited for applications that require a database, file system, or access to raw block level storage.</p><p>EBS provides various options that enable you to balance the optimization of storage performance and cost for your specific workload. The main categories are SSD-based and HDD based. SSD-based is typically used for general purpose use cases, transactional use cases such as databases, and boot volumes. HDD-based is better for throughput intensive workloads such as big data applications and log processing where sequential reads are common.</p><p>Let’s start by going a bit deeper into SSD-based volumes. There are two types of SSD-based volumes. There is the general-purpose (gp2) and provisioned IOPs (io1). General-purpose SSD balances price and performance for a wide variety of transactional workloads. When first starting out with EBS for a workload, I would personally start by testing general purpose SSD to see if it can meet both the performance and cost requirements for my workload. It may or may not work for you, but it&#39;s important that you first test it thoroughly before evaluating other volume or storage types.</p><p>General purpose SSD provides single-digit millisecond latency and can provide up to 16,000 IOPS. This provides great performance for a wide range of use cases, which is why I suggest first testing gp2 instances before moving on to other types. One great benefit of gp2 volumes is that it allows you to burst IO. What this means is if you have an application that typically uses a baseline amount of IO, but from time to time it needs more IOPs, your IOPS will be accumulated as IOPS credit and used during peak times of your workloads. This works great for performance as well as cost.</p><p>Provisioned IOPS are good for IO intensive workloads such as databases that require consistent and predictable IO performance. When creating provisioned IOPS volumes, you specify the IOPS rate and EBS volume will deliver within 10 percent of provisioned IOPS performance 99.9% of the time within a given year. You can create a provisioned IOPS volume between 4GB and 16TB with a maximum of 64,000 IOPS per volume. In scenarios where you need more IOPS beyond 64,000, you can use configurations such as RAID to stripe and mirror data across multiple volumes. When it comes to price, on the surface provisioned IOPS is more expensive than gp2, but provides better performance for applications that require it. If your application is IO-bound, you could achieve increased performance, which could potentially reduce the size of the EC2 instance used, thereby reducing cost.</p><p>In the case of HDD-backed storage, there are two primary types; throughput optimized HDD (st1) and cold HDD (sc1). Throughput optimized SDD are low cost HDD volumes designed for frequently accessed, throughput intensive workloads. These use cases typically involve big data, data warehousing, ETL, and log processing for example. It’s important to understand that these workloads are best thought of in terms of throughput instead of IOPS.</p><p>And finally, cold HDD is the lowest cost HDD volume designed for less frequently accessed workloads requiring fewer scans per day. This volume type is less commonly used and there are better architectures using a mix of Amazon S3 and Glacier.</p><p>This was a brief overview of block storage options in the cloud. You can always learn more by visiting the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html">EBS documentation</a> or watching this <a href="https://www.youtube.com/watch?v=BuJa6Vl8cn8">EBS deep dive</a>. Thanks for reading.</p><p><a href="https://www.theother.ai/architecting-on-aws-bootcamp"><strong>If you would like to learn more about the cloud, sign up for our FREE Architecting on AWS Bootcamp!</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7595be010d8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Cloud Workflows with AWS Step Functions Part II]]></title>
            <link>https://medium.com/@theotherai/building-cloud-workflows-with-aws-step-functions-part-ii-c692bd6f8344?source=rss-f6ec838bbca0------2</link>
            <guid isPermaLink="false">https://medium.com/p/c692bd6f8344</guid>
            <category><![CDATA[aws-step-functions]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Alex@TheOther.AI]]></dc:creator>
            <pubDate>Mon, 07 Oct 2019 00:35:14 GMT</pubDate>
            <atom:updated>2019-10-07T00:35:14.340Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lQp9Hw2Lag5pPs_XoxrY4g.jpeg" /></figure><p>Posts in this Series</p><p><a href="https://medium.com/@theotherai/building-cloud-workflows-with-aws-step-functions-part-i-6c965434da0b">Part I</a></p><p>Part II (This post)</p><p>Part III (TBD)</p><p>This post is part II of a blog series. Be sure to read <a href="https://medium.com/@theotherai/building-cloud-workflows-with-aws-step-functions-part-i-6c965434da0b">PartI</a> before reading this.</p><p>In the previous post, I laid out the foundation of designing cloud workflows using AWS Step Functions. We covered some of the concepts, benefits, and use cases of using Step Functions. In this post, we take it one step further by helping you understand how to design cloud workflows. To form a better understanding, let’s start with a concrete use case. We’ll use a machine learning use case. Machine learning is a good use case because there are multiple steps within a machine learning job and is easily distributed across multiple components. The goal of this article is not to learn machine learning, but how to design cloud workflows. Therefore, we will not touch on the ins and outs of machine learning.</p><p>The first step in designing cloud workflows is to diagram the process as a series of simple blocks. There are several steps within the machine learning process, and most practitioners typically follow some variation of <a href="https://en.wikipedia.org/wiki/Cross-industry_standard_process_for_data_mining">CRISP-DM</a>. Our process will be as follows:</p><ul><li>Get the data (GetData) — this step is getting the data from its source. In a typical company, this data is stored in a company’s data lake. In our use case, we will store this data in Amazon S3.</li><li>Perform exploratory data analysis (EDA): This typically is something the data scientist perform to get a better understanding of the data using summary statistics and visualization techniques. For our use case, we’ll generate images and save them for later.</li><li>Data preparation (DataPrep) — data preparation is about getting the data in a format that machine learning algorithms can use. Basically, this means converting the data into numerical form.</li><li>Train model (TrainModel) — during this step, the algorithm learns patterns within the data, thus creating a model.</li><li>Persist model and analysis into storage (PersistModel) — during this step, we store the model and earlier analysis into storage, where it’s downloaded later.</li></ul><p>So modeling this as a block diagram, we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aypuB2LYgbiHpgO1iWMFjw.png" /></figure><p>When creating the block diagram, I typically use pen and paper or a whiteboard if I’m in the office.</p><p>The first thing I like to do after creating the basic block diagram is to think about how the state machine will be started. This happens on a schedule, based on a specific event, or on-demand using Lambda. For this post, we will start the state machine by uploading a job specification file into S3. This is essentially triggering the state machine based on a specific event.</p><p>So, the first input we want for this state machine is a job spec. Let’s define that now.</p><pre>{<br>    &quot;DataSource&quot;: &quot;url to get data&quot;, <br>    &quot;StorageBucket&quot;: &quot;bucket to store the sata&quot;, <br>    &quot;StoragePrefix&quot;: &quot;prefix of the job data stored in S3&quot;, <br>    &quot;Notification&quot;: &quot;SNS topic to send notifications to&quot;<br>}</pre><p>Our job spec is pretty simple. It contains the following information:</p><ul><li>DataSource: this is where we will retrieve the data for our job.</li><li>StorageBucket: This is Amazon S3 bucket where we store our data and outputs from our job.</li><li>StoragePrefix: is an arbitrary, self-defined prefix we will use when storing data in our S3 bucket.</li><li>Notification: this is the SNS topic we will use to send email or text messages for the job</li></ul><p>Now that we have the event that will trigger the state machine, how do we want to deal with it? You can handle this as part of the GetData state, but I typically set these apart. I often add a JobPrep state that is used to parse the job spec file and setup any “accounting” needed for the rest of the state machine. Another reason I do this is over time, your workflow will change. I typically approach the JobPrep as the “front door” and allows me to change the backend while keeping the front door the same. Finally, I use this design as a way to keep my code clean and organized.</p><p>Therefore, our first state is the JobPrep state. It takes the job spec as input, performs processing, and then sends its output to StepFunctions. If we were to diagram it out, it would look like the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yv5IctPVp719QjMAmMSAWA.png" /></figure><p>The output is what you want your code to pass out to the next step. For this, I’ll have the state add a unique job ID. This enables us to keep track of all tasks under a single namespace, but also the ability to keep track of issues and data.</p><p>The next state, GetData, get’s its input from JobPrep’s output and uses the details to perform its task(s). What exactly will GetData do? Its tasks are to read the DataSource location, download the data, and store it within S3. After doing so, it will update the state with the location and name of the file downloaded and provide a status update to the state machine. This isn’t needed within the state machine. I do this as a mechanism to know if each state has completed its tasks. If it does, I pass a SUCCESS, and if it doesn’t, I’ll pass a FAILED. Depending on the use case, I would use other status messages as well, such as SCHEDULED, RUNNING, etc. The logic of my functions controls all of these status messages. What if my function fails, and I didn’t catch the exception? In these scenarios, Step Functions offers built-in error handlers. We’ll cover that in detail later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CnGB85olHWgP_XlcK7AStw.png" /></figure><p>The next few states (EDA, DataPrep, TrainModel, and PersistModel) will follow that same process, so, I won’t diagram each. Here’s the full block diagram here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VxSlJ6dn7bxkgqqBKv-xlg.png" /></figure><p>As you can see, the output from one step is the input to the next. For most of the states, I have the same data, but make certain additions (the bold, underlined items). This is not a requirement of Step Functions, but a practice that I have adopted. Since most of this data is used repetitively throughout the state machine, I elect to carry it over.</p><p>Earlier, we briefly mentioned dealing with errors in your workflow. The default behavior in Step Functions is to fail the execution entirely. In production scenarios, you want to handle them more gracefully, especially depending on the exception.</p><p>There are two types of errors you will face while using Step Functions. You will face errors in your functions, which are the typical errors you face when developing code in your language of choice. You will deal with those errors the same you do today. You’ll catch them and handle them accordingly.</p><p>The second type of error is those that I call macro errors. These are errors that you really can’t capture in your function. For example, if your Lambda function times out, you need a way to deal with that. Another example is if your task failed due to permissions. In that scenario, you can potentially move to a fallback state and wait for permission to be approved before moving forward. I advise looking over the Step Functions <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html">Error Handling docs</a> for more information.</p><p>The last part is for us to define this in JSON as a Step Functions State Machine. Here’s the state machine. Within each state, you see <em>“Resource”: “arn:aws:lambda:us-east-1:123456789012:function:HelloFunction”</em>. In the next post in this series, we’ll replace these with the functions that will perform all of the work.</p><pre>{<br>  &quot;Comment&quot;: &quot;A simple state machine showing an ML job&quot;,<br>  &quot;StartAt&quot;: &quot;JobPrep&quot;,<br>  &quot;States&quot;: {<br>    &quot;JobPrep&quot;: {<br>      &quot;Type&quot;: &quot;Task&quot;,<br>      &quot;Resource&quot;: &quot;arn:aws:lambda:us-east-1:123456789012:function:JobPrep&quot;,<br>      &quot;Next&quot;: &quot;GetData&quot;<br>    }, <br>    &quot;GetData&quot;: {<br>        &quot;Type&quot;: &quot;Task&quot;,<br>        &quot;Resource&quot;: &quot;arn:aws:lambda:us-east-1:123456789012:function:GetData&quot;,<br>        &quot;Next&quot;: &quot;EDA&quot;<br>    }, <br>    &quot;EDA&quot;: {<br>        &quot;Type&quot;: &quot;Task&quot;,<br>        &quot;Resource&quot;: &quot;arn:aws:lambda:us-east-1:123456789012:function:EDA&quot;,<br>        &quot;Next&quot;: &quot;DataPrep&quot;<br>    }, <br>    &quot;DataPrep&quot;: {<br>        &quot;Type&quot;: &quot;Task&quot;,<br>        &quot;Resource&quot;: &quot;arn:aws:lambda:us-east-1:123456789012:function:DataPrep&quot;,<br>        &quot;Next&quot;: &quot;TrainModel&quot;<br>    }, <br>    &quot;TrainModel&quot;: {<br>        &quot;Type&quot;: &quot;Task&quot;,<br>        &quot;Resource&quot;: &quot;arn:aws:lambda:us-east-1:123456789012:function:TrainModel&quot;,<br>        &quot;Next&quot;: &quot;PersistModel&quot;<br>    }, <br>    &quot;PersistModel&quot;: {<br>        &quot;Type&quot;: &quot;Task&quot;,<br>        &quot;Resource&quot;: &quot;arn:aws:lambda:us-east-1:123456789012:function:PersistModel&quot;,<br>        &quot;End&quot;: true <br>    }<br>  }<br>}</pre><p>After adding the state machine definition to Step Functions console, I’m presented with an auto-generated diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*3MY5CiduhCRRnXl5wwYGvQ.png" /></figure><p>To summarize, the process I use for designing my workflows are to:</p><ul><li>List out steps within the workflow</li><li>Create a sample block diagram of the steps</li><li>List the input and outputs for each block within the block diagram</li><li>Think of and list errors</li><li>Define the state machine in JSON</li></ul><p>In the next post, I will finally bring the learnings from this and the previous post into a fully functioning workflow. Stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c692bd6f8344" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Cloud Workflows with AWS Step Functions Part I]]></title>
            <link>https://medium.com/@theotherai/building-cloud-workflows-with-aws-step-functions-part-i-6c965434da0b?source=rss-f6ec838bbca0------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c965434da0b</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[aws-step-functions]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[workflow]]></category>
            <dc:creator><![CDATA[Alex@TheOther.AI]]></dc:creator>
            <pubDate>Tue, 03 Sep 2019 02:01:00 GMT</pubDate>
            <atom:updated>2019-10-07T00:38:00.337Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FSpbNxYLxmEeykvLOjRnQA.jpeg" /></figure><p>Post in this Series</p><p>Part I (This post)</p><p><a href="https://medium.com/@theotherai/building-cloud-workflows-with-aws-step-functions-part-ii-c692bd6f8344">Part II</a></p><p>Part III (TBD)</p><p>Coordinating individual components in a<a href="https://theother.ai/glossary/#distributed-architecture"> distributed architecture</a> can be a challenging feat. This is especially true when you are not clear on the overall model and interactions between those various components. There are several approaches you can use to coordinate multiple components, but many of these approaches can quickly become complicated and offer little value.</p><p>That’s where AWS Step Functions come in. Step Functions is a service that lets you coordinate multiple AWS services or distributed components of your architecture into a serverless workflow. This allows you to quickly build and update apps that are fault-tolerant in the cloud. Step Functions enables you to stitch together multiple components into a single application, allowing you to build really powerful cloud applications.</p><p>This post is the first part of a three-part blog post series. In the first blog, I will explain what AWS Step Functions are, why it’s important, and provide a high-level overview of concepts. In the second post, I will walk you through the process of designing Step Functions workflows and help you understand how to think of building applications with Step Functions. In the third and final post, I will walk you through a step-by-step implementation of a simple Step Functions workflow.</p><p>The ultimate goal of this series is that you learn the concepts of AWS Step Functions and the benefits of developing with Step Functions. Furthermore, we want you to learn how to design a workflow in Step Functions as well as show you how to implement the designed workflow.</p><p>Before we dive in, let me provide you a brief history of Step Functions. Step Functions was first introduced as a way to orchestrate<a href="https://aws.amazon.com/lambda/"> AWS Lambda Functions</a> but was quickly used for use cases outside of Lambda due to its flexibility. Before the introduction of Step Functions, If you had multiple functions that were part of a broader “application,” it was difficult to orchestrate. You would have to write code in each function to call subsequent functions. For example, if you had three functions, function one would call function two, function two would call function three, and so on. If the second function failed for whatever reason, function three would never be triggered. This made it challenging to manage the overall process. That’s where the introduction of Step Functions come into play. Step Functions is responsible for orchestrating and triggering each Lambda Function in this process.</p><p>The workflow in Step Functions is known as a state machine. Each state machine within Step Functions is made up of a series of steps, with the output of one step being the input into the next step. Individual states within the state machine make decisions based on their inputs, perform some action, and pass the output to other states. Step Functions support several types of states defined as part of <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a>. The available states are:</p><ul><li><strong>Task: </strong>perform some action within the state machine</li><li><strong>Choice: </strong>makes a choice between branches of execution</li><li><strong>Fail or Succeed: </strong>stops execution with either failure or success</li><li><strong>Pass: </strong>passes input to its output. This is used typically for testing</li><li><strong>Wait: </strong>delay the state machine for an amount of time or until a specified time in the future</li><li><strong>Parallel: </strong>perform parallel branches of execution simultaneously</li></ul><p>While this seems like a small number of states, you can build compelling solutions with these states.</p><p>To get a better understanding of Step Functions, let’s start by going through an example. In our case, we are going to use an E-Commerce checkout process. In this process, multiple components perform different actions in the workflow.</p><p>The general checkout flow starts after a user has added items to their shopping cart and clicks the checkout button. This event kicks off the process. The first step in the process is to confirm the item by checking with the inventory system. Once the product is confirmed, the next step in the process is to check the users’ information, charge the user, and then send out emails confirming the order. Here is a simple diagram of the process:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*SGnba_-uL18ACVVhF-zcdA.png" /></figure><p>In Step Functions, the workflow is modeled as a state machine like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/0*3wDueo2O5k5qSbsu" /></figure><p>Visually, the Step Functions is not that different from the workflow diagram. That’s because it isn’t. Each state is a task state that executes the code of the specific component in the overall architecture. When the state machine starts, it will first trigger <strong>ConfirmItem</strong> state passing in the data provided at the start of the state machine. ConfirmItem is a Lambda function that will execute and return its output. Step Functions will take that output and pass it into the next stat, the <strong>CheckUserInfo</strong> state. This process will continue until the state machine is complete.</p><p>The main benefit of using Step Functions over glue code is that it simplifies the entire process. With glue code, you are responsible for dealing with retry logic, errors in the workflow, logging each of the individual steps, and building a fault-tolerant service. Step Functions relieve you from having to write “glue” code to integrate all of the components. AWS Step Functions handles that for you.</p><p>That’s pretty much it for the concepts. To wrap up, AWS Step Functions allows you to build serverless workflows by orchestrating distributed components. It reduces the complexity in building cloud-based workflows by reducing the need for glue code and providing fault tolerance for your serverless applications. In this post, we provided an overview of Step Functions and covered some of the general concepts of Step Functions. We also reviewed an example of a workflow in Step Functions. In Part II of our blog post series, we are going to go through the design process for creating a state machine in Step Functions. This will give you a deeper understanding of Step Functions and help you design your own. If you have any comments or feedback, please feel free to share.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c965434da0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>