<?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 Selvakumar Palanisamy on Medium]]></title>
        <description><![CDATA[Stories by Selvakumar Palanisamy on Medium]]></description>
        <link>https://medium.com/@selvakumarpalanisamy?source=rss-b19250882919------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JQ2kV7zpssh4t2lQRZ6SgA.jpeg</url>
            <title>Stories by Selvakumar Palanisamy on Medium</title>
            <link>https://medium.com/@selvakumarpalanisamy?source=rss-b19250882919------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 09:27:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@selvakumarpalanisamy/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[Competitor Analysis Tool with LangChain and Google Places, LangGraph]]></title>
            <link>https://selvakumarpalanisamy.medium.com/competitor-analysis-tool-with-langchain-and-google-places-langgraph-e496794b32a0?source=rss-b19250882919------2</link>
            <guid isPermaLink="false">https://medium.com/p/e496794b32a0</guid>
            <dc:creator><![CDATA[Selvakumar Palanisamy]]></dc:creator>
            <pubDate>Mon, 19 May 2025 06:49:10 GMT</pubDate>
            <atom:updated>2025-05-19T06:52:32.626Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s discuss about building a simple yet powerful tool using Python, LangChain, and the Google Places API to automate the process of gathering competitor information and generating valuable analysis reports.</p><p>LangChain is a modular framework for building applications powered by large language models (LLMs), offering flexibility and composability through components like chains, agents, and memory.</p><p>LangGraph, on the other hand, is a low-level, graph-based orchestration framework that extends LangChain, enabling the creation of complex, stateful, multi-agent workflows.</p><p><strong>Unlocking Local Market Insights:</strong></p><p>In today’s competitive landscape, understanding your local competitors is crucial for strategic decision-making. Whether you’re launching a new business, expanding an existing one, or simply trying to stay ahead, having detailed insights into nearby players can make a significant difference.</p><ul><li>Collect user input for location, search radius, and store type.</li><li>Utilize the Google Places API to discover relevant businesses.</li><li>Structure and format the collected data for analysis.</li><li>Leverage a Large Language Model (LLM) via LangChain to generate strategic insights.</li><li>Orchestrate the entire process using langgraph for a clear, state-based workflow.</li></ul><p><strong>Setting the Stage: Imports and Dependencies</strong></p><p>First, we need to import the necessary libraries. We’ll be using requests for API calls, langchain-openai for LLM interaction, and langgraph to define our workflow. We’ll also need getpass for securely handling API keys.</p><pre>from IPython import get_ipython<br>from IPython.display import display, Markdown<br>import os<br>import requests<br>import langgraph<br>from langgraph.graph import StateGraph, END<br>from langgraph.prebuilt import ToolNode # Although not used as a ToolNode explicitly, useful concept<br>from langchain.agents import tool # Relevant to LangChain tooling<br>from langchain_openai import ChatOpenAI<br>from langchain.tools import Tool # Relevant to LangChain tooling<br>from typing import TypedDict, Annotated, Sequence<br>import operator<br>from langchain_core.messages import SystemMessage, HumanMessage</pre><p>You’ll need to install these libraries if you haven’t already:</p><pre>pip install langgraph langchain-openai requests</pre><p><strong>Defining the Workflow State: </strong>GraphState</p><p>Our workflow will maintain a state that holds the information being processed at each step. We define this state using TypedDict for clarity and type hinting.</p><pre>class GraphState(TypedDict):<br>    &quot;&quot;&quot;<br>    Represents the state of our graph.<br>Attributes:<br>        location: The location provided by the user.<br>        radius_km: The search radius in kilometers.<br>        store_type: The type of store to search for.<br>        competitors: A list of competitor information.<br>        prompt: The formatted prompt for the LLM.<br>        report: The generated competitor analysis report.<br>    &quot;&quot;&quot;<br>    location: str<br>    radius_km: str<br>    store_type: str<br>    competitors: Annotated[list, operator.add]<br>    prompt: str<br>    report: str</pre><p>The competitors field uses Annotated[list, operator.add] to indicate that when this field is updated by a node, the new list of competitors should be added to the existing list in the state.</p><p><strong>Building the Workflow Nodes</strong></p><p>Each step in our competitor analysis process will be represented by a node in our langgraph workflow.</p><p><strong>1. Collecting User Information</strong></p><p>This initial node will prompt the user for the key details needed for the analysis: the location, the search radius, and the type of store to investigate.</p><pre>def collect_user_info(state: GraphState) -&gt; GraphState:<br>    &quot;&quot;&quot;Collects user input for location, radius, and store type.&quot;&quot;&quot;<br>    location = input(&quot;Enter location: Werribee, Melbourne &quot;)<br>    radius_km = input(&quot;Enter search radius in kilometers: 1 &quot;)<br>    store_type = input(&quot;Enter store type: Clothing Store&quot;)<br>    return {<br>        &quot;location&quot;: location,<br>        &quot;radius_km&quot;: radius_km,<br>        &quot;store_type&quot;: store_type<br>    }</pre><p><strong>2. Searching for Competitors with Google Places API</strong></p><p>This node takes the user’s input and uses the Google Places Text Search API to find businesses that match the criteria within the specified radius.</p><pre>def search_competitors(state: GraphState) -&gt; GraphState:<br>    &quot;&quot;&quot;Find nearby competitors using Google Places API.&quot;&quot;&quot;<br>    location = state.get(&quot;location&quot;)<br>    radius_km = state.get(&quot;radius_km&quot;)<br>    store_type = state.get(&quot;store_type&quot;)<br>if not all([location, radius_km, store_type]):<br>        raise ValueError(&quot;Missing required input for search_competitors&quot;)<br>    # Get your Google API Key (consider using environment variables for security)<br>    try:<br>        GOOGLE_API_KEY = os.environ[&#39;GOOGLE_API_KEY&#39;]<br>    except KeyError:<br>        GOOGLE_API_KEY = getpass(&#39;Enter Google API Key: &#39;)<br>    endpoint = &quot;https://maps.googleapis.com/maps/api/place/textsearch/json&quot;<br>    params = {<br>        &quot;query&quot;: f&quot;{store_type} near {location}&quot;,<br>        &quot;radius&quot;: int(float(radius_km) * 1000), # API uses meters<br>        &quot;key&quot;: GOOGLE_API_KEY<br>    }<br>    r = requests.get(endpoint, params=params)<br>    r.raise_for_status() # Raise an exception for bad status codes<br>    return {&quot;competitors&quot;: r.json().get(&quot;results&quot;, [])}</pre><p>Remember to replace “YOUR_GOOGLE_API_KEY” with your actual API key. It’s highly recommended to use environment variables for production applications.</p><p><strong>3. Formatting the Prompt for the LLM</strong></p><p>The data retrieved from the Google Places API needs to be structured in a way that the LLM can easily understand and analyze. This node creates a clear and concise prompt.</p><pre>def format_prompt(state: GraphState) -&gt; GraphState:<br>    &quot;&quot;&quot;Build analysis prompt for LLM based on competitor data.&quot;&quot;&quot;<br>    location = state.get(&quot;location&quot;)<br>    competitors = state.get(&quot;competitors&quot;, [])<br>if not location or not competitors:<br>         return {&quot;prompt&quot;: &quot;Could not generate a detailed report due to missing competitor data.&quot;}<br>    summary = &quot;\n&quot;.join([<br>        f&quot;{c.get(&#39;name&#39;,&#39;N/A&#39;)} - {c.get(&#39;formatted_address&#39;,&#39;N/A&#39;)} | Rating: {c.get(&#39;rating&#39;,&#39;N/A&#39;)}&quot;<br>        for c in competitors<br>    ])<br>    prompt_text = (<br>        f&quot;You are an expert retail strategist. Analyze the following clothing stores in {location}:\n\n&quot;<br>        f&quot;{summary}\n\n&quot;<br>        &quot;Provide:\n&quot;<br>        &quot;- Estimated peak footfall hours\n&quot;<br>        &quot;- Competitive positioning strategy\n&quot;<br>        &quot;- Opportunities for new or existing stores&quot;<br>    )<br>    return {&quot;prompt&quot;: prompt_text}</pre><p><strong>4. Generating the Analysis Report with an LLM</strong></p><p>The final node uses the formatted prompt and sends it to an LLM (in this case, via LangChain’s ChatOpenAI) to generate the competitor analysis report.</p><pre>def generate_report(state: GraphState) -&gt; GraphState:<br>    &quot;&quot;&quot;Generate strategic insights using the LLM.&quot;&quot;&quot;<br>    prompt = state.get(&quot;prompt&quot;)<br>if not prompt:<br>        return {&quot;report&quot;: &quot;No prompt available to generate report.&quot;}<br>    # Get your OpenAI API Key (consider using environment variables)<br>    try:<br>        OPENAI_API_KEY = os.environ[&#39;OPENAI_API_KEY&#39;]<br>    except KeyError:<br>         OPENAI_API_KEY = getpass(&#39;Enter Open AI API Key: &#39;)<br>    llm = ChatOpenAI(model_name=&quot;gpt-4&quot;, temperature=0.7, openai_api_key=OPENAI_API_KEY)<br>    messages = [<br>        SystemMessage(content=&quot;You are a helpful business analyst.&quot;),<br>        HumanMessage(content=prompt)<br>    ]<br>    resp = llm.generate([messages])<br>    return {&quot;report&quot;: resp.generations[0][0].text.strip()}</pre><p><strong>Orchestrating with </strong>langGraph</p><p>Now that we have our individual nodes, we use langgraph to define the flow of execution.</p><pre>builder = StateGraph(GraphState)<br>builder.add_node(&quot;collect_user_info&quot;, collect_user_info)<br>builder.add_node(&quot;search_competitors&quot;, search_competitors)<br>builder.add_prompt_node(&quot;format_prompt&quot;, format_prompt) <br>builder.add_node(&quot;generate_report&quot;, generate_report)<br><br>builder.set_entry_point(&quot;collect_user_info&quot;)<br>builder.set_finish_point(&quot;generate_report&quot;)<br>builder.add_edge(&quot;collect_user_info&quot;, &quot;search_competitors&quot;)<br>builder.add_edge(&quot;search_competitors&quot;, &quot;format_prompt&quot;)<br>builder.add_edge(&quot;format_prompt&quot;, &quot;generate_report&quot;)<br>graph = builder.compile()</pre><p><strong>Running the Workflow and Displaying the Report</strong></p><p>Finally, we invoke the compiled graph to start the process and then display the generated report.</p><p>collect info -&gt; search competitors -&gt; format prompt -&gt; generate report.</p><pre>inputs = {} # Initial state, will be populated by collect_user_info<br>state = graph.invoke(inputs)<br>report = state.get(&quot;report&quot;) if isinstance(state, dict) else None<br>if report:<br>    display(Markdown(&quot;# 📊 Competitor Insights Report&quot;))<br>    display(Markdown(report))<br>else:<br>    print(&quot;No report generated. Check inputs or API keys.&quot;)</pre><p>This approach allows you to build sophisticated data processing and analysis pipelines with clear, modular steps. You can extend this tool further by adding more data sources, refining the LLM prompt for different types of analysis, or integrating the output with visualization tools. By leveraging these technologies, you can gain deeper insights into your local market and make more informed business decisions.</p><p>Refer the below repo for more details</p><p><a href="https://github.com/selvakumarsai/competitor_analysis">GitHub - selvakumarsai/competitor_analysis</a></p><p>Stremlit app</p><p><a href="https://competitoranalysis-selvapalpoc.streamlit.app/">Competitor Insights</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e496794b32a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google’s Agent Development Kit (ADK)]]></title>
            <link>https://selvakumarpalanisamy.medium.com/googles-agent-development-kit-adk-51e4197ac18d?source=rss-b19250882919------2</link>
            <guid isPermaLink="false">https://medium.com/p/51e4197ac18d</guid>
            <dc:creator><![CDATA[Selvakumar Palanisamy]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 13:08:45 GMT</pubDate>
            <atom:updated>2025-04-14T13:19:51.656Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*9U0uq8ja5IuA02KldD-LwA.png" /><figcaption>ADK</figcaption></figure><p>Building, testing, and deploying complex AI agents is made easier with Google’s Agent Development Kit (ADK), an open-source Python library.It enables programmers to abstract away a lot of typical problems.</p><p>1. Modular Architecture: Use independent, reusable components to create applications.<br>2. Parse user input by using the integrated language processing.<br>3. Extensive testing tools</p><h3><strong>1. Quick Start </strong>:</h3><p>I’ll walk you through ADK’s fundamentals and show you how to use this powerful new feature in this post.</p><p>ADK offers a comprehensive platform for individuals seeking more than simple agents. It enables you to build both conversational and non-conversational agents, giving them the ability to plan activities and carry out complex flows — all while being supported by a thoughtful, scalable, and integrated structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fRw2zRFE_GpgytGOsBz1vQ.png" /></figure><p>Install ADK and add agent</p><pre><br><br>google-adk % python3 -m venv path/to/venv     <br><br>google-adk % source path/to/venv/bin/activate<br><br>google-adk % python3 -m pip install google-adk<br><br>google-adk % mkdir multi_tool_agent<br><br>google-adk % cd multi_tool_agent<br></pre><pre>(venv) multi_tool_agent % touch agent.py<br>(venv) multi_tool_agent % vi agent.py           -- agent code<br><br>import datetime<br>from zoneinfo import ZoneInfo<br>from google.adk.agents import Agent<br><br>def get_weather(city: str) -&gt; dict:<br>    &quot;&quot;&quot;Retrieves the current weather report for a specified city.<br><br>    Args:<br>        city (str): The name of the city for which to retrieve the weather report.<br><br>    Returns:<br>        dict: status and result or error msg.<br>    &quot;&quot;&quot;<br>    if city.lower() == &quot;melbourne&quot;:<br>        return {<br>            &quot;status&quot;: &quot;success&quot;,<br>            &quot;report&quot;: (<br>                &quot;The weather in Melbourne  is sunny with a temperature of 25 degrees&quot;<br>                &quot; Celsius (41 degrees Fahrenheit).&quot;<br>            ),<br>        }<br>    else:<br>        return {<br>            &quot;status&quot;: &quot;error&quot;,<br>            &quot;error_message&quot;: f&quot;Weather information for &#39;{city}&#39; is not available.&quot;,<br>        }<br><br><br>def get_current_time(city: str) -&gt; dict:<br>    &quot;&quot;&quot;Returns the current time in a specified city.<br><br>    Args:<br>        city (str): The name of the city for which to retrieve the current time.<br><br>    Returns:<br>        dict: status and result or error msg.<br>    &quot;&quot;&quot;<br><br>    if city.lower() == &quot;melbourne&quot;:<br>        tz_identifier = &quot;Australia/Melbourne&quot;<br>    else:<br>        return {<br>            &quot;status&quot;: &quot;error&quot;,<br>            &quot;error_message&quot;: (<br>                f&quot;Sorry, I don&#39;t have timezone information for {city}.&quot;<br>            ),<br>        }<br><br>    tz = ZoneInfo(tz_identifier)<br>    now = datetime.datetime.now(tz)<br>    report = (<br>        f&#39;The current time in {city} is {now.strftime(&quot;%Y-%m-%d %H:%M:%S %Z%z&quot;)}&#39;<br>    )<br>    return {&quot;status&quot;: &quot;success&quot;, &quot;report&quot;: report}<br><br><br>root_agent = Agent(<br>    name=&quot;weather_time_agent&quot;,<br>    model=&quot;gemini-2.0-flash-exp&quot;,<br>    description=(<br>        &quot;Agent to answer questions about the time and weather in a city.&quot;<br>    ),<br>    instruction=(<br>        &quot;You are a helpful agent who can answer user questions about the time and weather in a city.&quot;<br>    ),<br>    tools=[get_weather, get_current_time],<br>)</pre><pre><br>(venv) multi_tool_agent % echo &quot;from . import agent&quot; &gt; __init__.py <br><br>(venv) multi_tool_agent % more .env<br># If using Gemini via Google AI Studio<br>GOOGLE_GENAI_USE_VERTEXAI=&quot;False&quot;<br>GOOGLE_API_KEY=&quot;paste-your-actual-key-here&quot;</pre><p>Run ADK</p><pre>adk web</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l3oQl-CMrOFSGvVWVsui6g.png" /></figure><p>refer the quick start repo <a href="https://github.com/selvakumarsai/googleadk-qstart">https://github.com/selvakumarsai/googleadk-qstart</a></p><h3><strong>2. Project Referred from google community blog</strong></h3><p>A simple try with two agents working together allowed me to test ADK. One is the “conversation agent” which handles user questions and conversation continuity. Before answering, it asks the second agent, the “researcher,” to execute a Google search and provide new information for the final answer.</p><p>Agents work together to provide a more useful response based on current information. This simple example shows how ADK may organise more complex tasks between specialised agents.</p><p>The project contains everything in well-defined directories, as specified by ADK:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hbj4qOpG0BkPhpn7WCjl5Q.png" /></figure><p>Creating an Agent with the ADK</p><p>ADK agent creation is surprising straightforward. You name the model, create a clear prompt, and connect its tools. I did that when constructing the researcher, the web-searching agent.</p><p>The simple but effective agent gets a request, utilises Google to search, then summarises the results. It gives the primary agent this content, which decides how to use it in the final answer.</p><h3>researcher agent:</h3><pre>(venv) researcher % more agent.py<br>from google.adk.agents import Agent<br>from . import prompt<br>from ...shared_libraries import constants<br>from ...tools.search import google_search_grounding<br><br>researcher = Agent(<br>    model=constants.BASE_MODEL,<br>    name=&quot;researcher&quot;,<br>    description=&quot;Search a topic on google.&quot;,<br>    instruction=prompt.RESEARCHER_PROMPT,<br>    tools=[google_search_grounding]<br>)</pre><p>Prompt that guides agent</p><pre>researcher % more prompt.py<br>RESEARCHER_PROMPT=&quot;&quot;&quot;<br>You are an agent with the autonomy to do research on the web.<br>Search the requested topics on the web.<br><br>Follow the steps:<br>1. Call the `google_search_grounding` tool and search on the topic<br>2. Gather the information in a draft<br>3. Summarize the draft and transfer it to `dev_tutor`<br>&quot;&quot;&quot;</pre><p>Magic starts with this prompt. The agent is instructed on how to utilise the search tool, handle the results, and create the response.</p><h3>Connecting Tools</h3><p>Tooling — any external action an agent can call during execution — is another amazing feature of ADK. Coolest thing? Such tools may include functions, APIs, or other agents.</p><p>I created google_search_grounding, an encapsulated agent that searches Google for answers.</p><pre>(venv) tools % more search.py<br>from google.adk.agents import Agent<br>from google.adk.tools.agent_tool import AgentTool<br>from google.adk.tools.google_search_tool import google_search<br>from ..shared_libraries import constants<br><br>_researcher = Agent(<br>    model=constants.BASE_MODEL,<br>    name=&quot;researcher&quot;,<br>    description=&quot;web research on a given topic.&quot;,<br>    instruction=&quot;&quot;&quot;<br>    Answer the user&#39;s question directly using Google&#39;s search engine; provide a brief but concise answer.<br>    Instead of a detailed answer, provide the developer with an immediate action item in a single sentence.<br>    Don&#39;t ask the user to verify or look up information on their own; that&#39;s your job; do your best to be informative.<br>    &quot;&quot;&quot;,<br>    tools=[google_search]<br>)<br><br>google_search_grounding = AgentTool(agent=_researcher)</pre><p>A mini-agent named _researcher uses the ADK’s google_search_tool to offer a basic and useful answer. Packing this mini-agent with AgentTool makes it usable by other agents, like our main researcher.</p><h3>The Main Agent</h3><p>After creating sub-agents and tools, I created my main agent, development_tutor. The operation’s brain speaks directly to the user, guides reasoning, and chooses whether to call a sub-agent for support.</p><pre>(venv) adk % more agent.py<br>from google.adk.agents.llm_agent import Agent<br><br>from .shared_libraries import constants<br>from . import prompt<br>from .sub_agents.researcher.agent import researcher <br><br>root_agent = Agent(<br>    model=constants.TUTOR_MODEL,<br>    name=constants.AGENT_NAME,<br>    description=constants.DESCRIPTION,<br>    instruction=prompt.ROOT_PROMPT,<br>    sub_agents=[<br>        researcher<br>    ]<br>)</pre><p>pecific prompts shape the agent’s behaviour during the interaction. Check it:</p><pre>(venv) adk % more prompt.py<br>ROOT_PROMPT=&quot;&quot;&quot;<br>You are essentially an instructor. Your focus is on programming languages ​​and development.<br>You will help developers develop their solutions and answer questions, mainly about API documentation, frameworks, packages and the like.<br>Your teaching method consists of an iterative teaching process, where you will help with step-by-step instructions and cooperation between developer and instructor.<br><br>Follow the steps below:<br>1. Please follow the &lt;Greetings&gt; section to greet the user and gather information and continue in the flow.<br>2. Go to the &lt;Search&gt; section to ensure that your answers are up to date, don&#39;t stop. Keep in the flow.<br>3. Go to the &lt;Tone&gt; section and continue in the flow.<br>4. Please follow the &lt;Key Constraints&gt; when trying to answer the user&#39;s query.<br>3. At the end, always ask if the user is satisfied with the answers.<br><br>&lt;Greetings&gt;<br>1. Introduce yourself to the user in a joking manner, saying that your name is that of a character from geek culture, randomly changing the character&#39;s name every time.<br>&lt;Example&gt;<br>Hello, my name is [character-name]... Guru! I don&#39;t have a name lol, but you can call me Dev. How can I help you?<br>&lt;/Example&gt;<br>2. Ask how you can help the user. &lt;/Greetings&gt;<br><br>&lt;Search&gt;<br>1. Call `researcher` to help you research the latest information on the topic<br>2. Rephrase your answer first and continue with the flow<br>&lt;/Search&gt;<br><br>&lt;Tone&gt;<br>1. Adjust your tone of voice to a more technical tone<br>2. Use examples to answer the questions<br>3. Be friendly and jovial (you can use slang if you prefer).<br>&lt;\Tone&gt;<br><br>&lt;Key Constraints&gt;<br>- Your task is to provide a problem-solving answer.<br>- Complete all steps<br>- Answer in English <br>&lt;/Key Constraints&gt;<br>&quot;&quot;&quot;</pre><p>How development_tutor thinks:</p><p><strong>&lt;Greetings&gt;:</strong> He always starts the conversation with good humor</p><p><strong>&lt;Search&gt;:</strong> Before answering anything, he calls the researcher sub-agent to search for updated information on Google.</p><p><strong>&lt;Tone&gt;:</strong> Here he adjusts the style. The language is technical, but accessible — with examples, didactic explanations and even some slang, if it fits the context.</p><p><strong>&lt;Key Constraints&gt;:</strong> Finally, some basic rules that ensure that everything is done in English, with a focus on solving problems clearly and completely.</p><p>Do not forget: .env in the right place</p><p>If you’re going to use the ADK with Google’s Gemini, either via Google AI Studio or Vertex AI, you’ll need a .env file with your settings</p><pre># If using Gemini via Google AI Studio<br>GOOGLE_GENAI_USE_VERTEXAI=&quot;False&quot;<br>GOOGLE_API_KEY=&quot;paste-your-actual-key-here&quot;</pre><p>Running the Agent</p><p>ADK provides a modern, FastAPI-powered web UI. Run it:</p><pre>adk web</pre><pre>gadk % adk web<br><br>INFO:     Started server process [68852]<br>INFO:     Waiting for application startup.<br>+-----------------------------------------------------------------------------+<br>| ADK Web Server started                                                      |<br>|                                                                             |<br>| For local testing, access at http://localhost:8000.                         |<br>+-----------------------------------------------------------------------------+<br><br>INFO:     Application startup complete.<br>INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)</pre><p>interface at <a href="http://localhost:8000,">http://localhost:8000,</a> intended for visual agent testing. Send questions, follow answers, and see the flow go realtime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OrP1KMe4w1DNLMkYT80ilQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1j0seLT9DiSV6BnlXhmfew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0c26Mo-011ekPxMAV2Kb4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GIlYLsmbqYdVFDrzGw1H2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KSs0b0QCebyNiosyiW7bYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7fyhMH0gpxK_K17znkH7-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mX7BSnlTmK6Eidzq9QWPdg.png" /></figure><p>Refer the repo <a href="https://github.com/selvakumarsai/google-adk">https://github.com/selvakumarsai/google-adk</a></p><p>Despite being a straightforward project, I hope you will understand how ADK works.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51e4197ac18d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MCP — Azure CLI integration]]></title>
            <link>https://selvakumarpalanisamy.medium.com/mcp-azure-cli-integration-30b894476650?source=rss-b19250882919------2</link>
            <guid isPermaLink="false">https://medium.com/p/30b894476650</guid>
            <dc:creator><![CDATA[Selvakumar Palanisamy]]></dc:creator>
            <pubDate>Sun, 06 Apr 2025 06:53:34 GMT</pubDate>
            <atom:updated>2025-04-06T07:33:43.685Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*rYZajjWioRwrKBbrcJOHww.jpeg" /></figure><h3>MCP — Azure CLI integration</h3><p>You’ve probably heard of Model Context Protocol (MCP), which has recently attracted a lot of attention from the AI community.</p><p>We will discuss what MCP is and why it is important in this post.</p><p>Think of MCP as “USB-C for AI integrations,” an open standard that enables consistent connections between AI models and a wide range of applications and data sources. Simply put, MCP eliminates the need for separate adapters or unique code for each software application by allowing an AI assistant to communicate with them all using a standard language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UcgLH6GWj-Ffo_UCWNMIiw.png" /></figure><p>MCP functions similarly to providing your AI assistant with a universal remote control for all of your electronic gadgets and services.</p><p>Using an AI assistant with external tools without MCP is similar to having a number of appliances, each with its own plug and no universal outlet. Everywhere, developers had to contend with disjointed integrations. Your AI IDE may, for instance, employ one technique to pull code from GitHub, another to retrieve information from a database, and a third to automate a design tool; each of these integrations requires a unique adapter. This is not only time-consuming, but it is also fragile and non-scalable.</p><p>MCP is based on a client-server architecture, which allows a host programme to communicate with several servers.</p><p>Three main parts form the framework of the protocol:</p><ol><li>Host</li></ol><p>2. Client</p><p>3. Server</p><p>Before we get into detail on each, here is a high-level summary.</p><p>MCP Server : The server functions as an internal translator for the app; it may interpret a natural language request (from an AI) and carry out the corresponding action within the app.</p><p>The functionality (or “services”) of the application is made uniformly available by an MCP server.</p><p>These adapters are small and lightweight and work with a particular programme or service. The functionality of such programme (its “services”) is made readily accessible via an MCP server.</p><p><strong>Tool Discovery:</strong> They can describe what actions/capabilities the application offers</p><p><strong>Command parsing:</strong> They convert incoming AI instructions into exact API calls or application commands.</p><p><strong>Response formatting:</strong> Involves taking the data, confirmation messages, and other output from the app and formatting it so the AI model can interpret it. Typically, this is done as text or structured data.</p><p><strong>Error Handling :</strong> Handle exceptions and erroneous requests and provide helpful error messages.</p><p><strong>MCP client: </strong>AI assistant includes an MCP client component. This client maintains a 1:1 connection to an MCP server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SHkLIyHRbbZRdcEXRjuZNA.png" /></figure><p>I have played with Azure CLI MCP Server ,MCP Server that wraps the Azure CLI, adds a nice prompt to improve how it works, and exposes it.</p><p>It has access to the full Azure CLI, so it can do anything the Azure CLI can do. This MCP server currently only works with the stdio transport, so it should run locally on your machine, using your Azure CLI credentials.</p><p><em>This server can run as a Java application or inside a Docker container.</em></p><p><strong>Install MCP Claude desktop</strong></p><p><a href="https://claude.ai/download">https://claude.ai/download</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXFxaK8Dh1NPilZtxAHLOw.png" /></figure><p><strong>Install and configure the server with Java</strong></p><ol><li>Install the Azure CLI: you can do this by following the instructions <a href="https://learn.microsoft.com/en-us/cli/azure/install-azure-cli">here</a>.</li></ol><p>Authenticate to your Azure account. You can do this by running az login in your terminal.</p><p>Make sure you have Java 17 or higher installed</p><p>2. Download azure-cli-mcp</p><p><a href="https://github.com/jdubois/azure-cli-mcp/releases">https://github.com/jdubois/azure-cli-mcp/releases</a></p><p>Download the latest release: gh release download — repo jdubois/azure-cli-mcp — pattern=’azure-cli-mcp.jar’</p><pre>gh release download --repo jdubois/azure-cli-mcp --pattern=&#39;azure-cli-mcp.jar&#39;</pre><pre>% gh release download --repo jdubois/azure-cli-mcp --pattern=&#39;azure-cli-mcp.jar&#39;<br>To get started with GitHub CLI, please run:  gh auth login<br>Alternatively, populate the GH_TOKEN environment variable with a GitHub API authentication token.<br><br> % gh auth login<br>? Where do you use GitHub? GitHub.com<br>? What is your preferred protocol for Git operations on this host? HTTPS<br>? Authenticate Git with your GitHub credentials? Yes<br>? How would you like to authenticate GitHub CLI? Login with a web browser<br><br>! First copy your one-time code: xxxxxxxx<br>Press Enter to open https://github.com/login/device in your browser... <br>✓ Authentication complete.<br>- gh config set -h github.com git_protocol https<br>✓ Configured git protocol<br>✓ Logged in as xxxxxxxxxxxxx<br><br> % gh release download --repo jdubois/azure-cli-mcp --pattern=&#39;azure-cli-mcp.jar&#39;</pre><p>To use the server from Claude Desktop, add the server to your claude_desktop_config.json file. Please note that you need to point to the location where you downloaded the azure-cli-mcp.jar file.</p><pre>% open ~/Library/Application\ Support/Claude<br><br>% touch ~/Library/Application\ Support/Claude/claude_desktop_config.json<br><br>% vi ~/Library/Application\ Support/Claude/claude_desktop_config.json<br><br>{<br>    &quot;mcpServers&quot;: {<br>        &quot;azure-cli&quot;: {<br>            &quot;command&quot;: &quot;java&quot;,<br>            &quot;args&quot;: [<br>                &quot;-jar&quot;,<br>              &quot;~/Downloads/azure-cli-mcp.jar&quot;<br>            ]<br>        }<br>    }<br>}<br><br></pre><p>Create azure resource group and storage blob using using Claude desktop</p><p>Open Cluade desktop</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_0H-PheLWgEbTHYcM9kPNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dZyxi-xP9pGWfIn0Gt3bFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6zQjOmvpFxLPmGQv03ufPA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v8bnqwZrTh0vh_Ta2IiwTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RCixjNoXX3Mit3vL3hlxOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EY4TyC8ttf1JKZepUi1rwg.png" /></figure><p><strong>Is it Secured : </strong>No, This MCP server executes az commands for you; an attacker might use it to execute any other command. The current implementation only supports the stio transport, like the majority of MCP servers now in use. It is designed to operate locally on your computer using your Azure CLI credentials, much like you would if you were doing it yourself.</p><p>It is entirely feasible to have this MCP server support the http transport and Azure token authentication in the future, allowing for remote use by various users. The second step will be completed after the SDK and MCP standard are more stable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30b894476650" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chat with your database without writing SQL]]></title>
            <link>https://selvakumarpalanisamy.medium.com/chat-with-your-database-without-writing-sql-2abde85475c0?source=rss-b19250882919------2</link>
            <guid isPermaLink="false">https://medium.com/p/2abde85475c0</guid>
            <dc:creator><![CDATA[Selvakumar Palanisamy]]></dc:creator>
            <pubDate>Mon, 26 Feb 2024 08:30:32 GMT</pubDate>
            <atom:updated>2024-02-26T08:30:32.984Z</atom:updated>
            <content:encoded><![CDATA[<p>Creating complex SQL queries can be difficult when managing databases. Especially for people who are not SQL professionals, this might be challenging. It is obvious that there is a need for an approachable solution that makes creating SQL queries easier.</p><p>Existing techniques for creating SQL queries can be time-consuming and frequently necessitate a thorough grasp of the underlying database structure. Certain tools could be useful for creating queries, but they might require additional customisation to fit different databases or ensure security and privacy.</p><p>A helpful open-source Python framework called Vanna AI takes a two-step approach to simplifying SQL generation. First, it trains a Retrieval-Augmented Generation (RAG) model on your data, and then it asks questions to generate SQL queries that are specific to your database.</p><p>Vanna provides a simple and flexible solution to the prevalent problem of SQL query generating. Vanna makes database querying easier to use and more accessible for everyone.</p><p><strong>How Vanna Works</strong></p><p>Vanna is a Python module that helps you create precise SQL queries for your database by leveraging LLMs through retrieval augmentation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*_UKNFR-d9wzIZDm1.png" /></figure><p>Vanna works in two easy steps — train a RAG “model” on your data, and then ask questions which will return SQL queries that can be set up to automatically run on your database.<br>vn.train(…)</p><p>Train a RAG “model” on your data. These methods add to the reference corpus below.<br>vn.ask(…)</p><p>Ask questions. This will use the reference corpus to generate SQL queries that can be run on your database.<br><strong>Install and Import Vanna</strong></p><pre>%pip install vanna</pre><p>Requirement already satisfied: MarkupSafe&gt;=2.0 in /usr/local/lib/python3.10/dist-packages (from Jinja2&gt;=3.0-&gt;flask-&gt;vanna) (2.1.5)<br>Requirement already satisfied: six&gt;=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil&gt;=2.8.1-&gt;pandas-&gt;vanna) (1.16.0)<br>Installing collected packages: kaleido, vanna<br>Successfully installed kaleido-0.2.1 vanna-0.1.1</p><pre>import vanna<br>from vanna.remote import VannaDefault</pre><p><strong>Log In to Vanna</strong></p><p>Vanna provides a function to get an API key. You’ll get a code sent to your e-mail. You can save your API key for future usage so that you don’t have to log in every time.</p><pre>api_key = vanna.get_api_key(&#39;xxxxxyyyy@gmail.com&#39;)</pre><p>Check your email for the code and enter it here:</p><p><strong>Set Model</strong></p><p>chinook is a public model that refers to the Chinook sample database</p><pre>vanna_model_name = &#39;chinook&#39; # This is the name of the RAG model. This is typically associated with a specific dataset.<br>vn = VannaDefault(model=vanna_model_name, api_key=api_key)</pre><p><strong>Connect to the Database</strong></p><p>Here we’re connecting to a SQLite database but you can connect to any SQL database.</p><pre>vn.connect_to_sqlite(&#39;https://vanna.ai/Chinook.sqlite&#39;)</pre><p><strong>Ask Questions</strong></p><p>Now we’re going to use vn.ask to ask questions and it’ll generate SQL, run the SQL, show the table, and generate a chart</p><pre>vn.ask(&quot;What are the top 5 artists by sales?&quot;)</pre><p>SELECT a.ArtistId, a.Name, SUM(il.Quantity) AS TotalSales<br>FROM Artist a<br>JOIN Album al ON a.ArtistId = al.ArtistId<br>JOIN Track t ON al.AlbumId = t.AlbumId<br>JOIN InvoiceLine il ON t.TrackId = il.TrackId<br>GROUP BY a.ArtistId, a.Name<br>ORDER BY TotalSales DESC<br>LIMIT 5;</p><p>ArtistId Name TotalSales<br>0 90 Iron Maiden 140<br>1 150 U2 107<br>2 50 Metallica 91<br>3 22 Led Zeppelin 87<br>4 113 Os Paralamas Do Sucesso 45</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*gPUZ51_Di-kYpBMG.png" /></figure><p><strong>Launch the User Interface</strong></p><pre>from vanna.flask import VannaFlaskApp<br>app = VannaFlaskApp(vn)<br>app.run()</pre><p>How to connect to Athena and redshift</p><p><em>Athena</em></p><pre>import pandas as pd<br>from pyathena import connect<br>conn_details = {...}  # fill this with your connection details<br>conn_athena = connect(**conn_details)<br>def run_sql_athena(sql: str) -&gt; pd.DataFrame:<br>    df = pd.read_sql(sql, conn_athena)<br>    return df<br>vn.run_sql = run_sql_athena</pre><p>Redshift</p><pre>import pandas as pd<br>import psycopg2<br>conn_details = {...}  # fill this with your connection details<br>conn_redshift = psycopg2.connect(**conn_details)<br>def run_sql_redshift(sql: str) -&gt; pd.DataFrame:<br>    df = pd.read_sql_query(sql, conn_redshift)<br>    return df<br>vn.run_sql = run_sql_redshift</pre><p>Most of Vanna’s functionality does not need your specific data, but does need your schema (eg SQL queries and structure — table names, column names)</p><p>It’s completely open source and free, and works with Snowflake, Postgres, Redshift, and most other databases.</p><p>Reference : vanna.ai.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2abde85475c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create a chatgpt-like system that bases its responses on the enterprise’s own data using…]]></title>
            <link>https://selvakumarpalanisamy.medium.com/how-to-create-a-chatgpt-like-system-that-bases-its-responses-on-the-enterprises-own-data-d73fb374c94a?source=rss-b19250882919------2</link>
            <guid isPermaLink="false">https://medium.com/p/d73fb374c94a</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[azureopenaiservice]]></category>
            <category><![CDATA[openai]]></category>
            <dc:creator><![CDATA[Selvakumar Palanisamy]]></dc:creator>
            <pubDate>Mon, 11 Dec 2023 03:12:47 GMT</pubDate>
            <atom:updated>2023-12-11T06:15:41.805Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to create a chatgpt-like system that bases its responses on the enterprise’s own data using Azure OpenAI</h3><p>An efficient solution to this problem is provided by the combination of Azure Cognitive Search and Azure OpenAI Service. It combines ChatGPT’s remarkable natural language management capabilities with the enterprise-grade features of Azure, the capacity of Cognitive Search to index, comprehend, and retrieve the appropriate portions of your own data across extensive knowledgebases.</p><p>The approach of retrieval-augmented generation allows for a simple start and the ability to grow more complex as needed. Prompt construction, query formulation for efficient knowledge base retrieval, and back-and-forth interaction between ChatGPT and the knowledge base are very customisable.</p><p>To make LLM model understand and respond to enterprise domain-specific queries, we have the following two options:</p><p>1. Fine-tune the LLM on text data covering the topic mentioned.</p><p>2. by utilising Retrieval Augmented Generation (RAG), a method that incorporates a retrieval component into the generation process. making it possible for us to obtain relevant data and use it as a secondary source of data to feed the generation model.</p><p>We will go with option 2.</p><ol><li>To locate content that might be relevant to the user’s query, perform a semantic search against your knowledge base.</li><li>Create a prompt by combining the data taken from the knowledge base followed by “Given the above content, answer the following question” and then the user’s question .</li><li>Send GPT-4 the prompt to see what response you receive.</li></ol><p>All we’re really doing here is pulling information from a database that appears to be relevant to the user’s query, creating a prompt with that information, and instructing the LLM model to generate the response based only on the information provided in the prompt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*50ZV5A2iQaQhZgl8ugioMA.png" /></figure><h4>Enhancing the retrieval of knowledge bases</h4><p>A key component of these solutions is quality of retrieval, as answers will ultimately depend on what we can extract from the knowledge base.</p><p><strong>Semantic ranking: </strong>By default, Cognitive Search scores using a basic probabilistic model in conjunction with keyword search. You have the option to activate Semantic Ranking, which will increase accuracy by using an advanced deep learning secondary ranking layer.</p><p><strong>Document chunking: </strong>you want content that is the appropriate length when indexing it in Cognitive Search with the express intent of enabling ChatGPT scenarios. Each document will lack context if it is overly brief. Finding the appropriate message for ChatGPT to “read” becomes challenging if it is too lengthy. If your data permits, recommendation is to start with a small number of sentences (about 1/4 to 1/3 of a page) with a sliding window of text. There are situations where it makes sense to keep the data whole and have each document provide the whole description of a single part</p><p><strong>Summarization: </strong>Even after chunking, you might occasionally wish to shorten each candidate in order to fit more in a prompt. This can be accomplished by applying a step for summary. Using Semantic Captions (a query-contextualized summarization step supported directly in Cognitive Search), using hit highlighting (a more lexical, rather than semantic, mechanism to extract snippets), or post-processing the search results with an external summarization model are some options for this.</p><h4><strong>Solution Deployment</strong></h4><p>we’re going to make use of just 3 services :</p><ol><li>Azure OpenAI to interact with the LLM models.</li></ol><p>2. Azure Search and Storage account to set up a knowledge database.</p><p>3. Azure webapp to build a simple user interface.</p><p>The Enterprise domain gpt like search architecture is shown in the diagram below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*FnsQ07TBiFbDnfkLsN1ijA.png" /></figure><p>One of Azure Open AI’s best features is that it is extremely scalable and flexible and also includes security features like encryption and access controls to help protect customer data and systems from cyber threats.</p><p>Here are some of the ways that security is managed for the service to be operational via</p><p><strong>Encryption:</strong> This aids in limiting unwanted access to private information.</p><p><strong>Access Controls:</strong> To assist prevent unauthorised access to customer data and systems, Azure Open AI comes with a number of access controls. Network security groups, multi-factor authentication, and role-based access controls are examples of this.</p><p><strong>Threat Detection:</strong> Azure Open AI has sophisticated threat detection features that assist enterprises in identifying and addressing possible security risks. This covers automated threat response, security warnings, and real-time threat monitoring.</p><p><strong>Data Protection:</strong> To help guarantee that client data is safeguarded in the case of a data loss or system failure, Azure Open AI offers a number of data protection tools, such as backup and disaster recovery.</p><p><strong>Private Endpoint: </strong>Azure Open AI, Search and datastore (storage account) uses Private Endpoint , allowing you to limit access to services to only the resources in your virtual network that need it. enabling authorised resources to access what they require while maintaining the safety and security of your services</p><p>I have created the terraform deployment to deploy the Azure openai, search and storage account plus private endpoints.</p><p><a href="https://github.com/selvakumarsai/azureopenai-enterprisedatasearch.git">GitHub - selvakumarsai/azureopenai-enterprisedatasearch</a></p><pre>azurerm_private_endpoint.pep_st: Still creating... [1m20s elapsed]<br>azurerm_private_endpoint.openaisearch-pe01: Still creating... [1m30s elapsed]<br>azurerm_private_endpoint.pep_st: Still creating... [1m30s elapsed]<br>azurerm_private_endpoint.openaisearch-pe01: Still creating... [1m40s elapsed]<br>azurerm_private_endpoint.pep_st: Still creating... [1m40s elapsed]<br>azurerm_private_endpoint.openaisearch-pe01: Creation complete after 1m48s [id=/subscriptions/369c6a47-2323-409e-8284-e40ed50570c7/resourceGroups/byod-resources/providers/Microsoft.Network/privateEndpoints/pe-openaisearch-byod]<br>azurerm_private_endpoint.pep_st: Still creating... [1m50s elapsed]<br>azurerm_private_endpoint.pep_st: Still creating... [2m0s elapsed]<br>azurerm_private_endpoint.pep_st: Still creating... [2m10s elapsed]<br>azurerm_private_endpoint.pep_st: Still creating... [2m20s elapsed]<br>azurerm_private_endpoint.pep_st: Still creating... [2m30s elapsed]<br>azurerm_private_endpoint.pep_st: Creation complete after 2m31s [id=/subscriptions/369c6a47-2323-409e-8284-e40ed50570c7/resourceGroups/byod-resources/providers/Microsoft.Network/privateEndpoints/pep-byodkedb-st]<br>azurerm_private_dns_a_record.dns_a_sta: Creating...<br>azurerm_private_dns_a_record.dns_a_sta: Creation complete after 3s [id=/subscriptions/369c6a47-2323-409e-8284-e40ed50570c7/resourceGroups/byod-resources/providers/Microsoft.Network/privateDnsZones/privatelink.blob.core.windows.net/A/sta_a_record]<br><br>Apply complete! Resources: 17 added, 0 changed, 0 destroyed.</pre><p>Adding the data source and deploying the azure webapp activities are performed manually , will be updating this blog once the E2E automation is completed.</p><p>To be able to upload your data, you need to have a Storage with Blob Container and Cognitive Search. Unfortunately, there’s one surprising thing not mentioned in the Microsoft documentation. As of Now, Both Storage and Cognitive Search need to have public access enabled in networking tab.</p><p>Enabling the chat history in the webapp incur cosmos db usage to your account</p><h4><strong>Manual steps</strong> to add the data source files and web app are given below</h4><p>Go to azure openai studio</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FtY4IWV9PmlH4e6qS_hwwQ.png" /></figure><p>Add your data in the chat section, Select upload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cNDipgqvBp4tRN2gLaIeCA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BvwUxn5rfxYR2Q6oRv2z5g.png" /></figure><p>Deploy to web app</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3A0gFo5wZTZk0q2Xp8zZkA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cTe901TsYqo9viDuO8MQkg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bAYl8fyYB0_yZpLpKZ2t9g.png" /></figure><p>Launch the webapp and do the private domain data search the same manner as you would a regular search in chatgpt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*00Zg1DswrMjOAHmFZKg1Lw.png" /></figure><p>If you ask the details not present in the private data source you supplied ,you get the message shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BL-cI2i9tIRmfYiglFqT-Q.png" /></figure><p>Amazing, isn’t that right?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d73fb374c94a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Introduction to AWS Control Tower]]></title>
            <link>https://aws.plainenglish.io/aws-control-tower-d6199c148cd6?source=rss-b19250882919------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6199c148cd6</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[aws-control-tower]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Selvakumar Palanisamy]]></dc:creator>
            <pubDate>Mon, 05 Apr 2021 04:56:17 GMT</pubDate>
            <atom:updated>2021-04-06T07:40:36.088Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog post, I will explain briefly how AWS Control Tower helps organizations in creating your well-architected, multi-account AWS environment ensuring security and best practices are in place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*pA1_7ftjo2WZPkxkVr0kyg.png" /><figcaption>Diagram source -AWS</figcaption></figure><h4><strong>Setting up the AWS Control Tower</strong></h4><p>AWS Control Tower requires two email addresses to set up AWS accounts, one for log archiving and another for auditing automatically for you.</p><p><strong><em>Log archive account</em></strong>: Repository of immutable logs of API activities and resource configurations from all of your accounts.</p><p><strong><em>Audit account </em></strong>: Restricted account for your security and compliance teams to gain read and write access to all accounts for auditing purposes.</p><p>After completing the setup of your landing zone, you can see enrolled accounts and registered organization units on your AWS Control Tower dashboard.</p><h4><strong>Landing Zone</strong></h4><p>A landing zone is an auto-built, well-architected, multi-account AWS environment that’s based on security and compliance best practices. AWS Control Tower automates the setup of new landing zone and uses pre-defined blueprints based on best practices</p><p><em>Create a multi-account environment with AWS Organizations.</em></p><p><em>Provide IAM using AWS Single Sign-On (SSO).</em></p><p><em>Provide federated access to accounts using AWS SSO</em></p><p><em>Identity management Centralize logging from AWS CloudTrail, and AWS Config stored in Amazon S3</em></p><p><em>Enable cross-account security audits using AWS IAM and AWS SSO</em></p><p><em>Federated access</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*s7eeSUBlSThK097g2-gVRg.png" /><figcaption>Landing Zone</figcaption></figure><h4><strong>Account Factory</strong></h4><p>Account factory helps to standardize sub-account configurations from one place and provision new accounts easily with pre-defined configurations, also allows you to define network configuration standards and restrict regions that the account can use.</p><h4><strong>Guardrails</strong></h4><p>Guardrails are pre-defined governance rules for security, operations and compliance. AWS Control Tower provides you a set of guardrails based on AWS best practices and common policies to gain governance on your accounts. There are two types of guardrails, mandatory and optional guardrails.</p><p>Mandatory guardrails → Automatically enabled on your landing zone to protect your logs’ integrity and AWS Control Tower setup by default.</p><p>Optional guardrails → you can choose the rules that you want to enable any time on OUs. All accounts provisioned under enabled OUs will automatically inherit those guardrails.</p><p>Below given are strongly recommended guardrails based on well-architected multi-account environments best practices.</p><p><em>Disallow Creation of Access Keys for the Root User</em></p><p><em>Disallow Actions as a Root User</em></p><p><em>Enable Encryption for Amazon EBS Volumes Attached to Amazon EC2 Instances</em></p><p><em>Disallow Internet Connection Through RDP</em></p><p><em>Disallow Internet Connection Through SSH</em></p><p><em>Enable MFA for the Root User</em></p><p><em>Disallow Public Read Access to Amazon S3 Buckets</em></p><p><em>Disallow Public Write Access to Amazon S3 Buckets</em></p><p><em>Disallow Amazon EBS Volumes That Are Unattached to An Amazon EC2 Instance</em></p><p><em>Disallow Amazon EC2Instance Types That Are Not Amazon EBS-Optimized</em></p><p><em>Disallow Public Access to Amazon RDS Database Instances</em></p><p><em>Disallow Public Access to Amazon RDS Database Snapshots</em></p><p><em>Disallow Amazon RDS Database Instances That Are Not Storage Encrypted</em></p><h3>Value Proposition in Mergers &amp; Acquisitions use case</h3><p>AWS control tower helps to migrate AWS environments into a well architected framework in a seamless manner.</p><h4><strong>Pre-Merger AWS environment</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3h_IBIUNhEBBKXJQoUGpIQ.png" /><figcaption>Pre-Merger -AWS environments</figcaption></figure><h4><strong>Post-Merger AWS environment</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*36X_VCiJSQjNkkrVa_t3Lg.png" /><figcaption>Post- Merger — AWS Environments</figcaption></figure><h4>Conclusion</h4><p>You can start taking advantage of the Well-Architected Framework to improve technical readiness for an acquisition. The Well-Architected Tool in the <a href="https://aws.amazon.com/console/">AWS Management Console</a> allows to review your workload for migration.</p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>plainenglish.io</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6199c148cd6" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/aws-control-tower-d6199c148cd6">An Introduction to AWS Control Tower</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Platform Security]]></title>
            <link>https://selvakumarpalanisamy.medium.com/kubernetes-platform-security-8d597e51018?source=rss-b19250882919------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d597e51018</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Selvakumar Palanisamy]]></dc:creator>
            <pubDate>Mon, 05 Apr 2021 01:47:19 GMT</pubDate>
            <atom:updated>2021-04-05T01:47:19.621Z</atom:updated>
            <content:encoded><![CDATA[<p>Enterprises have prioritized security due to uptime and compliance concerns. Security-led development will be a priority for 90% of orgs by 2021.</p><p>Let’s discuss about how the micro services Kubernetes platform can be secured by implementing appropriate security solutions and controls.</p><p>Kubernetes platform security principles.</p><p>· Defense in depth.</p><p>· Least privilege.</p><p>· Limiting the attack surface.</p><p>It’s preferable to have multiple layers of defense against attacks on your Kubernetes cluster. If you’re relying on a single defensive solution, attackers might find their way around it.</p><p>There are various ways that an attacker could attempt to get access to your Kubernetes cluster, applications running on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*kqhkgE9a1euwvWgy6lxriw.png" /><figcaption>Kubernetes — security Layers</figcaption></figure><p>Microservices environment team need to have security solutions at all layers of the Kubernetes platform</p><ul><li>Automation and Configuration Management</li><li>Secure coding practices/Security as Code</li><li>Host Hardening</li><li>CI/CD for Patching</li><li>Application-level Auditing and Scanning</li><li>Automated Vulnerability Management Scanning</li><li>Automated Compliance Scan</li><li>Managing Secrets</li><li>Thread Modeling</li><li>Security code reviews</li><li>Penetration test</li></ul><p><strong>Kubernetes native features/solution components to secure your container platform</strong></p><p><strong>RBAC-Use Namespaces, role and role bindings , service accounts</strong></p><p><strong>Namespaces:</strong> Logical segmentation and isolation, or “virtual clusters”. Correct use of Kubernetes namespaces is fundamental for security, as you can group together users, roles and resources according to business logic without granting global privileges for the cluster</p><p><strong>Service Accounts:</strong> Used to assign permissions to software entities. Kubernetes creates its own default service Accounts, and you can create additional ones for your pods/deployments. Any pod run by Kubernetes gets its own privileges through its service Account, applied to all processes run within the containers of that pod.</p><p>Start by making sure your cluster configuration supports RBAC. The location of the configuration file is your kube-apiserver manifest, and this depends on the deployment method but it’s usually inside /etc/kubernetes/manifests in either the master node(s) or the apiserver pod.</p><p>Look for this flag: –authorization-mode=Node,RBAC</p><p><strong>2) Kubernetes admission controllers</strong></p><p>An admission controller is a piece of code that intercepts requests to the Kubernetes API server prior to persistence of the object, but after the request is authenticated and authorized. Admission controllers pre-process the requests and can provide utility functions (such as filling out empty parameters with default values), but can also be used to enforce security policies and other checks.</p><p>Admission controllers are found on the kube-apiserver conf file:</p><p>–admission control=Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,ResourceQuota</p><p><strong>3) Kubernetes Security Context</strong></p><p>When you declare a pod/deployment, you can group several security-related parameters, like SELinux profile, Linux capabilities, etc, in a Security context block</p><p><strong>4) Kubernetes Security Policy (Pod security Policy)</strong></p><p>Kubernetes Pod Security Policy (PSP), often shortened to Kubernetes Security Policy is implemented as an admission controller. Using security policies you can restrict the pods that will be allowed to run on your cluster, only if they follow the policy we have defined.</p><p><strong>5) Kubernetes Network Policies</strong></p><p>A network policy is a specification of how groups of pods are allowed to communicate with each other and other network endpoints.</p><p><strong>6) Kubelet security — access to the kubelet API</strong></p><p>Verify the Kubernetes security settings when configuring kubelet parameters:</p><p>anonymous-auth is set to false to disable anonymous access (it will send 401 Unauthorized responses to unauthenticated requests).</p><p>kubelet has a `–client-ca-file flag, providing a CA bundle to verify client certificates.</p><p>`–authorization-mode is not set to AlwaysAllow, as the more secure Webhook mode will delegate authorization decisions to the Kubernetes API server.</p><p>–read-only-port is set to 0 to avoid unauthorized connections to the read-only endpoint (optional).</p><p><strong>7) Securing Kubernetes etcd</strong></p><p>etcd is a key-value distributed database that persists Kubernetes state. The etcd configuration and upgrading guide stresses the security relevance of this component:</p><p>“Access to etcd is equivalent to root permission in the cluster so ideally, only the API server should have access to it. Considering the sensitivity of the data, it is recommended to grant permission to only those nodes that require access to etcd clusters.”</p><p>You can enforce these restrictions in three different (complementary) ways:</p><p>• Regular Linux firewalling (iptables/netfilter, etc).</p><p>• Run-time access protection.</p><p>• PKI-based authentication + parameters to use the configured certs.</p><p>Run-time access protection An example of run-time access protection could be making sure that the etcd binary only reads and writes from a set of configured directories or network sockets, any run-time access that is not explicitly whitelisted will raise an alarm</p><p><strong>8) Using a trusted Docker registry</strong></p><p>Configure private Docker registry in Kubernetes</p><p>Kubernetes provides a convenient way to configure a private Docker registry and store access credentials, including server URL, as a secret:</p><p>kubectl create secret docker-registry regcred –docker-server=&lt;your-registry-server&gt; –docker-username=&lt;your-name&gt; –docker-password=&lt;your-pword&gt; –docker-email=&lt;your-email&gt;</p><p><strong>9) Authentication ,authorization and Admission controllers for API</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*YGtZEea3o9nGPvIGeAt6mg.png" /></figure><p><strong>10) CI/CD Best Practices</strong></p><p>Implement the security solutions at build,ship and run phases</p><p>Build a solutions for the below requirements and integrate it with your environment to secure the micros services platform</p><p>· End to end visibility of Kubernetes pods deployment</p><p>· Alert management solution to trigger alert when internal service pods or containers start to scan ports internally</p><p>· Monitoring solution to Monitor network connections</p><p>· Monitor what’s going on inside — pod, container?</p><p>· Reviewed access rights to the Kubernetes cluster to know potential insider attack vectors</p><p>· Security checklist — Kubernetes services, access controls, and container hosts?</p><p>With new tools and mentality, enterprises found means for achieving constant delivery (CD) and constant integration (CI) where software development lifecycles became much shorter. DevSecOps looks to combine DevOps and SecOps functions into one team that all work together to increase the rate of deployment while also ensuring compliance and security best practices are maintained. By making security a responsibility of every member of the team, development and operations take some of the load off of security.</p><p>Enterprises have prioritized security due to uptime and compliance concerns. Security-led development will be a priority for 90% of orgs by 2021.</p><p>Let’s discuss about how the micro services Kubernetes platform can be secured by implementing appropriate security solutions and controls.</p><p>Kubernetes platform security design must include the following security principles.</p><p>· Defense in depth.</p><p>· Least privilege.</p><p>· Limiting the attack surface.</p><p>It’s preferable to have multiple layers of defense against attacks on your Kubernetes cluster. If you’re relying on a single defensive solution, attackers might find their way around it.</p><p>There are various ways that an attacker could attempt to get access to your Kubernetes cluster, applications running on it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d597e51018" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moving Large Data To AWS -Snowball]]></title>
            <link>https://selvakumarpalanisamy.medium.com/moving-large-data-to-aws-snowball-518da5d5f3e3?source=rss-b19250882919------2</link>
            <guid isPermaLink="false">https://medium.com/p/518da5d5f3e3</guid>
            <category><![CDATA[data-transfer]]></category>
            <category><![CDATA[snowball]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Selvakumar Palanisamy]]></dc:creator>
            <pubDate>Sun, 04 Apr 2021 09:23:26 GMT</pubDate>
            <atom:updated>2021-04-06T08:26:30.554Z</atom:updated>
            <content:encoded><![CDATA[<h3>Moving Large Dataset to AWS Platform using Snowball</h3><p>It is difficult to move large volume of data to cloud platform over conventional internet links, bandwidth available just is not enough.</p><p>Snowball helps to address the issue businesses faced when attempting to transfer large amount of data.</p><p>AWS Snowball Edge stands as an appliance offering 100 TB data transfer complete with on-board storage and compute. Snowball Edge can be used in three data use case scenarios</p><ol><li>Move large chunks of data into and out of AWS</li><li>Prop up independent local workloads across remote destinations</li><li>Act as temporary storage for local data sets.</li></ol><p><strong>Data Transfer Phases</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*lHc3znGqXLLO5D2yFptQPQ.png" /><figcaption>Data Transfer Phases</figcaption></figure><p>1) First you need to <strong>discover</strong> the data to be transferred -Capture the details about</p><p>Average files sizes</p><p>File system</p><p>Network topology</p><p>2) After data discovery, design a <strong>plan</strong> to migrate the data</p><p>Define timelines</p><p>Assessment of the existing data platform infrastructure</p><p>Tools /automated interfaces, resources</p><p>Post migration processing</p><p>3) <strong>POC</strong> to evaluate the end -to-end process. Recommendation is to use single snowball edge to gain insights about data transfer, identify the issues and optimize the tools /migration scripts.</p><p>4) Once the data is copied /migrated to snowball edge device, perform additional <strong>validations</strong> for data integrity with S3 integrity check to ensure that data is transferred without any modifications</p><p>For large migrations, it is recommended that you engage storage, network, and AWS cloud teams while planning. This will help us to align the right information and resources for your success.</p><p><strong>AWS Snowball Data transfer Architecture</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*RAg4XlojuJtOC9YHUCSpIg.png" /></figure><p>Below are the <strong>high-level steps</strong> to perform the data migration from on-premises NAS device to AWS snowball edge device</p><p>1) Create Data transfer job and provide the your datacenter address to receive the snowball edge device, S3 bucket to copy the data and role, encryption key details.</p><p>2) Once you received the device, power on the device and connect it to the local network .Work with network team to get the available static ip for snowball device (internal private subnet).</p><p>3) Connect the workstation and snowball device to the internal network preferably in the same subnet.</p><p>4) Download the AWS OPSHUB client to the workstation, enter the unlock key and manifest file retrieved from the snowball data transfer job page( AWS console) to unlock the device.</p><p>5) Once the device is unlocked, you can see the OPSHUB dashboard -Storage, compute details.</p><p>6) Configure the AWSCLI on the workstation to connect to snowball device.</p><p>7) Fetch the access key id and secret access key from snowball edge using snowball edge command line and use these details to configure AWS cli.</p><p>8) Write scripts to compress the small files into larger file for the optimal batch data transfer.</p><p>AWS CLI has two primary commands used in transferring data from the local file system to the Snowball Edge; copy and sync.</p><p>aws s3 cp source-file s3://bucket-name — endpoint end-point-name — profile data-trans-profile –metadata “owner=dmig,group=data”</p><p>aws s3 sync . S3:\\&lt;bucket-name&gt; — profile &lt;profile-name&gt; — endpoint &lt;endpoint details &gt; — region snow</p><p><strong>Validation</strong></p><p>1) Check the logs — Amazon S3 Adapter for Snowball client</p><p>· Windows — C:/Users/&lt;username&gt;/.aws/snowball/logs/snowball_adapter_&lt;year_month_date_hour&gt;</p><p>· Linux — /home/.aws/snowball/logs/snowball_adapter_&lt;year_month_date_hour&gt;</p><p>· Mac — /Users/&lt;username&gt;/.aws/snowball/logs/snowball_adapter_&lt;year_month_date_hour&gt;</p><p>2) Validate Command for the Snowball Client</p><p><strong>snowball -v validate</strong></p><p>validates all the metadata and transfer statuses for the objects on the Snowball, This command might take some time to complete, and might appear to be stuck from time to time.</p><p>3) Manual Data Validation for Snowball After Import into Amazon S3</p><p>Whenever data is imported into or exported out of Amazon S3, you can <strong>download PDF job report</strong>.</p><p>The job report provides insight into the state of your Amazon S3 data transfer. The report includes details about your job or job part for your records. The job report also includes a table that provides a high-level overview of the total number of objects and bytes transferred between the Snowball and Amazon S3.</p><p><strong>AWS Snowball Edge Data transfer cost :</strong> There is a $300 service fee per data transfer job. This includes up to 10 days of on-site usage (not including shipping days). Additional fees are applied whenever the appliance is kept for greater than 10 days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*aXU0zTLdJrElngSCIcNkVQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=518da5d5f3e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Introduction to AWS Kubernetes]]></title>
            <link>https://aws.plainenglish.io/aws-kubernetes-container-platform-79f0bee335c?source=rss-b19250882919------2</link>
            <guid isPermaLink="false">https://medium.com/p/79f0bee335c</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[aws-eks]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Selvakumar Palanisamy]]></dc:creator>
            <pubDate>Sun, 04 Apr 2021 03:13:15 GMT</pubDate>
            <atom:updated>2021-04-14T21:39:32.108Z</atom:updated>
            <content:encoded><![CDATA[<p>Amazon Elastic Container Service for Kubernetes (Amazon EKS) is a managed service that makes it easy for you to run Kubernetes.</p><p>Amazon EKS runs Kubernetes control plane instances across multiple Availability Zones to ensure high availability. Amazon EKS automatically detects and replaces unhealthy control plane instances, and it provides automated version upgrades and patching for them.</p><p>Amazon EKS is also integrated with many AWS services to provide scalability and security for your applications, including the following:</p><p>· Amazon ECR for container images.</p><p>· Elastic Load Balancing for load distribution.</p><p>· IAM for authentication.</p><p>· Amazon VPC for isolation.</p><p>Amazon EKS runs up-to-date versions of the open-source Kubernetes software, so you can use all the existing plugins and tooling from the Kubernetes community.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*zKs3lQMqnu4sZn2HEepeow.png" /></figure><h3><strong>AWS Kubernetes (EKS) architecture</strong></h3><h4>How EKS works</h4><p>It runs upstream and certifies Kubernetes on AWS infrastructure, which enables you to migrate any Kubernetes application to EKS without needing to make code changes. To save on cost, you can connect EC2 spot instances or Fargate automatic provision on-demand serverless compute for your applications by using managed node groups of EKS. The following diagram shows how EKS works</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*NSxxZsSm2QAbaAe8eJAmyA.png" /></figure><p>How EKS works (<a href="https://aws.amazon.com/eks/"><strong>by AWS EKS Documentation</strong></a>)</p><h4><strong>AWS ECS Reference Architecture –Non Managed Container Platform</strong></h4><p>You can use AWS ECS based platform for deploying the microservice applications, but you need to manage the servers /clusters. Now AWS is providing Fargate is a compute engine for Amazon ECS that allows you to run containers without having to manage servers or clusters.</p><p>AWS ECS reference architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*ZLTGwovhYA6LZFOBJpQsHA.png" /></figure><h4>Conclusion</h4><p>Both ECS and EKS are good options depending on your situation. If you’re considering developing multi-cloud or hybrid cloud architectures, then EKS is your best choice.</p><p>EKS is the best options for developing and operating large-scale projects where many teams collaborate on several deployments and products simultaneously.</p><p>Lastly, EKS is a better option if the stack contains Kubernetes-native applications and team have Kubernetes platform expertise.</p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>plainenglish.io</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79f0bee335c" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/aws-kubernetes-container-platform-79f0bee335c">An Introduction to AWS Kubernetes</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Data Lake Platform and Serverless Architecture]]></title>
            <link>https://aws.plainenglish.io/aws-data-lake-platform-server-less-architecture-5923546dc80e?source=rss-b19250882919------2</link>
            <guid isPermaLink="false">https://medium.com/p/5923546dc80e</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Selvakumar Palanisamy]]></dc:creator>
            <pubDate>Sun, 04 Apr 2021 03:00:59 GMT</pubDate>
            <atom:updated>2021-04-26T14:26:03.842Z</atom:updated>
            <content:encoded><![CDATA[<p>Data has become a crucial part of every business. This blog post is intended to review:</p><ol><li>Different data and analytics platform layers and the AWS components mappings.</li><li>Details about economically optimized, operationally simple data lake architecture (serverless architecture).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*N97b6UW6nkzynVtnr8j8sg.png" /></figure><p><strong>Data Platform Layers</strong></p><p><strong>Ingest:</strong></p><p>AWS has Kinesis streams to handle high-frequency real-time data. Data consumers can push data in real-time to Kinesis streams. You can also connect Kinesis to an Apache storm cluster.</p><p>Kinesis fire hose can be used for large-scale data ingestion, data pushed can be automatically transferred to different storage layers like S3, red-shift Database, and elastic search services.</p><p>· <strong>Kinesis Video Stream: </strong>Videos</p><p>· <strong>Kinesis Data Streams: </strong>Processing stream using popular streaming frameworks such as Apache Spark, Flink.</p><p>· <strong>Kinesis Data Firehose: </strong>Capture, transform load data with light transformation directly to BI.</p><p>· <strong>Kinesis Data Analytics: </strong>Ability to run SQLs on streaming data.</p><p>AWS Snowball can be used for transporting data in and out of cloud. Snowball comes in sizes of 50 TB / 80 TB and multiple snowballs can be daisy-chained for larger data volume transports.</p><p><strong>DMS:</strong></p><p>AWS data migration services can be used to seamlessly ingest data into the data lake platform. Replication instances connect to the source database and migrate the data to the target data source (S3 or database data source).</p><p>AWS SCT for schema validations and to provide the assessment report to get the details about automated migration, remediation required for the datatype/object issues.</p><p><strong>Process</strong></p><p><strong>EMR: </strong>AWS Elastic Map Reduce (EMR), a managed Hadoop, Spark, and Presto solution. EMR takes care of setting up an underlying EC2 cluster and provides integration with a number of AWS services including S3 and DynamoDB. AWS offers EMR (Elastic Map Reduce) clusters on which Spark can run to do big data computation.</p><p>Data Pipeline is a data orchestration product, that moves, copies, transforms, and enriches data. Data Pipeline manages the scheduling, orchestration and monitoring of the pipeline activities.</p><p><strong>Store</strong></p><p>AWS S3 is the primary storage because of its durability and availability and can maintain segregation between RAW storage buckets, transformed / discovery data buckets, and curated data buckets.</p><p>Redshift is a columnar database that can be used to store terabyte to petabyte data scale data warehouse data.</p><p>AWS DynamoDB can be used to store key-value pairs of metadata, can be used for building data catalog of the data lake raw storage.</p><p><strong>Access</strong></p><p>External tables built on AWS S3 enable services like AWS Athena to run SQLs on files stored in AWS S3. AWS Redshift Spectrum enables to query Redshift and S3 External Tables parallelly using SQL.</p><p>Metadata Management: metadata can be built on AWS native services such as Glue catalog or built bespoke on NoSQL databases such as DynamoDB and advanced search can be enabled through services such as AWS CloudSearch or AWS Elasticsearch.</p><p>Document Classification: AWS Macie can discover, classify and protect sensitive data in AWS. It can do classification of documents based on rules which can evolve further based machine learning models for data discovery, classification and protection.</p><p><strong>Model</strong></p><p>AWS makes it very easy to create predictive models without the need to learn complex algorithms. To create a model users are guided through the process of selecting data, preparing data, training and evaluating models through a simple wizard-based UI. Once trained the model can be used to create predictions via online API (request / response) or a batch API for processing multiple input records.</p><p><strong>Consumption</strong></p><p>AWS offers Quicksight for data . Dashboards can be built from data stored across most AWS data storage services and supports a number of third party solution.</p><p><strong>AWS Bigdata Platform Security Components</strong></p><p>· AWS Identity and Access Management (IAM) lets you define individual user accounts with permissions across AWS resources, MFA for privileged accounts.</p><p>· Data encryption capabilities available in AWS storage and database services, such as EBS, S3, Glacier, Oracle RDS, SQL Server RDS, and Redshift.</p><p>· AWS Key Management Service (KMS) to choose whether AWS can manage can encryption keys or customer keep complete control over keys.</p><p><strong>Economically optimized, operationally simple (serverless architecture)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*xXt5gN4ZS3FUOUXzRe6rPw.png" /><figcaption>Operationally simple server-less data lake architecture</figcaption></figure><p>The data collection process continuously dumps data from various sources to Amazon S3. A Glue ETL job curates/transforms data and writes data as large Parquet/ORC/Avro. Using a glue crawler, the schema and format of curated/transformed data are inferred and the table metadata is stored in AWS Glue Catalog. For data analytics, users have an option of either using Amazon Athena to query data using standard SQL or fetch files from S3.</p><p>In the next blog post, I will discuss data transformation architecture and its required tools.</p><p><em>More content at </em><a href="http://plainenglish.io/"><em>plainenglish.io</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5923546dc80e" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/aws-data-lake-platform-server-less-architecture-5923546dc80e">AWS Data Lake Platform and Serverless Architecture</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>