<?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 Krishna Katragadda on Medium]]></title>
        <description><![CDATA[Stories by Krishna Katragadda on Medium]]></description>
        <link>https://medium.com/@krishnateja.katragadda?source=rss-1778149ec6a2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*IKw1KQhYndacJMSgT-lk3w.jpeg</url>
            <title>Stories by Krishna Katragadda on Medium</title>
            <link>https://medium.com/@krishnateja.katragadda?source=rss-1778149ec6a2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 11:30:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@krishnateja.katragadda/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[Storage Layer]]></title>
            <link>https://medium.com/@krishnateja.katragadda/storage-layer-7c326900b0c0?source=rss-1778149ec6a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c326900b0c0</guid>
            <dc:creator><![CDATA[Krishna Katragadda]]></dc:creator>
            <pubDate>Tue, 01 Dec 2026 01:21:45 GMT</pubDate>
            <atom:updated>2026-12-03T05:11:44.393Z</atom:updated>
            <content:encoded><![CDATA[<p>When we talk about Engineering your data or build AI agents two main things pop out all the time and these are the underlying most important things that get abstracted out as different databases, tools and frameworks.</p><ol><li>Data Storage — how well and efficiently you store your data physically for the usecase.</li><li>Data Processing — how well and efficiently you process your data in memory.</li></ol><p>Lets talk about data storage today. If we abstract out all the different things about data storage it comes down to the most important part — how we store our data physcially on the actual hardware disk. There are two problems we need to understand to disect the storage spectrum.</p><p>Problem 1: Fixed-Size Blocks / Pages (Granularity Mismatch)</p><p>Your SQL query reads thinks in logical units (1 row, 1 column, 1 values) which satisfies the given query condition, but hardware disks always read and write data in fixed sized pages or blocks not individual values or bytes (4KB-16KB pages or multi-megabyte blocks in S3/HDFS). One page or block is the smallest unit your hardware disk can access or update.</p><p>You might be thinking, ok fine so what? the catch here is that everytime you write something or read something it has to pay I/O tax, which you might be familiar with a term as read or write amplification.</p><p>For Example, you have written a query to read/update the status of a record and it is expected to deal with an integer value.</p><p>Even if you only want <strong>4 bytes</strong> (one integer):</p><ul><li><strong>On a Read:</strong> The disk must fetch the <em>entire</em> 16KB page (16,384 bytes) into RAM. <strong>16,380 bytes are wasted bandwidth.</strong></li><li><strong>On a Write:</strong> To change 4 bytes inside an existing file, you must read the 16KB page into memory, modify those 4 bytes, and write all 16KB back out.</li></ul><p>Imagine this happening for all the operations, unless you invent a new hardware that lets us skip paying this I/O tax.</p><p>Now as we have established the problem statement that you <em>must</em> pay the cost of reading/writing a full block every time, <strong>your only solution is controlling what sits inside that page/block you will be reading inevitably.</strong></p><p>There are two bets we can make 1. Row storage 2. column storage</p><p>Row Store Bet: <em>“When my user fetches a record, they want all attributes of that entity at once.”</em> So it packs all columns of User 123 into the same 8KB block. One block read = 100% useful data for a profile lookup.</p><p>Column Store Bet: <em>“When my analyst runs a query, they want one attribute across millions of entities.”</em> So it packs 4,000 salary integers into the same 16KB block. One block read = 4,000 useful values and <strong>zero</strong> wasted bytes on first_name or address.</p><p>Problem 2: Sequential I/O vs. Random I/O</p><p>There are two core duties for any database to perform:</p><p>1. when someone writes new data, updates are considered as new writes, it should take the write and store it on disk.</p><p>2. when someone wants to read the stored data, it should look for that data and give it back.</p><p>Like anyone, we want the database to do both these duties fast. Easy right? not quite and the reason for that is again disk read I/O. Moving around to scattered locations on disk (<strong>Random I/O</strong>) is dramatically slower than reading or writing one continuous stream of blocks (<strong>Sequential I/O</strong>). To put this in simple terms — Random I/O is slow and expensive; Sequential I/O is blazingly fast.</p><p>How this Random vs Sequential I/O becomes a problem. Lets understand this with one example.</p><p>Imagine you have 100 million rows already packed nicely into 16KB blocks on disk. Now two things happen in production:</p><ol><li><strong>The Search Problem (Reads):</strong> A user queries WHERE user_id = 849201. If your blocks are just sitting on disk unsorted, the disk has to read all 100 million rows sequentially from start to finish—taking minutes.</li><li><strong>The Mutation Problem (Writes/Updates):</strong> Suppose you solve the search problem by keeping all rows sorted on disk by user_id so you can use binary search.</li></ol><ul><li>Now a burst of 50,000 updates arrives for random users: user_id = 9102, then user_id = 42, then user_id = 884120.</li><li>Because user_id = 9102 lives in <strong>Block #412</strong> and user_id = 42 lives in <strong>Block #3</strong>, the disk has to physically jump to Block #412, read it, modify it, write it back, then jump across the disk to Block #3, read it, modify it, write it back—<strong>50,000 scattered Random I/O operations per second</strong>.</li><li>Worse: what if you insert a new user into a block that is already 100% full? You would have to shift millions of subsequent bytes on disk just to make room!</li></ul><p><strong>The core dilemma:</strong></p><ul><li><strong>Keeping data sorted in-place</strong> makes <em>reads</em> fast (few block jumps), but forces <em>writes</em> into slow, scattered <strong>Random I/O</strong>.</li><li><strong>Just appending new writes to the end of a file</strong> makes <em>writes</em> 100% fast <strong>Sequential I/O</strong>, but turns <em>reads</em> into a nightmare because a user’s data is now scattered across random places in the log.</li></ul><p>Clearly, we need to make a choice — the answer is depending on the database philosphy database engineers solved this dilemma in two opposite ways depending on whether they wanted to protect <strong>Reads</strong> or <strong>Writes.</strong></p><p>Solution A: B-Trees storage engine — “Keep Data Sorted In-Place, Minimize Random Hops”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c326900b0c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Edge Detection?]]></title>
            <link>https://medium.com/@krishnateja.katragadda/what-is-edge-detection-2245b62420ae?source=rss-1778149ec6a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/2245b62420ae</guid>
            <dc:creator><![CDATA[Krishna Katragadda]]></dc:creator>
            <pubDate>Sat, 10 Oct 2020 07:39:05 GMT</pubDate>
            <atom:updated>2020-10-10T07:39:05.188Z</atom:updated>
            <content:encoded><![CDATA[<p>Even though the concepts and ideas pertaining to Neural networks and other deep learning algorithms are present for so many years, Recent advancements in their implementation in daily applications are because of the invention of robust computational power. Along with computational power, the availability of abundant data mainly unstructured data such as digital images, videos, etc.. helped in the advancement of neural networks (NN).</p><p>Image processing is a method to perform operations on images, such as image enhancement, and to extract useful information present in an image. Object detection is one of the key things that is performed while image processing. In order to detect an object in an image, we must find the edges of the objects. Edge detection is the first step in the process of object detection.</p><h3><strong>What is Edge?</strong></h3><p>An edge is a boundary between different image segments. It is a place where there is a sudden change in the intensity of the underlying pixels. Any sudden or deep change in the intensity of image pixels contribute to an edge between image segments.</p><p>A digital image is made up of a series of pixels. Depending upon the arrangement and intensity of pixels with respect to the surrounding pixels, a shape will occur in an image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*K8XykVaJxRizidtY-sAlDw.png" /><figcaption>the left image is an original image, on the right, we have an image with edges detected</figcaption></figure><p>If you observe in the above image while processing the series of pixels. There will be a sudden change in the pixel intensity when it encounters the black coat. So, there must be an edge there.</p><figure><img alt="Change in pixel intensity leading to an edge" src="https://cdn-images-1.medium.com/max/146/1*KjT8l1vSiB-tIHL3h7krNA.png" /><figcaption>Change in pixel intensity leading to an edge</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/136/1*dXhQLZXQc0lFkHBqRK4AzA.png" /></figure><p>The dimensions of the greyscale and color image will be different from each other.</p><p>For Example, Generally, an Image dimension is expressed in terms of pixels as “800 x 600” where the first number is the width of the photo and the second number is the height of the photo. In the case of greyscale image (black and white) the dimensions are “<strong>800 x 600 x 1</strong>”, whereas for a color image (RGB image) the dimensions are “<strong>800 x 600 x 3</strong>” (Red, Blue, Green).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*ZEX6bgJz02bCzbQe44OSbQ.png" /></figure><h3>How is an Image read by an algorithm<strong>?</strong></h3><p>All the machine learning algorithms will be able to process the data only when it is in numerical format. We will convert the textual data into numbers with the help of methods like TF-IDF vectorizer etc., But for image data, the underlying pixels will be represented in numbers according to their intensity.</p><p>For images, the pixels are represented as ‘0’ for black and ‘1’ for white. The remaining colors are represented with the values in the range [0,1] depending upon the colors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/179/1*MPBWltFd1HnGEEwLlRgWAg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*Qe5DwYvW6alyYjtG_4L8iw.png" /><figcaption>Original Image and pixel representation of the image</figcaption></figure><p>We can see that in the pixel representation ‘0’ is present in the regions where black color is present and ‘1’ is present in the regions where white color is present. Around the borders where the color is not completely white or black, the pixel values will be between zero and one. Even though the common representation of R, G, B values lie in between 0–255, those values will be normalized to fit in 0–1 range.</p><h3><strong>EDGE DETECTION:</strong></h3><p>For detecting edges in images, there are many ways. First, we will discuss edge detection with the help of <strong>Convolution Neural Networks (CNN).</strong></p><p><strong>CNN </strong>is a popular neural network that is widely used for analyzing images. It can be used in other data analysis works also. But its main application has been on with image analysis.</p><p>The task of CNN is to identify patterns and hidden information present in the images. CNN consists of <strong>Convolution layers </strong>along with remaining neural layers. These convolution layers act as the first layers in CNN and play a key role in finding edges in images, which will be passed on to remaining layers to find the in-depth patterns in the images.</p><p>Convolution layers are the basis of Convolution neural networks. For each convolution layer, we must specify how many filters are to be applied along with the layer. These filters are useful in detecting patterns (edges in this case) in images.</p><h3><strong>What is a Filter?</strong></h3><p>A filter is nothing but matrix values, generally called weights, which can be either initialized randomly or to a specific value. Certain filters such as Sobel, Scharr, etc which have a specific value that is proven to be effective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*FNok4CV8us_qhb6Y_diUrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*tX0hWb1EcjALMy7ZhvxfnQ.png" /></figure><p>so with the help of filters on convolution layers, we can detect edges.</p><p>But how? The answer is a convolution operator.</p><h3><strong>Convolution:</strong></h3><p>A Mathematical operator which acts on two functions to produce a new third function depicting how one function acts on another function. It is denoted by <strong>‘*’</strong>. In this case, the first function would be the matrix representation of the given Image. The second function is the filter, which is a 3x3 matrix in this case.</p><p>A convolution operator acts on the image and the filter and produces a new image as the output.</p><p><strong>Working of Convolution operator:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*-LdWn5XcKrzdrkJUyr3qTg.png" /><figcaption>The filter acts on the image to perform the convolution operator.</figcaption></figure><p>The filter moves along the pixels in the image and performs matrix multiplication and the resultant is stored as the pixel value in the output image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*NQk52fee3OSJ3mqx3LD0dg.png" /></figure><p><strong>Stride: </strong>The number of pixels a kernel(filter) moves on the image is known as stride, which is usually equal to one.</p><p><strong>Vertical and Horizontal Edges:</strong></p><p>Detects an edge moving from left to right horizontally. In the first case, an edge is noted when pixels move from bright to dark regions, in the next filter vice versa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*gYtyd07ogWwaGrzm1EQmCA.png" /><figcaption>Sobel Horizontal filter</figcaption></figure><p>Detects an edge moving from UP to DOWN vertically. In the first case, an edge is noted when pixels move from bright to dark regions, in the next filter vice versa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*Hmj4Ylo2OqN41zK6n6zCSQ.png" /><figcaption>Sobel Vertical filter</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*QYtn5OrFA-gl2VIszYagxw.png" /></figure><p>Please note that we can specify any number of filters to a convolution layer.</p><p><strong>Implementation:</strong></p><p>The image on which the edge should be detected. I have taken a random image from google.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*Jq7ziLUI4eXuEh3MjVxLCw.png" /></figure><p>Getting the dimension of the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*OmAypGMD2K3zA-vNnI0BmA.png" /></figure><p>Setting up the horizontal and Vertical filters to detect both the edges.</p><p>Here I have taken a sobel filter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*lWIADA4l_gPSJgVU5AJNDA.png" /></figure><p>I have created a Numpy array with all zero’s to store the output image after convolve operation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*bf1gXujIljr2sXhUyE87Og.png" /></figure><p>After calculating the vertical score for the output pixel it is being multiplied by 3 (as it is a color image).</p><p>Image after detecting the Vertical edges:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*4IoO7AegvMZpi1Grvkr3vA.png" /></figure><p>The same procedure is performed for calculating horizontal edges with the help of a horizontal filter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/357/1*vsE9hlJZ4fTjKgxrDwiNsQ.png" /></figure><p>Applying both Horizontal and Vertical filters to detect all the edges in the images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*VEkJ5atCxKWxeFCJkPEpQA.png" /></figure><p>Final Image with all the edges detected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*xoKcvClR6NsADcW1nytgew.png" /></figure><p>Hope this post helps you. Thank You.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2245b62420ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>