<?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 Thathsara Pramodya Thalangama on Medium]]></title>
        <description><![CDATA[Stories by Thathsara Pramodya Thalangama on Medium]]></description>
        <link>https://medium.com/@falcon1001?source=rss-d2ba1e793d7f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6j2dpYTmE5lKLn-YJgis3g.jpeg</url>
            <title>Stories by Thathsara Pramodya Thalangama on Medium</title>
            <link>https://medium.com/@falcon1001?source=rss-d2ba1e793d7f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 08:30:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@falcon1001/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[Philosophy behind AI, ML, & DL]]></title>
            <link>https://falcon1001.medium.com/philosophy-behind-ai-ml-dl-5db8815d4d82?source=rss-d2ba1e793d7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5db8815d4d82</guid>
            <dc:creator><![CDATA[Thathsara Pramodya Thalangama]]></dc:creator>
            <pubDate>Fri, 22 Aug 2025 10:37:15 GMT</pubDate>
            <atom:updated>2025-08-22T10:37:41.552Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Artificial Intelligence, Machine Learning, Deep Learning. Three acronyms that often get thrown around as if they mean the same thing. But they don’t. Each carries its own philosophy, its own purpose, and its own way of solving problems.</p><p>AI does not always mean futuristic robots plotting world domination. Sometimes it is as simple as a thermostat making a decision. And if you have ever wondered how machines “learn,” or why deep learning feels like a black box, this article will make sense of it.</p><p>Let’s walk through AI, ML, and DL in that order. We will look at how they connect, how they differ, and why they matter.</p><h3>Part 1: The Philosophy of AI</h3><h3>What counts as AI?</h3><p>When most people hear “AI,” they think of self-driving cars or ChatGPT. But even simple rule-based systems can be considered AI. Take a thermostat: it “decides” when to turn the heater on if the temperature drops below 20°C. That is intelligence, albeit a very narrow form. Rules encoded by humans mimic decision-making.</p><p>At its core, AI is about machines making choices without constant human intervention. That can be as basic as “if X then do Y.”</p><h3>AI and Optimization</h3><p>Now let’s move one step further. Suppose you are a factory manager with limited resources: 100 hours of labor and 200 units of raw material. You need to maximize profit. Should you produce 30 chairs and 50 tables, or 40 chairs and 30 tables?</p><p>This is a linear programming problem, one of the earliest areas where AI showed its strength. Linear programming is not guesswork. It is an optimization method that finds the best outcome under given constraints.</p><p>Here is the key philosophical point. AI is fundamentally about optimization. Whether it is a thermostat optimizing comfort, or a supply chain optimizing costs, the principle is the same: choose the best action from all possibilities.</p><h3>Part 2: The Philosophy of Machine Learning</h3><h3>Why ML Exists</h3><p>But what about problems where we do not know the rules? Predicting the price of a house is a perfect example. There is no universal formula like <em>price = f(size, location, number of bedrooms)</em>. Real estate prices are influenced by dozens of messy, hidden factors: neighborhood safety, school quality, even how trendy the area feels.</p><p>You cannot write an exact equation for that. So how do we solve it?</p><h3>The ML Approach</h3><p>Machine Learning says: do not write the formula, learn it. Look at thousands of past examples, find patterns that minimize prediction error, and construct a model that captures those relationships.</p><p>This is the training phase. The model studies many instances at once to learn general patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fjBJQbLfH3-rsewBcg6Ftw.png" /><figcaption>A large number of instances show patterns that a single instance is unable to comprehend.</figcaption></figure><p>Once trained, it can predict the price of a single new house. Will it always be correct? No. There is always error. But it will often outperform humans or rigid formulas.</p><h3>Understanding Features and Representations</h3><p>Here is how it works under the hood. Each feature, such as square footage or year built, gets converted into numbers. In ML these numerical representations are called tensors.</p><pre>#This is your single car instance with features such as make year, color, and so on<br>Instance:<br>{Car -&gt; {year: 1999, color: red, manufacturer: Honda}}<br><br>#Instances can have different types of features. <br>#Mainly numerical and categorical.<br>Feature Types:<br>year          -&gt; numeric<br>color         -&gt; categorical (red, blue, green)<br>manufacturer  -&gt; categorical (Honda, Toyota, Ford)<br><br>#Machines works with number. So we encode categorical values with numbers<br>Categorical Encoding:<br>red          -&gt; [1, 0, 0] #If the car was blue it would be [0,1,0]<br>Honda        -&gt; [1, 0, 0]<br><br>#Now we have a vector to represent your instance<br>Combined Vector:<br>[1999, 1, 0, 0, 1, 0, 0]<br><br># Normalize numeric features so all inputs contribute comparably to the model<br>Normalization (min-max for year: 1990-2025):<br>year_norm = (1999 - 1990) / (2025 - 1990) = 9 / 35 ≈ 0.257<br><br>Normalized Vector:<br>[0.257, 1, 0, 0, 1, 0, 0]<br><br>#Finally we have the Tensor<br>Tensor:<br>tf.constant([[0.257, 1, 0, 0, 1, 0, 0]], dtype=tf.float32)</pre><p>Why do this? Because when features are represented in numbers, we can measure similarity. Two houses in the same neighborhood will have similar numerical vectors. Houses on opposite ends of the city will look very different. This numerical closeness helps the model detect structure and generalize.</p><p>The outcome is a mathematical function tuned to fit the data.</p><h3>Types of Machine Learning Models</h3><p>Machine Learning is not a single technique but a family of approaches. Models are often categorized in several ways: by <strong>learning method</strong>, by <strong>task type</strong>, or by <strong>model architecture</strong>.</p><h3>By Learning Method</h3><ul><li><strong>Supervised learning</strong>: models are trained on labeled data to predict a known outcome. Examples include predicting house prices, spam detection, or credit scoring.</li><li><strong>Unsupervised learning</strong>: models work with unlabeled data to find hidden structures. Customer segmentation and topic modeling fall here.</li><li><strong>Reinforcement learning</strong>: agents learn by trial and error, receiving feedback from the environment. This approach trains robots to walk or algorithms to master complex games.</li><li><strong>Self-supervised learning</strong>: a more recent approach where the system generates pseudo-labels from the input itself, widely used in modern natural language processing models.</li></ul><h3>By Task Type</h3><ul><li><strong>Classification</strong>: predicting categories such as whether an email is spam or not.</li><li><strong>Regression</strong>: predicting continuous values such as house prices or stock movements.</li><li><strong>Clustering</strong>: grouping similar data points such as customer segments.</li><li><strong>Generation</strong>: producing new content such as synthetic images, music, or text.</li><li><strong>Recommendation</strong>: suggesting products, movies, or articles based on user behavior.</li><li><strong>Anomaly detection</strong>: identifying unusual events, often used in fraud detection or system monitoring.</li></ul><p>Each dimension of categorization provides a different lens. The same algorithm can belong to multiple categories depending on how it is used. For instance, a neural network might perform regression in one project, classification in another, and generation in yet another.</p><p>But here’s the catch - ML models depend on humans defining features. We tell the model what to look at, such as size or number of bedrooms. The model does not invent those features. It only learns how to weigh them.</p><h3>Part 3: The Philosophy of Deep Learning</h3><h3>The Limits of Feature Engineering</h3><p>Feature engineering works when humans can identify relevant inputs. But what about data such as images, audio, or natural language?</p><p>Consider recognizing whether a photo shows a cat or a dog. Which features would you define? Ear shape? Fur texture? Pixel intensity values? There are millions of possibilities, and many are ambiguous.</p><p>The same problem appears in speech recognition. Which sound frequencies matter? How should word boundaries be marked? Humans cannot manually define every feature.</p><h3>Representation Learning</h3><p>Deep Learning solves this by letting the model discover features itself. This idea is called <strong>representation learning</strong>. Instead of hand-crafting inputs, deep neural networks learn which features matter directly from raw data.</p><h3>Inspiration from Biology</h3><p>The approach is inspired by the brain. Biological neurons fire when stimulated, and connections strengthen as we practice skills. Over time, pathways become more efficient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nFTHvDleqZ7BIkX05pJuIg.jpeg" /><figcaption>A neuron and it’s complex interconnections within a brain</figcaption></figure><p>Artificial Neural Networks mimic this structure.</p><h3>Anatomy of a Neural Network</h3><p>Each artificial neuron performs a basic operation. It takes inputs, multiplies them by weights, adds a bias, applies an activation function, and sends the result forward.</p><p>Weights represent the strength of connections. Biases shift the threshold for activation. By combining many neurons in multiple layers, networks build up hierarchical features.</p><p>In image recognition, early layers might detect edges. Deeper layers detect shapes. Final layers recognize entire objects, such as a cat’s face.</p><h3>Learning with Propagation</h3><p>Training a neural network happens in two steps:</p><ul><li><strong>Forward propagation</strong>: the network makes a prediction.</li><li><strong>Backward propagation</strong>: the error between prediction and reality flows back through the network. Weights and biases are adjusted.</li></ul><p>This process repeats thousands of times, guided by optimization algorithms such as stochastic gradient descent.</p><p>After sufficient training, the neural network itself becomes the function that maps inputs to outputs. Unlike simpler ML models, individual neurons are often uninterpretable. But collectively, they achieve state-of-the-art performance on complex tasks.</p><h3>Conclusion</h3><p>The progression is clear.</p><ul><li><strong>AI</strong> is about decision-making and optimization.</li><li><strong>ML</strong> is about generalizing from data when rules are unknown.</li><li><strong>DL</strong> is about automatically discovering features in problems too complex for humans to define.</li></ul><p>These are not isolated silos. They are stages in the same story. Each builds on the previous, extending our ability to teach machines how to make decisions.</p><p>So the next time you hear the word “AI” used as if it were magic, remember the reality. It is optimization, pattern recognition, and representation learning. Step by step, these methods move machines closer to solving the kinds of problems that once seemed uniquely human.</p><p>That is the philosophy of AI, ML, and DL.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5db8815d4d82" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices — what, why, when, and most importantly, when not to.]]></title>
            <link>https://falcon1001.medium.com/microservices-what-why-when-and-most-importantly-when-not-to-13763073eadd?source=rss-d2ba1e793d7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/13763073eadd</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[modern-software]]></category>
            <dc:creator><![CDATA[Thathsara Pramodya Thalangama]]></dc:creator>
            <pubDate>Mon, 23 Jun 2025 11:23:09 GMT</pubDate>
            <atom:updated>2025-06-23T11:23:09.849Z</atom:updated>
            <content:encoded><![CDATA[<h3>Microservices — what, why, when, and most importantly, when not to.</h3><p>Microservices architecture is one of the hottest topics in software engineering today, often hailed as the ultimate solution for building modern applications.</p><p>Whether you’re new to the field or a seasoned developer, you’ve likely heard the buzz — microservices this, microservices that. But what’s behind the hype?</p><p>In this article, I’ll explain microservices architecture in the simplest terms. Let’s start by exploring what is microservice architecture and the key component of the microservices.</p><h3>What is Microservices Architecture?</h3><p>Microservices, as the name suggests, are a collection of small, independent services, each designed to handle a single business capability with its own database, operating independently from other services.</p><p>In the most common microservices pattern, it would look like this</p><figure><img alt="Microservice Architecture" src="https://cdn-images-1.medium.com/max/1024/1*IBZJnXj86BhTEb2pmWD5YQ.png" /><figcaption>fig 1. API Gateway pattern of Microservice Architecture</figcaption></figure><p>As you can see, instead of relying on a single server with a single database, this architecture emphasizes on having a dedicated server for each service, each with its own database.</p><p>If you look closely, you’ll notice that these independent servers each have a single responsibility and are all positioned behind another service called the ‘API Gateway.’ If you’re as curious as I am, your first question might be:<strong> why?</strong></p><p>The short answer is that it fixes the issues we had with other architectures, such as the monolithic architecture.</p><h3>Why Microservices?</h3><p>Wait, what is a monolithic architecture? Okay, the term “monolithic” means single, so a monolithic architecture refers to having a single server for the entire architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mmSMdAEFkjy6Da-aIVKf9A.png" /><figcaption>fig 2. Monolithics Architecture</figcaption></figure><p>But this doesn’t seem so bad, does it? First of all, a monolithic architecture isn’t bad, and it’s perfectly fine as long as your project is less complex and managed by a smaller team.</p><p>However, things take a turn when your project grows in complexity, when multiple teams are involved in development, and when you try to scale efficiently. Let’s see what those challenges are:</p><p><strong>Tight Coupling: </strong>In monolithic architecture, all components are tightly integrated into a single codebase. A change in one module can unintentionally break other modules, making development and maintenance riskier and more complex.</p><p><strong>Inefficient Scaling: </strong>Monolithics are scaled by replicating the entire application, even if only one component needs more resources. This is inefficient, as it consumes more hardware resources and increases costs.</p><p><strong>Slow Development and Deployment: </strong>As the codebase grows, development slows due to increased complexity and longer build/test cycles. Deploying changes requires redeploying the entire application, which can lead to downtime and delays.</p><p><strong>Team Coordination Issues: </strong>Multiple teams working on a single codebase often face conflicts, such as merge issues or overlapping changes. This slows down development and requires extensive coordination, making it harder for teams to work independently</p><p><strong>Technology Lock: </strong>Monoliths typically use a single technology stack. Introducing new tech stack or frameworks for specific features is challenging, as the entire system may need refactoring. This limits innovation and ties teams to outdated technologies</p><p><strong>Limited Fault Isolation: </strong>A failure in one component (e.g., a memory leak) can bring down the entire application. Monoliths lack the fault isolation that microservices provide, where a failure in one service doesn’t necessarily affect others</p><p><strong>Complex Maintenance: </strong>As monoliths grow, the codebase becomes harder to understand and maintain. Debugging issues or adding new features takes longer, especially for new developers who need to grasp the entire system.</p><p><strong>Inflexible Deployment Schedules: </strong>All changes, even minor ones, must be deployed together, forcing teams to align on a single release schedule. This reduces agility and delays the delivery of individual features or bug fixes.</p><p>As you can see, monolithic architectures created significant challenges when applied to complex and scalable systems, such as scalability bottlenecks, tight coupling, and deployment delays. A better solution was needed to overcome these limitations.</p><p>This led to the rise of microservices, which evolved from earlier approaches like Service-Oriented Architecture (SOA) to address these issues more effectively.</p><p>The microservices architecture allows independent services to be developed, deployed, and scaled separately, and it has been refined and customized by developers to meet diverse project needs. That’s why you’ll see many variations of microservices in real-world applications.</p><p>But how exactly microservices address above problems in monolithic architecture?</p><p><strong>No More Tight Coupling — </strong>Microservices break the application into independent services, each handling specific business logic. By doing so, they introduce loose coupling between services. These services use well-defined APIs or message queues to handle inter-service communication without tightly coupling them to each other.</p><p><strong>Efficient Scalability — </strong>Since now every service is running independently with their own dedicated server, we can scale each service based on its specific needs. For example, a high-traffic payment service can be scaled without scaling less-used services like user profile management, optimizing resource use and cost.</p><p><strong>Faster Development and Deployment — </strong>Microservices are built around smaller, focused codebases, each adhering to the<strong> </strong><a href="https://www.geeksforgeeks.org/system-design/single-responsibility-in-solid-design-principle/"><strong>single responsibility principle</strong></a><strong>.</strong> This reduces complexity, enabling faster development, testing, and debugging. Since services are decoupled, they can be deployed independently, supporting continuous delivery and minimizing downtime.</p><p><strong>Easing Team Coordination </strong>— Each team owns a specific service, enabling them to work independently. Teams can make decisions, develop, and deploy their service without waiting for others, reducing conflicts and improving agility.</p><p><strong>No Technology Lock — </strong>Each service can use the best-suited technology stack (e.g., Python for one service, Node.js for another). This allows teams to adopt new tools or frameworks without refactoring the entire system.</p><p><strong>Enhanced Fault Isolation — </strong>Services run independently, so a failure in one (e.g., a bug in the recommendation service) doesn’t bring down others (e.g., the checkout service). However, in scenarios where services communicate synchronously, this isolation can break down, resulting in what’s known as cascading failures. Microservices architecture includes design patterns to mitigate this risk. The <a href="https://www.geeksforgeeks.org/system-design/what-is-circuit-breaker-pattern-in-microservices/"><strong>circuit breaker pattern</strong></a> is a prime example, improving system resilience and uptime by preventing repeated calls to failing services.</p><p><strong>Simplifying Maintenance — </strong>Each service has a smaller, focused codebase, making it easier to understand, debug, and maintain. New developers can quickly grasp a single service without needing to learn the entire system.</p><p><strong>Flexible Deployment Schedules — </strong>Independent services allow teams to deploy updates on their own schedules. A team can roll out a new feature or bug fix for their service without waiting for others, enabling faster and more frequent releases.</p><p>Now you understand why microservice architecture emerged and what problems it solves. But when should you consider using microservices instead of a monolithic architecture? Both are tools for building systems, each with its own pros and cons, like a pair of scissors and a kitchen knife. They both cut things, but you wouldn’t use scissors to cut a cake, just as you wouldn’t use a kitchen knife to cut paper.</p><p>So, let’s explore when microservices are a good fit, and more importantly, when they are not.</p><h3>When to Use Microservice Architecture</h3><p>Microservices, by nature, are a form of distributed system, which naturally introduces complexity. Designing reliable and resilient distributed systems requires careful planning and experienced engineers. Without proper design, microservices can cause issues like data inconsistency, system downtime, and significant financial or reputational loss.</p><p>Also, microservice architecture requires higher initial investment — more servers, tools, and specialized staff compared to simpler monolithic architecture.</p><p>So, it’s mandatory to know when microservices are a good fit, because obviously, they’re not a magical solution for every problem.</p><p>Microservices are a best fit for following scenarios.</p><p><strong>Complex System with Multiple Business Domains — </strong>When your system has diverse functionalities incorporating multiple business domains such as inventory handling, payments, complex user management. microservices can break the complexity into manageable pieces. Each service focuses on one domain, reducing interdependence.</p><p><strong>High Scalability Needs — </strong>When your system is expected to handle a heavy traffic and when you need to scale the stressed services independently without scaling the entire system. Microservices let you scale only the stressed service, not the whole system.</p><p><strong>Large, Distributed Teams — </strong>If your organization is large and has multiple teams, you can benefit from microservices. Each team owns a service, working and deploying independently, which reduces coordination time.</p><p><strong>Need for Technology Diversity — </strong>When your system requires different tools such as machine learning in Python and real-time APIs in Node.js, microservices offer flexibility.</p><p><strong>Critical Reliability Requirements — </strong>If your system demands maximum availability and uptime, microservices are a good choice. They isolate faults, keeping the application running even if one part fails.</p><blockquote>Remember, don’t choose microservices just because one condition fits. Make sure at least two or three conditions apply — otherwise, you’ll soon find out why another architecture might have been a better choice.</blockquote><p><strong>But every system needs efficient scaling, maximum uptime, and more. So why shouldn’t I use microservices for all my projects?</strong></p><p>Fair question. The thing about architectural and project design choices is that they aren’t driven solely by technology requirements. Technology needs are just one part of the equation. Your organization’s capabilities, team structure, and many other factors play a big role. So sometimes, even if your system demands microservices, it might not be the best overall choice.</p><p>Let’s explore when microservices become a bad design decision.</p><h3>When Not to Use Microservices Architecture</h3><p>As I pointed out before microservices are complex and demands higher initial investment. That alone makes it unsuitable for certain scenarios.</p><p><strong>Simple Applications — </strong>If your system is simple, with straightforward business logic and mostly basic CRUD operations, a monolithic architecture is usually a better and simpler choice than microservices. The deployment and maintenance cost for a simple app like that often outweighs any benefits microservices might bring.</p><p><strong>Startups or Small Teams — </strong>Startups needs to minimize their ideas to action time and validate their ideas as fast as they can. So, speed is a crucial aspect in startup businesses. Microservices’ setup and management can slow them down, while a monolith lets them focus on the product. Small teams, other hands may lack the specialized staff that needs to design, develop, and maintain microservices in the long run. This is highly dependent on your team and their capabilities. But generally speaking, monolithic is a better choice for small teams as well.</p><p><strong>Limited Resources — </strong>Microservices demand more servers, databases, and DevOps expertise. If you’re strapped for cash or staff, a monolith is more practical.</p><p><strong>Early-Stage Projects —</strong>If you’re early in your product journey or still figuring things out, a monolith lets you make quick changes without worrying about separating services. So even if your product takes an unexpected turn, it won’t be as costly as it would be with microservices. Plus, you can always <a href="https://sigma.software/about/media/migrating-monolith-microservices-step-step-guide"><strong>migrate to microservices</strong></a> as your product grows.</p><p><strong>Low Scalability Demands</strong> — If your app won’t face heavy or uneven traffic, like an internal tool, a monolith can handle the load without adding extra complexity.</p><p>I believe you now have a good understanding of why microservice architecture emerged, what problems it solves, where it’s a good fit, and, most importantly, when it’s not. So, the next time you design a system, whether it’s an academic project, a pet project, or a full-scale enterprise application, keep these points in mind. Until we meet again in another article, happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13763073eadd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>