<?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 Sanmugarasa Thanoogithan on Medium]]></title>
        <description><![CDATA[Stories by Sanmugarasa Thanoogithan on Medium]]></description>
        <link>https://medium.com/@sanmugarasathaoogithan?source=rss-b85ff4b6f7e2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*88Rp8J2fSFkF_-uy8kzX3A.jpeg</url>
            <title>Stories by Sanmugarasa Thanoogithan on Medium</title>
            <link>https://medium.com/@sanmugarasathaoogithan?source=rss-b85ff4b6f7e2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 17:56:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sanmugarasathaoogithan/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[Swoogle: The Search Engine That Went Looking for Meaning]]></title>
            <link>https://medium.com/@sanmugarasathaoogithan/swoogle-the-search-engine-that-went-looking-for-meaning-7aaac760b46c?source=rss-b85ff4b6f7e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/7aaac760b46c</guid>
            <category><![CDATA[swoogle]]></category>
            <dc:creator><![CDATA[Sanmugarasa Thanoogithan]]></dc:creator>
            <pubDate>Thu, 19 Nov 2026 17:40:28 GMT</pubDate>
            <atom:updated>2026-11-19T17:41:16.888Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/474/0*nBbsE-LUEPOwjHCD" /></figure><p>Type “apple” into a search engine and see what comes back. You might get the company, the latest iPhone, apple fruit, a recipe for apple juice, a page on apple orchards, or something about New York being the Big Apple. The engine doesn’t know which one you meant. It matches the word, ranks the pages, and leaves you to sort it out.</p><p>You can do that without thinking. You glance at the results, see a picture of a phone or a basket of fruit, and click what fits. Humans are good at context.</p><p>Now imagine a piece of software trying to do the same thing. Suppose you’re building a grocery app and need your program to understand that an apple is a fruit, that fruit can be red or green, and that it can be sold by weight. Or suppose you’re building a financial tool that needs to know that Apple is a company, that companies have stock tickers, and that a ticker is not the same thing as a product. Somewhere on the web, someone may already have written down precise, machine-readable definitions for all of this. How would your program find them? How would it know whether those definitions are any good, or whether anyone else uses them?</p><p>Here is a smaller, more familiar version of the problem. You’re a student designing a database for your university. You need a way to describe courses, lecturers, departments, and publications. Do you invent your own vocabulary from scratch, or has someone already solved this? If they have, where is it, and can you trust it?</p><p>Around 2004, a research group in Maryland decided these questions deserved a proper answer. Their answer was a search engine called <strong>Swoogle</strong>.</p><h3>A web that machines can read</h3><p>To understand why Swoogle was needed, you have to understand the idea it was built for: the <strong>Semantic Web</strong>.</p><p>The ordinary web is made for people. When you open a page about a book, you see a title, an author’s name, and a review, and your brain connects them. A computer sees text and formatting. It has no idea which string is the title and which is the author, or that the two are related.</p><p>In 2001, Tim Berners-Lee, James Hendler, and Ora Lassila published an article in <em>Scientific American</em> that described a different kind of web. Information would still be written for people, but it would also carry explicit meaning that software could read. A page about a book would state, in a structured form, that this thing is a book, that it was written by this person, and that it was published in this year. Software could then gather facts from many sites, combine them, and draw conclusions without a human reading each page.</p><p>The article described a scene that became famous: software agents quietly booking appointments, comparing schedules, and finding the best options on behalf of their owners. The agents could do this only because the data they worked with was structured and shared a common understanding of what its terms meant.</p><h3>The building blocks</h3><p>Several technologies were created to make this possible. You don’t need to be an expert in them to follow the rest of this article, but a basic picture helps.</p><p><strong>RDF</strong>, the Resource Description Framework, describes the world in simple three-part statements. Each statement has a subject, a predicate, and an object. “Alice knows Bob” is one. So is “this apple is red.” And so is “Apple makes the iPhone.” Put thousands of statements like these together and you get a web of facts.</p><p><strong>RDFS</strong> and <strong>OWL</strong> are languages for defining the categories and relationships those statements rely on. They let you say that Apple Inc. is a <em>Company</em>, that a <em>Company</em> is a kind of <em>Organization</em>, that a <em>Fruit</em> has a <em>color</em>, and that an <em>apple</em> is a kind of <em>Fruit</em>. OWL goes further, allowing you to express constraints and rules, such as saying that a thing cannot be both a living organism and a corporation.</p><p>A collection of such definitions is called an <strong>ontology</strong>. The word sounds heavy, but the idea is plain. An ontology is an agreed dictionary for a particular area of knowledge. It says what the important concepts are and how they connect.</p><p>Now consider the “apple” problem again. In a good ontology, the fruit and the company would be two separate concepts with two separate identifiers, even though they share a name. A program reading data that points to the company concept would know it was reading about a technology firm, with no chance of confusing it with something in a fruit bowl. That is the whole point. Meaning is attached to the data, not guessed from the words.</p><h3>Why sharing vocabularies matters</h3><p>There is one more piece of the puzzle, and it is the one that makes Swoogle important.</p><p>Two programs can exchange knowledge reliably only if they agree on what the terms mean. If one system uses “author” to mean the person who wrote a book and another uses “author” to mean the person who uploaded a file, the two will misunderstand each other, and the mistakes will be hard to notice.</p><p>The Semantic Web community therefore cared a great deal about <strong>reuse</strong>. If a well-known, well-designed vocabulary for describing people already exists, then everyone who uses it automatically becomes compatible with everyone else who uses it. Every time someone invents a brand-new vocabulary when a good one was already available, the web becomes a little more fragmented.</p><p>Reuse sounds simple. But it has a catch, and the catch is obvious once you say it out loud: you can only reuse something you can find.</p><h3>The problem nobody had solved</h3><p>In the early 2000s, finding ontologies was frustrating.</p><p>Ordinary search engines were designed for HTML pages. RDF and OWL files did not fit that model. They were not written for human eyes. They often had very little surrounding text. They were spread across university servers, personal home pages, and project sites, with no central directory.</p><p>Imagine you were that student designing a university database. Your options were not great. You could ask a colleague. You could browse a few repositories you happened to know about. You could search for the right keywords and hope something useful turned up. Or you could give up and build your own, adding one more incompatible vocabulary to the pile.</p><p>Beyond finding ontologies, there were deeper questions that nobody could easily answer.</p><ul><li>Is this ontology widely used, or did one person publish it and forget about it?</li><li>Does it depend on other ontologies, and are those still available?</li><li>Is there real data out there that uses these terms?</li><li>Which of five similar vocabularies for the same topic is the one the community has settled on?</li></ul><p>A person could spend days chasing these answers. A piece of software had no hope of finding them at all.</p><p>The creators of Swoogle saw this as a missing piece of infrastructure. If the Semantic Web was going to be a real web, it needed its own search engine.</p><h3>Where Swoogle came from</h3><p>Swoogle was built by the <strong>eBiquity Research Group at the University of Maryland, Baltimore County (UMBC)</strong>. The names most closely associated with it are Tim Finin and Li Ding, who worked with colleagues including Anupam Joshi and Rong Pan. The system was introduced to the research community around 2004, with a paper at the ACM CIKM conference, and it was followed by further papers describing its ranking methods and its use in studying the Semantic Web.</p><p>The name is a pun on Google, and it was not subtle about its ambitions. The idea was to do for the Semantic Web what Google had done for the ordinary web: make a huge, messy collection of documents searchable and rank them by importance.</p><p>There was one big difference in audience. Swoogle was not meant for someone looking up a restaurant or checking the weather. Its users were ontology engineers, researchers, and software agents. It was a specialist tool for a specialist community, built to serve a web that was, at the time, still being invented.</p><h3>What Swoogle collected</h3><p>Swoogle used its own vocabulary for the things it handled. The terms are simple, and they are worth learning because they make the rest of the story clearer.</p><p>A <strong>Semantic Web Document</strong>, or <strong>SWD</strong>, is any web document written in a Semantic Web language such as RDF or OWL. It is the equivalent of a web page in an ordinary search engine. It is the basic unit that Swoogle found, stored, and analyzed.</p><p>A <strong>Semantic Web Term</strong>, or <strong>SWT</strong>, is a single class or property defined inside such a document. Take foaf:Person, the “Person” class from the popular FOAF (“friend of a friend”) vocabulary. That is a term. So would be a class called “Fruit” or a property called “hasColor” in some other ontology. Swoogle treated terms as first-class objects. This meant you could search for a concept directly, instead of hunting through whole files to find the one definition you needed.</p><p>Swoogle also sorted documents by what they mostly contained. A document made up largely of definitions of classes and properties behaved like an <strong>ontology</strong>. A document made up largely of statements about specific things, such as particular people, papers, or products, behaved like a <strong>dataset</strong>. Swoogle estimated this by looking at the proportion of definitional statements in each document.</p><p>The split matters because the two kinds of document serve different people. An ontology designer wants the first kind, to learn from or build on. An application that needs real facts wants the second kind. Keeping them apart made each search more useful.</p><h3>How Swoogle Worked: The Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Jgq5aYirEje8kexl.jpg" /></figure><p>Behind the search box, Swoogle was a pipeline with four stages: <strong>discovery, digest, analysis, and service</strong>. Each stage handed its output to the next, and each solved a problem that the one before it left open.</p><pre>Discovery  →  Digest  →  Analysis  →  Service<br> (find)      (extract)   (index &amp; rank)  (serve)</pre><h4>1. Discovery: finding the files</h4><p>Before Swoogle could answer a single query, it had to find the documents. There was no directory of Semantic Web files, so it had to go looking for them.</p><p>It used several methods together:</p><ul><li><strong>Meta-crawling:</strong> asking conventional search engines for telltale file types and patterns, such as .rdf and .owl files. This borrowed the coverage of engines that had already crawled much of the web.</li><li><strong>Bounded HTML crawling:</strong> crawling ordinary web pages, but only within limits, to spot links pointing to Semantic Web documents. Crawling the whole web would have been wasteful, since most pages contain nothing relevant.</li><li><strong>RDF crawling:</strong> following links inside Semantic Web documents themselves. Ontologies often import or reference one another, so finding one good file frequently led to several more.</li><li><strong>Manual submission:</strong> letting users submit the address of a document directly.</li></ul><p>Back to our example: this is the stage where Swoogle would first stumble on the file defining “Apple” as a company and the file defining “apple” as a fruit. At this point it knows only that they exist, not what is inside.</p><h4>2. Digest: reading and describing each document</h4><p>Once a document was found, Swoogle parsed it, checked that it was valid, and extracted metadata about it. This is where a pile of files started to become a database.</p><p>Each document received a record covering three layers:</p><ul><li><strong>Basic metadata:</strong> language, encoding, size, and last-modified date.</li><li><strong>Relations:</strong> how the document connects to others, such as importing another ontology, being a version of one, or using its terms.</li><li><strong>Analytical properties:</strong> how many classes and properties it defines, and the ratio of definitions to statements about individual things. That ratio is what let Swoogle tell an ontology from a dataset.</li></ul><p>For the apple files, the digest stage is where the system would learn that one defines a Company class with a stock ticker property, while the other defines a Fruit class with a color property.</p><h4>3. Analysis: indexing and ranking</h4><p>Analysis had two jobs.</p><p>The first was <strong>indexing for search</strong>. Swoogle used character n-grams, which break words into overlapping chunks of letters so that a search can match part of a word. Ontology terms often appear as compound names like hasPublicationDate, and few people remember the exact spelling or capitalization. With n-gram indexing, a search for “publication date” could still find it.</p><p>The second was <strong>ranking</strong>. An analyzer worked over the relations collected in the digest stage and computed rank scores for both documents and terms, using the OntoRank method described in the next section. Terms and ontologies that many others depended on rose to the top. This is how the well-adopted “Fruit” class would end up above an abandoned one nobody referenced.</p><h4>4. Service: answering people and programs</h4><p>The final stage exposed everything through two doors:</p><ul><li><strong>A web interface</strong> for people to search and browse.</li><li><strong>A programmatic interface</strong> for software, so an application could query Swoogle directly and use the answer.</li></ul><p>The second door matches the original Semantic Web vision best. If the goal was a web that machines could work with, a search engine for it needed to be something machines could call, not just something people could read.</p><h4>Why this design made sense</h4><p>Each stage fed the next. Discovery produced documents, the digest turned them into structured records, analysis made those records searchable and ranked, and the service delivered results. The metadata gathered early on, especially the relations between documents, is what made the ranking possible later. That dependency is worth pointing out to readers, because it leads straight into the OntoRank section that follows.</p><h3>More than keywords: the metadata</h3><p>What made Swoogle more than a file finder was the metadata it kept.</p><p>At the simplest level, it recorded basic facts about each document, such as its language, its encoding, its size, and when it was last modified.</p><p>At a deeper level, it recorded how documents related to one another. One ontology might <strong>import</strong> another, meaning it depends on it. One might be a <strong>newer version</strong> of another. A dataset might <strong>use terms</strong> from several different vocabularies. Swoogle tracked these links, and that transformed a scattered heap of files into a connected network.</p><p>On top of this it computed properties of its own. How many classes and properties does an ontology define? What fraction of the document is definitions versus facts? How highly does the document rank?</p><p>This changed what you could ask. A normal search engine lets you ask, “Which pages contain this word?” Swoogle let you ask richer questions.</p><ul><li>Which vocabularies define this concept?</li><li>Which documents depend on this ontology?</li><li>How widely is this term really used?</li><li>Which of these three similar ontologies do other people rely on most?</li></ul><p>For someone choosing a vocabulary to reuse, these were the questions that mattered.</p><h3>The ranking idea that made it stand out</h3><p>If you had to name one thing that Swoogle is remembered for, it would probably be how it ranked its results.</p><p>Google’s PageRank is built on a neat intuition. A page is important if other important pages link to it. You can picture a person clicking links at random: the pages they land on most often are the ones that matter. In the basic version of the idea, every link counts for roughly the same.</p><p>On the Semantic Web, that stops making sense. Think about these two situations.</p><p>In the first, one ontology formally <strong>imports</strong> another. This is a strong relationship. The importing ontology logically depends on the other and cannot be fully understood without it.</p><p>In the second, a document simply <strong>mentions</strong> a term from some vocabulary. This is a much lighter connection.</p><p>If you treat those as the same, you throw away real information. A casual reference and a formal dependency are different things, and a ranking system that cannot tell them apart will make worse judgments.</p><p>Swoogle’s ranking method, usually called <strong>OntoRank</strong>, adjusted the PageRank idea to handle this. It used what the authors called a “rational random surfer.” Unlike the plain random surfer who follows any link with equal probability, the rational one prefers links that carry stronger meaning. Different kinds of relationships were given different weights, so an import counted for more than a passing reference. And the method ranked both whole documents and individual terms.</p><p>The practical effect was intuitive. If a term was used by lots of datasets and lots of other ontologies, it rose to the top. If an ontology had been abandoned or ignored, it sank. For anyone deciding which vocabulary to reuse, the ranking acted as a useful shortcut, a rough measure of what the community had actually adopted rather than what had merely been published.</p><h3>A walk through an example</h3><p>To make this concrete, imagine you’re building that grocery app and you want a vocabulary that describes fruit.</p><p>You would go to a tool like Swoogle and search for a term such as “fruit” or “apple.” Thanks to partial matching, you would also catch variants like Fruit, FruitType, or hasFruit. The results would show you the terms and the ontologies that define them.</p><p>Then the ranking would help. If one ontology’s “Fruit” class were used by many datasets and imported by other ontologies, it would rank high, a sign that many people had already settled on it. If another were an isolated file that nobody referenced, it would rank low.</p><p>You could open the top result and look at its metadata. How big is it? What does it depend on? Which documents use it? That would tell you whether adopting it would tie you to a healthy ecosystem or to a dead end.</p><p>And if you searched for “apple” in a business setting, you would find a different set of results, terms related to companies, products, and organizations. The same word would lead to different concepts, because the search worked on defined terms and not on loose text. That’s a small illustration of the whole idea: meaning attached to the data, so that “apple” the fruit and “Apple” the company never need to be confused.</p><p>This is an illustration of the kind of workflow the system supported, not a record of specific results the real system returned.</p><h3>What people did with it</h3><p>In practice, Swoogle gave people a handful of useful moves.</p><p>You could <strong>search for ontologies and terms</strong> by keyword, with forgiving matching. You could <strong>search for datasets</strong> that described a particular kind of thing. You could <strong>open an ontology</strong> and inspect its size, its dependencies, and the documents that used it.</p><p>Researchers could also <strong>study the Semantic Web as a whole</strong>. Because Swoogle had crawled and analyzed so many documents, its index produced statistics about how big the Semantic Web was, how fast it was growing, which languages and vocabularies were popular, and how its documents connected. For a field that was still trying to understand its own shape, that was valuable. It turned a vague sense of “the Semantic Web is growing” into something that could be measured.</p><p>And because software could call the service directly, an application could discover relevant vocabularies on its own while running. That was the kind of machine-to-machine behavior that the Semantic Web had promised from the start.</p><h3>Why it mattered</h3><p>Swoogle never had mass appeal, and it was never trying to. Its importance lies in what it demonstrated.</p><p><strong>It treated the Semantic Web as something you could crawl, index, and search.</strong> Before systems like this, there was no systematic way to find RDF and OWL content at scale. Swoogle showed that it could be done, and that a searchable index of machine-readable knowledge was a realistic goal.</p><p><strong>It showed that ranking has to respect meaning.</strong> The idea that the <em>type</em> of a link carries information, and that a ranking algorithm should reflect the semantics of a relationship, was a real contribution. It went beyond simply copying PageRank into a new setting.</p><p><strong>It backed ontology reuse.</strong> By making existing vocabularies discoverable, and by showing which ones people actually used, it supported one of the central principles of the Semantic Web.</p><p><strong>It influenced what came next.</strong> Systems such as Watson, Sindice, Falcons, and SWSE are often mentioned as part of the same line of work, tackling related problems of finding and searching semantic data. Later research on searching Linked Data built on lessons from this early generation.</p><h3>Where it fell short</h3><p>It would be dishonest to tell this story as a pure success. Swoogle had real limits, and understanding them is part of understanding the story.</p><p><strong>The Semantic Web never grew as big as hoped.</strong> A search engine is only as useful as the content it can index. The Semantic Web did grow, but it never came close to the size of the ordinary web. The grand vision of every website publishing rich structured data did not happen the way early supporters hoped. A great search engine for a small web is still a search engine for a small web.</p><p><strong>Discovery had blind spots.</strong> Swoogle found content mostly by crawling for file types and following links. Data that sat inside databases, or that was exposed only through query endpoints such as SPARQL, was largely out of its reach. A lot of valuable structured data was simply invisible to it.</p><p><strong>Quality was uneven.</strong> Plenty of published ontologies were duplicated, half-finished, badly documented, or abandoned. Ranking could push the better ones up, but it could not make weak ones strong. A search engine can surface what exists. It cannot improve it.</p><p><strong>It was a research project.</strong> The main work took place in the mid-to-late 2000s, and the project is no longer actively developed. Keeping a public search service running year after year takes steady funding and maintenance, and research prototypes rarely get either. Its public service has been unreliable or offline in recent years, so if you want to try it, check first whether it is running.</p><h3>What came after</h3><p>The system faded, but the problem did not go away, and neither did the ideas behind it.</p><p>The <strong>Linked Open Data</strong> movement grew into a large network of connected public datasets, which gave the Semantic Web real content on a meaningful scale. <strong>schema.org</strong>, backed by the major search engines, brought structured markup into everyday web publishing, so that millions of ordinary sites now describe their content in machine-readable ways. A recipe page can say that it is a recipe, a product page can say what the product is and how much it costs, and search engines can use that to show richer results.</p><p><strong>Knowledge graphs</strong>, such as Google’s Knowledge Graph and Wikidata, put structured facts at the center of modern search and question answering. In a knowledge graph, “Apple” the company and “apple” the fruit are different entities with different identities, which is exactly the distinction that the Semantic Web was designed to make.</p><p>And repositories such as <strong>Linked Open Vocabularies (LOV)</strong> and <strong>BioPortal</strong> now do much of what Swoogle once did, helping people find, compare, and reuse ontologies in their own domains.</p><p>So when your phone answers “how tall is the Eiffel Tower?” with a direct figure instead of a list of links, or when a search for “apple” offers you a card about the company next to a card about the fruit, you’re seeing the descendants of the same idea: knowledge that is structured, connected, and findable.</p><h3>Closing thoughts</h3><p>Go back to the questions we started with. Which “apple” did you mean? Does a vocabulary for courses and lecturers already exist? Can a program find it, and can it trust what it finds?</p><p>Swoogle was one of the first serious attempts to answer those questions. It did not win the way Google did, and the web it was built for never fully arrived. But it showed that if machines are going to work with knowledge on the web, they need a way to find that knowledge, and that finding it means paying attention to meaning, not just to words and links.</p><p>That lesson has not gone out of date. Every time a search result understands that you were asking about the company and not the fruit, a little of Swoogle’s thinking is at work.</p><p><strong>References</strong></p><ul><li>Ding, L., Finin, T., Joshi, A., Pan, R., et al. “Swoogle: A Search and Metadata Engine for the Semantic Web.” CIKM 2004.</li><li>Ding, L., Pan, R., Finin, T., Joshi, A., et al. “Finding and Ranking Knowledge on the Semantic Web.” ISWC 2005.</li><li>Berners-Lee, T., Hendler, J., Lassila, O. “The Semantic Web.” <em>Scientific American</em>, 2001.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7aaac760b46c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Replication in Distributed Systems: Why Netflix, WhatsApp, and Your Bank All Depend on It]]></title>
            <link>https://medium.com/@sanmugarasathaoogithan/replication-in-distributed-systems-why-netflix-whatsapp-and-your-bank-all-depend-on-it-18c4ec29d588?source=rss-b85ff4b6f7e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/18c4ec29d588</guid>
            <dc:creator><![CDATA[Sanmugarasa Thanoogithan]]></dc:creator>
            <pubDate>Sat, 08 Aug 2026 19:59:59 GMT</pubDate>
            <atom:updated>2026-08-08T19:59:59.542Z</atom:updated>
            <content:encoded><![CDATA[<p>Every time Netflix loads instantly, your WhatsApp message arrives in the right order, or your bank shows the correct balance during an internet outage, there is a hidden technology at work: replication.</p><p>In simple terms, replication means keeping more than one copy of the same data on multiple computers (or servers). The tricky part is making sure all those copies agree with each other. This guide breaks down the core ideas using everyday examples.</p><h3>Why replicate anything in the first place?</h3><p>There are three real reasons systems do this, and they’re not the same thing.</p><h3>1. Performance</h3><p>Your browser caches web pages. A CDN like Cloudflare caches videos closer to you geographically. A busy website doesn’t rely on a single server — it binds several server IP addresses to the same domain name, and DNS quietly rotates you between them.</p><p>Here’s the catch, though: <strong>caching immutable data</strong> (like a video that never changes) is basically free performance. But <strong>caching data that changes often</strong> (like your bank balance) is expensive, because now you need a whole protocol just to keep every copy fresh. That’s the ceiling on how much performance replication alone can buy you.</p><h3>2. Availability</h3><p>Availability means <em>the service is actually reachable, most of the time, with decent response speed.</em> Two things threaten this — servers crashing, and network partitions (disconnections, often caused by something as mundane as your phone losing signal).</p><p>Replication fixes this mathematically. If each of <em>n</em> replicas independently has a failure probability of <em>p</em>, then:</p><p><strong>Availability = 1 − pⁿ</strong></p><p>Say one server has a 5% chance of failing. With just 2 independent replicas: 1 − (0.05 × 0.05) = 1 − 0.0025 = <strong>99.75%</strong></p><p>That single equation is the entire reason cloud providers push “multi-zone” deployments so hard — more independent copies, exponentially less chance they <em>all</em> fail together.</p><p>One subtlety worth remembering: caching isn’t the same as availability. A cache might have file A cached but not file B — so it speeds things up, but it doesn’t guarantee the <em>whole</em> application stays usable. Full replication does.</p><h3>3. Fault tolerance</h3><p>“Available” just means the service answers you. “Fault-tolerant” means it answers you <em>correctly</em> — with fresh, accurate data — no matter what’s failing behind the scenes. An ATM that responds instantly but shows the wrong balance is available is notfault-tolerant. One that takes an extra second but always shows the truth <em>is</em> fault-tolerant. That distinction is the whole ballgame in serious systems like banking.</p><p>And on top of all this sits one design goal: <strong>replication transparency</strong> — the user should never know any of this is happening. You just see “Netflix,” not “replica server 14 in Singapore.”</p><h3>What actually happens when you send a request?</h3><p>Picture placing an order through a food delivery app that’s backed by several kitchen branches acting as replicas. Every single request — no matter the system — goes through the same five stages:</p><ol><li><strong>Request</strong> — you place the order; it goes to one branch, or is broadcast to several.</li><li><strong>Coordination</strong> — the branches figure out <em>whether</em> to accept it and <em>in what order</em>, especially if two people just ordered the last item.</li><li><strong>Execution</strong> — the food actually gets made.</li><li><strong>Agreement</strong> — the branches confirm to each other that this order is done.</li><li><strong>Response</strong> — you get your confirmation.</li></ol><p>This five-step shape is the backbone of the rest of the article — every replication strategy below is really just a different answer to “how do we do steps 2 and 4?”</p><h3>Keeping everyone’s messages in the right order</h3><p>This is where replication gets genuinely tricky. If updates are coming from many directions into many replicas, how do you stop different replicas from seeing events in different, contradictory orders?</p><p>There are three levels of guarantee, each stronger than the last.</p><p><strong>FIFO ordering</strong> protects only <em>your own</em> sequence: if you send message A and then message B, everyone must see A before B — but a message from someone <em>else</em> can land anywhere relative to yours. Think of your own WhatsApp messages: always in order relative to each other, interleaved however with everyone else’s.</p><p><strong>Causal ordering</strong> goes further: if message A directly <em>caused</em> message B — like a reply — then B must never appear before A, anywhere, for anyone. A Facebook reply must never render before the comment it’s replying to. But two people commenting on totally unrelated posts have no such constraint between them.</p><p><strong>Total ordering</strong> is the strictest: <em>every</em> replica sees <em>the exact same sequence</em> of events, even ones that have nothing to do with each other causally. A shared ledger — a bank, or a blockchain — needs this, because if two replicas applied unrelated transactions in different orders, they could end up with two different account balances for the same account.</p><p>So how do you actually <em>make</em> total ordering happen? Two classic approaches:</p><p><strong>A central lock server.</strong> One coordinator process holds the keys. Want to do something? Send it a lock request and wait. If the resource is free, you get a grant; otherwise, you&#39;re queued. When you&#39;re done, you unlock, and the coordinator lets the next process in line proceed. Simple — but that one coordinator is now a bottleneck, and worse, a single point of failure. It&#39;s the same trade-off you accept using one Redis instance as a distributed lock manager.</p><p><strong>Token passing.</strong> Arrange every process into a logical ring. A single token circulates continuously; you may only act while holding it, and you pass it along when you’re done. No bottleneck, no single point of failure — but if the ring is large, you might wait a long time for the token to reach you, even if the resource has been sitting free the whole time. This is literally how old Token Ring office networks worked decades before Wi-Fi existed.</p><h3>Who’s actually in the group right now?</h3><p>Real systems don’t have a fixed, unchanging set of replicas forever — processes join, leave, and crash while the system is running. So there needs to be a <strong>group membership service</strong> tracking exactly who’s currently considered “in.”</p><p>Here’s the part that surprises most people: a process can be voted <em>out</em> of the group even if it never actually crashed. If it just becomes temporarily unreachable — a network hiccup, a brief partition — the rest of the group may mark it as <em>suspected</em> and exclude it, cutting off all future messages to it, even though it’s still alive and running fine on the inside.</p><p>This is exactly what happens when a Kafka broker misses a few heartbeat signals and gets marked “down,” its work reassigned — even though the broker process itself never stopped. The danger appears if that broker reconnects and still believes it’s in charge of something another node has since taken over. Distributed systems have to be designedvery carefully around this so two nodes never both think they’re “the boss” simultaneously.</p><h3>Two philosophies for fault-tolerant replication</h3><h3>Passive replication: one boss, several understudies</h3><p>In this model, there’s always exactly <strong>one primary</strong> replica manager, and one or more <strong>backups</strong>. Clients only ever talk to the primary. The primary does the work and streams updates to the backups; if it dies, a backup steps up.</p><p>Walking through the five phases again, but now specifically for passive replication:</p><ol><li><strong>Request</strong> — the client sends a uniquely identifiedrequest to the primary.</li><li><strong>Coordination</strong> — the primary processes requests atomically, one at a time, in arrival order — and checks the ID to avoid accidentally redoing a request it already handled.</li><li><strong>Execution</strong> — the primary runs the operation and stores the result.</li><li><strong>Agreement</strong> — if it’s an update, the primary pushes the new state to every backup, and they acknowledge.</li><li><strong>Response</strong> — the primary replies to the client.</li></ol><p>This is exactly how a typical PostgreSQL or MySQL setup works: one primary handles writes, replicas stream the changes, and a tool like Patroni watches the primary and promotes a replica automatically if it dies.</p><p>For this to be <em>correct</em>, two things must hold: exactly <strong>one</strong> backup must take over (never two — that would cause two “primaries” issuing conflicting answers), and the surviving replicas must <strong>agree on exactly what had already been done</strong> before the crash. Systems guarantee both using something called <em>view-synchronous</em> group communication — either all the backups see a given update before the new membership view, or none of them do. So the new primary never has to interrogate anyone about “what did you last see?” — everyone already agrees.</p><h3>Active replication: no boss, just a chorus that sings in sync</h3><p>Here, there’s no primary at all. Every replica manager is an equal, independent state machine, and <em>all of them</em> process <em>every</em> request, identically, on their own. If one crashes, nobody notices — the rest just keep going.</p><p>The five phases, active-replication style:</p><ol><li><strong>Request</strong> — the client multicasts the request (with a unique ID) to the entire group, using a <em>totally ordered, reliable</em> multicast, and waits for a response before sending the next one.</li><li><strong>Coordination</strong> — the multicast delivers the request to every surviving replica in the exact same order.</li><li><strong>Execution</strong> — every replica processes it identically, since they’re all state machines fed the same order.</li><li><strong>Agreement</strong> — skipped entirely! The strong guarantees of the multicast already make agreement automatic.</li><li><strong>Response</strong> — every replica replies; the client just keeps the first response and throws away the rest.</li></ol><p>This is the philosophy behind consensus systems like etcd or Google Spanner, built on Raft or Paxos — every node independently applies the same sequence of operations and, because they started in the same state and saw the same order, they converge to the same result without ever needing a separate “let’s agree” conversation.</p><p><strong>Which one wins?</strong> Passive replication is simpler and works well if you can tolerate a short pause during failover. Active replication has zero downtime — every replica is always ready — but demands a much stronger (and harder to build) messaging guarantee to work correctly.</p><h3>What happens to a transaction that spans replicated data?</h3><p>If you already know two-phase commit (2PC) — coordinator asks workers “canCommit?”, then tells them “doCommit” or “doAbort” — replication adds a wrinkle: if the coordinator or a worker is <em>itself</em> replicated, it now has to fan its own messages out to its own group first. This turns 2PC into a <strong>nested, two-level protocol</strong> — each level has to agree internally before it can answer the level above it. CockroachDB does exactly this: a transaction spans several shards, and each shard’s own replicas must agree with each other before that shard can tell the coordinator “commit confirmed.”</p><p>Two common strategies handle the replicas themselves:</p><p><strong>Primary copy replication</strong> — every request, reads included, goes to one designated primary. It applies concurrency control locally, pushes the update to its backups, then replies. Amazon RDS does this: writes always go to the primary, even when there are several read replicas available.</p><p><strong>Read-one/write-all</strong> — reads can go to <em>any single</em> replica (fast, cheap, just grab a read lock there). But a write must be applied at <em>every</em> replica, each of which takes a write lock. This guarantees something called <strong>one-copy serializability</strong>: any two writes to the same object will conflict everywhere (since writes touch every replica), and a read/write pair will conflict wherever that particular read happened to occur. It’s the model behind strongly consistent configuration stores — reads are cheap because any node has the truth, writes are deliberately expensive because they must reach everyone.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18c4ec29d588" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building CI/CD pipelines with GitHub Actions: A practical Guide for Express.js,]]></title>
            <link>https://medium.com/@sanmugarasathaoogithan/building-ci-cd-pipelines-with-github-actions-a-practical-guide-for-express-js-392945aea441?source=rss-b85ff4b6f7e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/392945aea441</guid>
            <dc:creator><![CDATA[Sanmugarasa Thanoogithan]]></dc:creator>
            <pubDate>Wed, 27 May 2026 17:54:59 GMT</pubDate>
            <atom:updated>2026-05-27T17:54:59.351Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building CI/CD pipelines with GitHub Actions: A practical Guide for Express.js, Next.js, and PostgreSQL</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/0*AM_KJN7vXtfcL--Z" /></figure><p>Imagine you are working on a real-world web application used by actual customers. One day, you fix a bug and add a new feature. After completing the work, you have to deploy everything to the production server manually.</p><p>First, you open your terminal and connect to the server using SSH. Then you pull the latest code from GitHub, install dependencies, run database migrations, build the frontend, restart the Node.js application, and finally check whether the website is still working properly.</p><p>At first, this process may seem manageable. But as the project grows, deployments become stressful and risky. A small mistake — like forgetting to run a migration, missing an environment variable, or restarting the wrong process — can break the entire application. Sometimes deployments take too long, and sometimes different team members follow different steps, creating inconsistent results.</p><p>Now imagine doing this every single time you push an update. This is where CI/CD becomes extremely useful.</p><h3><strong>Introduction</strong></h3><p>CI/CD (Continuous Integration and Continuous Deployment) automates the deployment workflow. Instead of manually handling everything, your system automatically tests, builds, and deploys the application whenever new code is pushed to the repository. This reduces human errors, saves time, and makes deployments faster and more reliable.</p><p>In this guide, I’ll show you how I set up a CI/CD pipeline using GitHub Actions for a modern web application built with:</p><ul><li>Express.js — REST API backend</li><li>Next.js — Frontend / full-stack React framework</li><li>PostgreSQL — Relational database</li></ul><p>By the end, you’ll have a working pipeline and a clear understanding of how to adapt it to your own project. I’ll also cover alternative CI/CD tools in case GitHub Actions isn’t the right fit for you.</p><h3><strong>Why CI/CD Matters.</strong></h3><h4><strong>Before diving into code, here’s the core idea:</strong></h4><p>Continuous Integration (CI): Every code push triggers automated tests. If something breaks, you know immediately — before it reaches production.</p><p>Continuous Deployment (CD): Once tests pass, the code is automatically deployed. No manual steps, no forgotten migration scripts.</p><p>The result? Fewer bugs in production, faster release cycles, and a much calmer deployment day.</p><p>Setting Up GitHub Actions GitHub Actions is built directly into GitHub — no third-party account needed. Workflows are defined in YAML files inside .github/workflows/ in your repository.</p><p><strong>Project Structure</strong></p><p>my-app/<br>├── .github/<br>│ └── workflows/<br>│ └── ci-cd.yml<br>├── backend/ # Express.js API<br>├── frontend/ # Next.js app<br>└── package.json</p><p><strong>The Workflow File</strong></p><p>Create .github/workflows/ci-cd.yml:</p><pre>name: Backend CI<br><br>on:<br>  push:<br>    branches: [&#39;**&#39;]<br>  pull_request:<br>    branches: [develop, main]<br><br>jobs:<br><br>  lint:<br>    name: Lint &amp; Format Check<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: Checkout code<br>        uses: actions/checkout@v4<br><br>      - name: Setup Node.js<br>        uses: actions/setup-node@v4<br>        with:<br>          node-version: &#39;20&#39;<br>          cache: &#39;npm&#39;<br><br>      - name: Install dependencies<br>        run: npm ci<br><br>      - name: Run ESLint<br>        run: npm run lint<br><br>      - name: Run Prettier check<br>        run: npm run format:check<br><br>  build:<br>    name: Build Check<br>    needs: lint<br>    runs-on: ubuntu-latest<br>    steps:<br>      - uses: actions/checkout@v4<br>      - uses: actions/setup-node@v4<br>        with:<br>          node-version: &#39;20&#39;<br>          cache: &#39;npm&#39;<br>      - run: npm ci<br>      - run: npm run build<br><br>  unit-test:<br>    name: Unit Tests<br>    needs: build<br>    runs-on: ubuntu-latest<br>    steps:<br>      - uses: actions/checkout@v4<br>      - uses: actions/setup-node@v4<br>        with:<br>          node-version: &#39;20&#39;<br>          cache: &#39;npm&#39;<br>      - run: npm ci<br>      - name: Run unit tests with coverage<br>        run: npm run test:coverage<br>      - name: Upload coverage report<br>        uses: actions/upload-artifact@v4<br>        with:<br>          name: coverage-report<br>          path: coverage/<br><br><br>  integration-test:<br>    name: Integration Tests<br>    needs: unit-test<br>    runs-on: ubuntu-latest<br>    if: |<br>      github.ref == &#39;refs/heads/develop&#39; ||<br>      github.base_ref == &#39;develop&#39;<br>    services:<br>      postgres:<br>        image: postgres:16<br>        env:<br>          POSTGRES_DB: stackstorm_test<br>          POSTGRES_USER: test_user<br>          POSTGRES_PASSWORD: test_pass<br>        ports:<br>          - 5432:5432<br>        options: &gt;-<br>          --health-cmd pg_isready<br>          --health-interval 10s<br>          --health-timeout 5s<br>          --health-retries 5<br>      redis:<br>        image: redis:7<br>        ports:<br>          - 6379:6379<br>        options: &gt;-<br>          --health-cmd &quot;redis-cli ping&quot;<br>          --health-interval 10s<br>          --health-retries 5<br>    env:<br>      DATABASE_URL: postgres://test_user:test_pass@localhost:5432/stackstorm_test<br>      REDIS_URL: redis://localhost:6379<br>      JWT_SECRET: test_secret_for_ci_only<br>      NODE_ENV: test<br>    steps:<br>      - uses: actions/checkout@v4<br>      - uses: actions/setup-node@v4<br>        with:<br>          node-version: &#39;20&#39;<br>          cache: &#39;npm&#39;<br>      - run: npm ci<br>      - name: Run database migrations<br>        run: npx sequelize-cli db:migrate<br>      - name: Run integration tests<br>        run: npm run test:integration<br><br>  <br>  security:<br>    name: Security Audit<br>    needs: unit-test<br>    runs-on: ubuntu-latest<br>    steps:<br>      - uses: actions/checkout@v4<br>      - uses: actions/setup-node@v4<br>        with:<br>          node-version: &#39;20&#39;<br>          cache: &#39;npm&#39;<br>      - run: npm ci<br>      - name: Run security audit<br>        run: npm audit --audit-level=high</pre><h3>Breaking Down the Pipeline</h3><p><strong>1. Trigger Events</strong></p><pre>on:<br>  push:<br>    branches: [main]<br>  pull_request:<br>    branches: [main]</pre><p>This runs the pipeline on every push to main and on every pull request targeting main. The PR trigger is especially useful — it gives you a green/red check before you merge.</p><p><strong>2. Spinning Up PostgreSQL as a Service</strong></p><p>One of GitHub Actions’ most powerful features for backend developers:</p><pre>services:<br>  postgres:<br>    image: postgres:15<br>    env:<br>      POSTGRES_USER: testuser<br>      POSTGRES_PASSWORD: testpassword<br>      POSTGRES_DB: testdb<br>    ports:<br>      - 5432:5432</pre><p>This spins up a real PostgreSQL instance alongside your tests — no mocking, no in-memory database. Your Express.js tests run against an actual database, just like in production.</p><p><strong>3. Caching Node Modules</strong></p><pre>- name: Set up Node.js<br>  uses: actions/setup-node@v4<br>  with:<br>    node-version: &#39;20&#39;<br>    cache: &#39;npm&#39;</pre><p>The cache: &#39;npm&#39; option caches your node_modules between runs. On a typical project, these cuts install time from ~60 seconds to under 5.</p><p><strong>4. Running Migrations Before Tests</strong></p><pre>- name: Run database migrations<br>  env:<br>    DATABASE_URL: postgresql://testuser:testpassword@localhost:5432/testdb<br>  run: npm run migrate</pre><p>Never skip this step. Running tests against an uninitialized schema will give you misleading failures. Run your migrations first, then your test suite.</p><p><strong>5. Secrets Management</strong></p><p>Sensitive values like API keys and server credentials should <strong>never</strong> be hardcoded in your workflow file. Store them in <strong>Settings → Secrets and variables → Actions</strong> in your GitHub repo:</p><pre>env:<br>  DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}<br>  DATABASE_URL: ${{ secrets.DATABASE_URL }}</pre><h4>Deploying Next.js</h4><p>For your Next.js frontend, the deployment step depends on where you host it. Here are two common options:</p><p><strong>Vercel :</strong></p><pre>- name: Deploy to Vercel<br>  uses: amondnet/vercel-action@v25<br>  with:<br>    vercel-token: ${{ secrets.VERCEL_TOKEN }}<br>    vercel-org-id: ${{ secrets.ORG_ID }}<br>    vercel-project-id: ${{ secrets.PROJECT_ID }}<br>    vercel-args: &#39;--prod&#39;</pre><p>Self-hosted server via SSH:</p><pre>- name: Deploy via SSH<br>  uses: appleboy/ssh-action@v1.0.0<br>  with:<br>    host: ${{ secrets.SERVER_HOST }}<br>    username: ${{ secrets.SERVER_USER }}<br>    key: ${{ secrets.SSH_PRIVATE_KEY }}<br>    script: |<br>      cd /var/www/my-app<br>      git pull origin main<br>      npm ci --production<br>      npm run build<br>      pm2 restart all</pre><h3>Alternatives to GitHub Actions</h3><p>GitHub Actions is my recommendation when your code already lives on GitHub — the zero-setup integration is hard to beat. But depending on your team, infrastructure, or hosting provider, one of these alternatives might be a better fit.</p><h4>GitLab CI/CD</h4><p>If your repository is on GitLab, its built-in CI/CD is the natural choice. The pipeline config (.gitlab-ci.yml) is structurally similar to GitHub Actions, and the services block works the same way for PostgreSQL. GitLab also offers a built-in container registry and environment-based deploy rules out of the box. Best for teams that self-host their Git infrastructure or prefer an all-in-one DevOps platform.</p><h4>CircleCI</h4><p>CircleCI is a cloud-native CI/CD service that connects to GitHub or Bitbucket repos. It’s known for <strong>fast build caching</strong> — particularly for node_modules — and a concept called <em>orbs</em>, which are reusable config packages. There&#39;s an official node orb and a postgres orb that reduce your CI config to just a few lines. Worth considering if build speed is a priority.</p><h4>Jenkins</h4><p>Jenkins is the veteran — fully open source, self-hosted, and extended by over 1,800 plugins. You define pipelines using a Jenkinsfile (Groovy syntax) that lives in your repo. It has the highest flexibility of any option here, but also the highest operational overhead: you manage the server, updates, and scaling yourself. Best suited for enterprise teams with dedicated DevOps engineers or complex multi-step pipelines.</p><h4>Azure Pipelines</h4><p>Microsoft’s CI/CD offering within Azure DevOps. The YAML syntax is close to GitHub Actions, and it integrates tightly with Azure services — App Service, AKS, Container Apps, and Azure Functions. If you’re deploying your Express.js API or Next.js app to Azure, this is the most natural fit, with built-in support for environments, approvals, and release gates.</p><h4>Google Cloud Build</h4><p>A serverless, container-native CI/CD service from GCP. Each step in your pipeline runs inside a Docker container, and it integrates directly with Cloud Run, GKE, and Artifact Registry. If you’re already in the Google Cloud ecosystem, Cloud Build eliminates the need for a separate CI service entirely.</p><h4>Buildkite</h4><p>A hybrid model: orchestration lives in Buildkite’s cloud, but your build agents run on your own infrastructure (EC2, GKE, bare metal). This gives you the convenience of a managed UI with the speed and data-privacy benefits of running builds locally. Popular at fast-growing startups and scale-ups that have outgrown shared CI runners.</p><h4>Drone CI</h4><p>A lightweight, open-source CI tool that is fully container-native — every pipeline step runs inside Docker. The config (.drone.yml) is clean and minimal. A good choice if you want simplicity, self-hosting, and no vendor lock-in.</p><h4>Consider these before you Ship</h4><p><strong>Test your workflow locally first.</strong> Use <a href="https://github.com/nektos/act">act</a> — a tool that runs GitHub Actions locally using Docker. It catches YAML syntax errors and missing secrets before you push.</p><p><strong>Keep jobs focused.</strong> Separate your test job from your deploy job. The needs: test dependency ensures deployment only happens after tests pass.</p><p><strong>Use environmental protection rules.</strong> In GitHub, you can require manual approval before deploying to production. Go to Settings → Environments → Add environment → Add required reviewers.</p><p><strong>Pin your action versions.</strong> Use actions/checkout@v4 rather than actions/checkout@main to avoid unexpected breaking changes from upstream updates.</p><h4><strong>Conclusion</strong></h4><p>A CI/CD pipeline is one of the highest-leverage investments you can make in a codebase. A few hours of setup save you from deployment anxiety on every future release.</p><p>For an Express.js + Next.js + PostgreSQL stack on GitHub, GitHub Actions is the most frictionless starting point. But as your team grows or your infrastructure needs change, GitLab CI, CircleCI, and the other tools covered here are all worth exploring.</p><p>The config in this article is a working starting point — adapt the deploy step to match wherever you host (Vercel, Render, Railway, AWS, DigitalOcean), and you’ll have a production-ready pipeline in under an hour.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=392945aea441" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why computers can’t just talk to each other — and how marshalling fixes that]]></title>
            <link>https://medium.com/@sanmugarasathaoogithan/why-computers-cant-just-talk-to-each-other-and-how-marshalling-fixes-that-5dd047a8a9fb?source=rss-b85ff4b6f7e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/5dd047a8a9fb</guid>
            <dc:creator><![CDATA[Sanmugarasa Thanoogithan]]></dc:creator>
            <pubDate>Tue, 12 May 2026 07:44:55 GMT</pubDate>
            <atom:updated>2026-05-12T07:44:55.776Z</atom:updated>
            <content:encoded><![CDATA[<p>“A deep guide to External Data Representation: what it is, why it exists, and how CORBA CDR, Java Serialization, and XML each solve it differently — with real-world analogies and working code throughout.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/0*nrjPPQabl_T8SLeV" /></figure><p>It’s 3 a.m. The on-call phone rings. A payment processing system has been silently charging customers the wrong amounts for six hours — not because of a bug in the business logic, not because of a database failure, but because a server in Singapore was sending numbers in a different byte order than the server in London expected to receive them. Nobody noticed. No error was thrown. The data arrived intact. It was just… backwards.</p><p>This is not a hypothetical. Byte order mismatches, broken data encoding, and incompatible serialization formats have caused real outages, real financial errors, and real data corruption in production systems around the world. And they all trace back to the same root problem: <strong>two computers that don’t agree on what the data means.</strong></p><p>This article explains how the industry solved that problem — and the three very different philosophies it used to do it.</p><h3>Before we begin — a story you already know</h3><p>Imagine you are a doctor in Sri Lanka, and you receive a patient file from a hospital in Germany. The file is in German, measurements are in metric, dates are written day-first, and drug dosages use commas where you use decimal points. The information is all there. But before you can use it, someone needs to translate, convert, and reformat it into a form you can act on.</p><p>Now imagine this happens a billion times per second, between machines that speak entirely different “languages” at the hardware level. That is the problem that External Data Representation (EDR) was invented to solve.</p><p>The mechanism that solves this — converting in-memory data into an agreed, portable format for transmission — is called <strong>marshalling</strong>. The reverse — reconstructing the original data from received bytes — is called <strong>unmarshalling</strong>. Together, they are the foundation of every distributed system you have ever used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*ujW2IyOIE8XaVyOOAdVL6A.png" /><figcaption>Three major standards emerged to solve this problem, each reflecting a different philosophy about what matters most. Let’s go through them one by one — deeply, with code and real-world context.</figcaption></figure><h3>CORBA CDR — when precision is non-negotiable</h3><p>Real-world analogy</p><p>International shipping containers are all exactly the same external dimensions — 20 or 40 feet, standardised corner fittings, standardised stacking rules. It doesn’t matter what is inside or which country the ship is from. Every crane, every truck, every port in the world knows exactly how to handle it. CORBA CDR is the shipping container of data formats: a rigid, universal standard that makes everything interoperable, no matter what’s inside.</p><p>CORBA (Common Object Request Broker Architecture) was designed in the 1990s to allow objects written in any programming language — Java, C++, COBOL, Ada — running on any operating system, to communicate transparently. Its answer to the marshalling problem is CDR: Common Data Representation.</p><p>CDR is a <strong>binary format</strong>. Data is encoded as compact sequences of raw bytes — not human-readable text. Every data type has a precise, fixed encoding rule. Before any communication happens, both sides must agree on a schema written in CORBA’s <strong>Interface Definition Language (IDL)</strong>. This schema is compiled into stub code for each language, which handles all marshalling automatically.</p><h3>Code example — IDL schema definition</h3><p>CORBA IDL — employee.idl</p><pre>// Shared between ALL parties at compile time.<br>// IDL compiler generates stubs in Java, C++, Python, etc.<br><br>module HRSystem {<br>  struct Address {<br>    string street;<br>    string city;<br>    string country;<br>  };<br>  struct Employee {<br>    long    id;       // always 4 bytes in CDR<br>    string  name;     // 4-byte length prefix + UTF-8 chars<br>    float   salary;   // 4 bytes, IEEE 754 encoding<br>    Address address;  // nested struct, laid out sequentially<br>  };<br>  interface EmployeeService {<br>    Employee getEmployee(in long id);<br>    void     updateSalary(in long id, in float newSalary);<br>    boolean  deleteEmployee(in long id);<br>  };<br>};</pre><p>When a Java client calls getEmployee(101) on a C++ server, the Java stub marshals the integer into 4 bytes using CDR rules, sends it over TCP, and the C++ skeleton unmarshals those 4 bytes back into a native C++ long. The returned Employee struct — including the nested Address — travels as a compact binary stream. No tags. No descriptions. No wasted bytes.</p><h3>What travels on the wire — byte by byte</h3><p>CDR wire layout (conceptual)</p><pre>Employee { id=101, name=&quot;Alice&quot;, salary=72000.0 }</pre><pre>Bytes  0–3  :  00 00 00 65     →  id = 101 (big-endian long)<br>Bytes  4–7  :  00 00 00 05     →  name length = 5 chars<br>Bytes  8–12 :  41 6C 69 63 65  →  &quot;Alice&quot; in UTF-8<br>Byte   13   :  00              →  alignment padding byte<br>Bytes 14–17 :  47 8C 80 00     →  salary = 72000.0 (IEEE 754 float)</pre><pre>Total: 18 bytes<br>Equivalent XML: 65+ characters  (261% larger)</pre><p>Why alignment matters</p><p>CDR aligns each field to its natural boundary — a 4-byte integer starts at a byte offset divisible by 4. This matches how CPUs read memory most efficiently. It adds occasional padding bytes but makes parsing extremely fast — no scanning, just jump to the known offset and read.</p><p>Strengths</p><ul><li>Extremely compact — no markup overhead</li><li>Language and platform independent via IDL</li><li>Fast to marshal and unmarshal (fixed byte offsets)</li><li>Handles complex nested types and object references</li><li>Deterministic layout — easy to cache and optimise</li></ul><p>Weaknesses</p><ul><li>Binary — impossible to debug without special tools</li><li>Tightly coupled to the CORBA ecosystem</li><li>IDL schema must be compiled upfront by all parties</li><li>Steep learning curve and complex toolchain</li><li>Largely replaced by modern alternatives in new systems</li></ul><p><strong>Best suited for:</strong> telecommunications middleware, military systems, and legacy banking infrastructure — anywhere built in the 1990s where efficiency and reliability are non-negotiable.</p><h3>Java object serialization — convenience with hidden costs</h3><p>Real-world analogy</p><p>Imagine a photocopier that copies not just the paper, but the whole filing cabinet — every folder referenced from that paper, and every document in those folders, automatically. That’s Java Object Serialization. You press one button, and the entire object graph gets copied faithfully. It’s magical — until you realize the copy only works in the same office building (the JVM), and the security guard has serious concerns about what gets scanned.</p><p>Java Object Serialization is a mechanism built directly into the Java runtime. Any class that implements the Serializable interface can be converted to a byte stream and reconstructed later , with almost no developer effort.</p><p>The runtime uses <strong>reflection</strong> to inspect the object, reads every non-transient field, writes the class name and a version fingerprint (serialVersionUID), then writes each field&#39;s type and value sequentially. Most powerfully, it handles entire <strong>object graphs</strong> automatically — if your Order contains a customer which contains an Address, all three are serialized in a single call, with circular references handled without infinite loops.</p><h3>Code example — full serialization and reserialization cycle</h3><p>Java — full object graph serialization</p><pre>import java.io.*;<br>class Address implements Serializable {<br>    private static final long serialVersionUID = 1L;<br>    String city;<br>    String country;<br>    public Address(String city, String country) {<br>        this.city = city; this.country = country;<br>    }<br>}<br>class Employee implements Serializable {<br>    private static final long serialVersionUID = 1L;<br>    int     id;<br>    String  name;<br>    double  salary;<br>    Address address;           // serialised automatically<br>    transient String password; // NOT serialised - marked transient<br>    public Employee(int id, String name, double salary, Address addr) {<br>        this.id = id; this.name = name;<br>        this.salary = salary; this.address = addr;<br>        this.password = &quot;secret123&quot;; // won&#39;t travel over the wire<br>    }<br>}<br>public class SerialDemo {<br>    public static void main(String[] args) throws Exception {<br>        Address addr = new Address(&quot;Colombo&quot;, &quot;Sri Lanka&quot;);<br>        Employee emp = new Employee(101, &quot;Alice&quot;, 72000.0, addr);<br>        // ── MARSHALLING ─────────────────────────────────<br>        try (ObjectOutputStream out =<br>                new ObjectOutputStream(<br>                    new FileOutputStream(&quot;employee.ser&quot;))) {<br>            out.writeObject(emp);<br>            System.out.println(&quot;Marshalled: &quot; + emp.name);<br>        }<br>        // ── UNMARSHALLING ───────────────────────────────<br>        try (ObjectInputStream in =<br>                new ObjectInputStream(<br>                    new FileInputStream(&quot;employee.ser&quot;))) {<br>            Employee restored = (Employee) in.readObject();<br>            System.out.println(&quot;Unmarshalled: &quot; + restored.name<br>                + &quot; from &quot; + restored.address.city);<br>            System.out.println(&quot;Password: &quot; + restored.password); // null!<br>        }<br>    }<br>}</pre><p>Console output</p><pre>Marshalled: Alice<br>Unmarshalled: Alice from Colombo<br>Password: null</pre><p>The password field — marked transient — was never written to the stream. It arrives as null on the other side. Sensitive fields should always be transient.</p><p>The versioning trap</p><p>If you add a new field to the Employee class after serializing objects and the serialVersionUID changes (or you forgot to set it), deserialization throws an InvalidClassException. In a live system, this means old, cached data becomes suddenly unreadable. Always set serialVersionUID explicitly and plan class evolution carefully.</p><p>The security trap</p><p>Java deserialization has a long history of remote code execution (RCE) vulnerabilities. Crafted byte streams can trick the JVM into executing arbitrary code during deserialization. Java’s own documentation now recommends avoiding serialization for new systems. Never reserialize data from untrusted sources.</p><p>Strengths</p><ul><li>Zero boilerplate — just implement Serializable</li><li>Handles complete object graphs automatically</li><li>Built-in versioning via serialVersionUID</li><li>Native support in Java RMI and caching layers</li><li>Circular references handled without loops</li></ul><p>Weaknesses</p><ul><li>Java-only — zero cross-language interoperability</li><li>Class changes can silently break old streams</li><li>Serious, well-documented RCE vulnerabilities</li><li>Larger payloads than Protobuf or CDR</li><li>Not suitable for public or multi-language APIs</li></ul><p><strong>Best suited for:</strong> Java-only internal systems — caching layers, session persistence, or Java RMI — where zero boilerplate matters more than interoperability.</p><h3>XML — the universal language everyone loves to complain about</h3><p>Real-world analogy</p><p>At the United Nations, every official speech is simultaneously interpreted into six languages. It is slower than if everyone spoke the same language natively. The interpreter adds overhead. But it is the only system that guarantees every nation can participate — regardless of what language they speak at home. XML is the UN interpreter of data formats: universal, inclusive, and yes, a little slow.</p><p>XML (Extensible Markup Language) represents data as <strong>human-readable, self-describing text</strong>. Every value is wrapped in named tags. Every structure is explicitly labelled. Any programming language, on any platform, with even a basic text parser can read it — no shared schema required in advance.</p><p>This universality made XML the backbone of the SOAP web services era (roughly 2000–2015) and it remains dominant in enterprise integration, government APIs, banking message formats (ISO 20022), and configuration files today.</p><h3>Code example — marshalling to XML in Python</h3><p>Python — marshal and un-marshal with XML</p><pre>import xml.etree.ElementTree as ET<br>from dataclasses import dataclass</pre><pre>@dataclass<br>class Address:<br>    street:  str<br>    city:    str<br>    country: str</pre><pre>@dataclass<br>class Employee:<br>    id:      int<br>    name:    str<br>    salary:  float<br>    address: Address</pre><pre># ── MARSHALLING: Python object → XML string ──────────────<br>def marshal(emp: Employee) -&gt; str:<br>    root = ET.Element(&quot;Employee&quot;)<br>    ET.SubElement(root, &quot;id&quot;).text     = str(emp.id)<br>    ET.SubElement(root, &quot;name&quot;).text   = emp.name<br>    ET.SubElement(root, &quot;salary&quot;).text = str(emp.salary)<br>    addr = ET.SubElement(root, &quot;Address&quot;)<br>    ET.SubElement(addr, &quot;street&quot;).text  = emp.address.street<br>    ET.SubElement(addr, &quot;city&quot;).text    = emp.address.city<br>    ET.SubElement(addr, &quot;country&quot;).text = emp.address.country<br>    return ET.tostring(root, encoding=&quot;unicode&quot;)</pre><pre># ── UNMARSHALLING: XML string → Python object ─────────────<br>def unmarshal(xml_str: str) -&gt; Employee:<br>    root = ET.fromstring(xml_str)<br>    addr_el = root.find(&quot;Address&quot;)<br>    addr = Address(<br>        street  = addr_el.findtext(&quot;street&quot;),<br>        city    = addr_el.findtext(&quot;city&quot;),<br>        country = addr_el.findtext(&quot;country&quot;)<br>    )<br>    return Employee(<br>        id      = int(root.findtext(&quot;id&quot;)),<br>        name    = root.findtext(&quot;name&quot;),<br>        salary  = float(root.findtext(&quot;salary&quot;)),<br>        address = addr<br>    )</pre><pre>emp = Employee(101, &quot;Alice&quot;, 72000.0,<br>      Address(&quot;42 Temple Road&quot;, &quot;Colombo&quot;, &quot;Sri Lanka&quot;))</pre><pre>xml_str = marshal(emp)<br>print(&quot;Wire format:\n&quot;, xml_str)</pre><pre>restored = unmarshal(xml_str)<br>print(f&quot;Restored: {restored.name}, {restored.address.city}&quot;)</pre><h3>What actually travels on the wire</h3><p>XML — wire format output</p><pre>&lt;Employee&gt;<br>  &lt;id&gt;101&lt;/id&gt;<br>  &lt;name&gt;Alice&lt;/name&gt;<br>  &lt;salary&gt;72000.0&lt;/salary&gt;<br>  &lt;Address&gt;<br>    &lt;street&gt;42 Temple Road&lt;/street&gt;<br>    &lt;city&gt;Colombo&lt;/city&gt;<br>    &lt;country&gt;Sri Lanka&lt;/country&gt;<br>  &lt;/Address&gt;<br>&lt;/Employee&gt;</pre><pre>// Output:<br>// Wire format: &lt;Employee&gt;&lt;id&gt;101&lt;/id&gt;...&lt;/Employee&gt;<br>// Restored: Alice, Colombo</pre><p>A developer who has never seen this system before can immediately understand what every field means. This is the power of XML — and also why it is <strong>3–5× larger</strong> than an equivalent binary format.</p><h3>Schema validation with XSD</h3><p>XSD — XML Schema Definition</p><pre>&lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;</pre><pre>  &lt;xs:element name=&quot;Employee&quot;&gt;<br>    &lt;xs:complexType&gt;<br>      &lt;xs:sequence&gt;<br>        &lt;xs:element name=&quot;id&quot;     type=&quot;xs:integer&quot;/&gt;<br>        &lt;xs:element name=&quot;name&quot;   type=&quot;xs:string&quot; /&gt;<br>        &lt;xs:element name=&quot;salary&quot; type=&quot;xs:decimal&quot;/&gt;<br>      &lt;/xs:sequence&gt;<br>    &lt;/xs:complexType&gt;<br>  &lt;/xs:element&gt;</pre><pre>&lt;/xs:schema&gt;</pre><pre>&lt;!-- Validation rejects malformed documents BEFORE<br>     your application logic ever sees the data. --&gt;</pre><p>Why XSD matters in open systems</p><p>In open distributed systems — like a bank receiving payment messages from thousands of partner institutions — you cannot trust that every sender’s implementation is correct. XSD validation is a contract enforcer at the door: it rejects malformed data before it enters your system, not after it has already corrupted your database.</p><p>Strengths</p><ul><li>Universal — any language, any platform, any era</li><li>Self-describing — readable without documentation</li><li>XSD enables strict schema enforcement at ingestion</li><li>Dominant in SOAP, ISO 20022, government APIs</li><li>Trivial to debug — just open a text editor</li></ul><p>Weaknesses</p><ul><li>3–5× larger payloads than equivalent binary formats</li><li>Slow to parse — must scan characters, not jump to offsets</li><li>High CPU and memory overhead at scale</li><li>XXE injection attacks if parser is misconfigured</li><li>Verbose XSD schemas are complex to write and maintain</li></ul><p><strong>Best suited for:</strong> web services, open APIs, configuration files, and cross-organisation integration where readability and interoperability matter more than performance.</p><p>Section 4 of 5</p><h3>Head-to-head comparison</h3><p>Same employee record — id=101, name=&quot;Alice&quot;, salary=72000 — sent using all three formats, everything else equal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*n_mww1mMVqEe6wiVIILePA.png" /></figure><p>There is no universally correct choice. A high-frequency trading system and a public government API have opposite requirements. Knowing which format to choose — and why — is the actual engineering skill.</p><h3>Modern extensions — what comes after these three</h3><p>CDR, Java Serialization, and XML are foundational — but modern systems frequently reach for lighter, more flexible descendants. Each one learned from the limitations of its predecessors.</p><h4>Protocol Buffers (Protobuf)</h4><p>Google’s binary format. Schema-first like CDR, but cross-language and far smaller payloads. The default format for gRPC. CDR for the modern era — without the CORBA baggage.</p><h4>JSON</h4><p>Text-based, like XML but far less verbose. The de facto standard for REST APIs. Readable and universal, but no built-in type enforcement without a separate schema library.</p><h4>Message Pack</h4><p>Binary JSON. Compact like CDR, dynamically typed like JSON. No schema required. Ideal for systems that need speed without sacrificing flexibility.</p><h4>Apache Avro</h4><p>Schema evolution is built in from day one. Dominant in Kafka and Hadoop pipelines. Schemas can change versions without breaking existing consumers — the problem Java Serialization famously failed at.</p><h3>Conclusion — the right translation for the right conversation</h3><p>Marshalling is not a glamorous problem. It lives in the plumbing — the layer most developers never think about until something breaks silently at 2 a.m. because a big-endian server sent a number to a little-endian client, and nobody noticed for six hours.</p><p><strong>CDR says:</strong> agree on everything upfront, encode compactly, parse at machine speed. <strong>Java Serialization says:</strong> don’t make me think about it, just make it work inside the JVM. <strong>XML says:</strong> let anyone read the wire, even if it costs bandwidth and CPU time.</p><p>The deeper lesson is not which format wins. Every distributed system carries implicit assumptions about how data travels — byte order, type encoding, schema agreement, versioning — and marshalling is the discipline of making those assumptions explicit, agreed, and enforced on both ends of the wire.</p><p>“Marshalling is not just a technical detail. It is the contract that makes distributed computing possible.”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5dd047a8a9fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Old Code, New Tricks:
A Guide to Software Reengineering]]></title>
            <link>https://medium.com/@sanmugarasathaoogithan/old-code-new-tricks-a-guide-to-software-reengineering-c6c3961e5844?source=rss-b85ff4b6f7e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6c3961e5844</guid>
            <dc:creator><![CDATA[Sanmugarasa Thanoogithan]]></dc:creator>
            <pubDate>Wed, 06 May 2026 16:15:47 GMT</pubDate>
            <atom:updated>2026-05-06T16:15:47.566Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*xQKOwDLX_1DJcaZ0" /></figure><h3>Introduction</h3><p>Technology moves forward at a fast and steady pace. Every year brings new coding languages, tools, cloud services, and user needs. Yet hiding inside many outwardly modern companies is an uncomfortable reality where their central systems were built long ago in languages such as COBOL, Visual Basic, or early Java by programmers who are no longer around.</p><p>These older systems are not always broken. Many of them handle millions of tasks daily with strong reliability. But they are costly to maintain, nearly impossible to update, and incompatible with today’s digital world. Replacing them fully is a huge risk — one that has caused well-known failures at banks, government bodies, and retailers across the world.</p><p>Software reengineering offers a better path forward. Rather than tearing things down and starting fresh, reengineering keeps what works, fixes what does not, and slowly brings the system into the modern era. In this article, we will look at what software reengineering is, how it works, the models and methods involved, the tools that support it, and where the field is going in the future.</p><h3>What Is Software Reengineering?</h3><p>Software reengineering is the process of examining and restructuring an existing software system to improve its quality, performance, maintainability, or compatibility with new technologies — without discarding the core knowledge and logic it contains.</p><p>Think of it like renovating an old building. A skilled architect does not tear down the structure because the kitchen feels dated or the electrical wiring is outdated. Instead, they study the building’s foundations, reinforce what is sound, replace what is dangerous, and redesign the interior to meet today’s standards. The building keeps its identity; its functionality is transformed.</p><p>A strong real-world example of this is what happened with the Commonwealth Bank of Australia. The bank had been running its core banking system on an outdated platform that dated back to the 1980s. Rather than shutting everything down and building a completely new system from scratch, the bank worked with technology partners over several years to gradually reengineer its core platform while keeping daily banking operations running without interruption. Millions of customers continued using their accounts, making payments, and taking out loans throughout the entire process. The result was a modernized system that could support mobile banking, real-time payments, and cloud integration, all while preserving the essential business logic and customer data that the old system had carried for decades. This case is widely studied today as one of the most successful examples of large-scale software reengineering in the financial industry</p><p><em>“</em><strong><em>Software reengineering is not about throwing away the past — it is about understanding it deeply enough to carry it forward</em></strong><em>.”</em></p><p>Academically, the reengineering process is captured in a clean and memorable formula proposed by Jacobson and Lindstrom, where Reengineering equals Reverse Engineering plus Delta plus Forward Engineering. In this formula, the element Delta captures all the alterations and improvements made to the original system before it is rebuilt. This means reengineering is never just a straight translation from old to new, but always involves a deliberate improvement step in the middle</p><h3>Key Concepts in Software Reengineering</h3><p>Before diving into process and models, it helps to understand three foundational concepts that support all reengineering work.</p><p>Abstraction</p><p>Understanding a system at a high level — modules, features, data flows — without getting lost in every line of code. Like reading a city map rather than walking every street.</p><p>Refinement</p><p>The reverse of abstraction — moving from high-level understanding down into specific code, logic, and data structures to make targeted improvements.</p><p>Alteration</p><p>Making deliberate changes to improve the system — fixing bugs, improving speed, cleaning messy code — while preserving the system’s original business purpose.</p><h3>The Software Reengineering Process</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*yrEaq3qbsm1b_Cvj" /></figure><p>Reengineering is not a single action but a structured series of steps. Each step builds on the last, turning a fragile old system into something maintainable and modern.</p><ol><li><strong>Analysis and Planning: </strong>Developers audit the existing system, identify pain points, assess risk, and decide which parts should be rewritten, reworked, or replaced. A clear plan reduces costly surprises later.</li><li><strong>Reverse Engineering: </strong>The team digs into the codebase to understand how the system works — especially when documentation is missing or outdated. This produces diagrams, data models, and specifications that did not previously exist.</li><li><strong>Redesign and Restructuring: With </strong>a solid understanding in place, architects redesign the system’s structure. This may involve modularizing tightly coupled code, normalizing the database, or separating concerns that were blended years ago.</li><li><strong>Forward Engineering: The</strong> improved design is implemented using modern tools and languages. Old desktop applications may become web-based; monolithic code may be broken into services; proprietary databases may be migrated to open standards.</li><li><strong>Testing and Validation: The</strong> reengineered system is tested rigorously — unit testing, integration testing, regression testing — to confirm that the new system behaves identically to the old one where required, and better everywhere else.</li></ol><h3>Reverse Engineering: Understanding Before Changing</h3><p>Reverse engineering deserves its own spotlight because it is often the hardest and most critical stage of the entire process. When a company has run the same software for 30 years, the original developers may be gone, the documentation may be incomplete or absent, and the code may contain hundreds of undocumented workarounds layered on top of each other.</p><p>In reverse engineering, developers become detectives. They read the source code, trace data flows, run the software under controlled conditions, and slowly reconstruct a picture of what the system actually does — not what anyone thought it did, but what it truly does. The output is typically a set of updated technical documents, data flow diagrams, and component maps that serve as the foundation for all subsequent redesign work.</p><p>A useful analogy: imagine finding an unlabeled recipe card with smudged ink. You cannot simply guess the ingredients. Instead, you cook the dish, taste it, adjust your notes, cook again, and gradually recover the full recipe through careful observation. Reverse engineering is the same patient, methodical process applied to software.</p><h3>Models of Software Reengineering</h3><p>Several models have been developed to structure reengineering projects, each suited to different organizational contexts and risk tolerances.</p><h4>General Model</h4><p>The simplest model follows three phases: understand the existing system, improve its design, and rebuild it with better technology. It suits smaller projects where the scope is well-defined, and the team is experienced.</p><h4>Horseshoe Model</h4><p>Named for its shape, this model represents the full journey of a reengineering project. The left arm of the horseshoe represents reverse engineering — understanding the old system. The bottom represents redesign and improvement. The right arm represents forward engineering — rebuilding the system. It makes the bidirectional nature of the work visually clear: you go deep into the past before building toward the future.</p><h4>Phase Model</h4><p>The phase model divides the project into formal, sequential phases with defined deliverables at each stage: planning, analysis, redesign, implementation, testing, and documentation. This model suits large enterprise projects where governance, auditing, and stakeholder sign-off are required at each milestone.</p><h3>Reengineering Strategies and Approaches</h3><p>Depending on the condition of the legacy system and the organization’s risk appetite, engineers choose from several strategies: rewrite the entire system in a modern language; rework the existing code incrementally without changing its structure; or replace specific subsystems with modern off-the-shelf components or cloud services.</p><p>These strategies can be executed using different approaches. The big bang approach replaces the entire system at once — fast but extremely risky. The incremental approach updates one module at a time, reducing risk but extending the timeline. The iterative approach repeatedly cycles through improvements, much like how modern apps release regular updates. The evolutionary approach slowly replaces aging components over time, keeping the system continuously operational throughout the transition.</p><h3>Tools Used in Software Reengineering</h3><p>Software reengineering relies on a variety of tools to analyze, improve, and modernize existing systems. These tools fall into several key categories:</p><p><strong>1. Static Analysis Tools</strong><br> Examples: SonarQube, Understand<br> Purpose: Examine source code without executing it to identify bugs, security vulnerabilities, code complexity, and technical debt.</p><p><strong>2. Refactoring Tools</strong><br> Examples: IntelliJ IDEA, Eclipse<br> Purpose: Improve code structure and readability by safely renaming variables, extracting methods, and reorganizing code without changing its behavior.</p><p><strong>3. Reverse Engineering Tools</strong><br> Examples: Doxygen, Enterprise Architect<br> Purpose: Analyze existing systems to generate documentation, UML diagrams, and dependency mappings for better understanding.</p><p><strong>4. Version Control Systems</strong><br> Examples: Git, GitHub, GitLab<br> Purpose: Track changes in code, support team collaboration, and allow safe rollback to previous versions when needed.</p><p><strong>5. Automated Testing Tools</strong><br> Examples: JUnit, Selenium, Jest<br> Purpose: Ensure that modifications do not break existing functionality, making regression testing efficient and reliable.</p><p><strong>6. Migration Tools</strong><br> Examples: AWS Database Migration Service, Flyway<br> Purpose: Transfer data and database schemas from legacy systems to modern platforms with minimal downtime and risk.</p><h3>Future Directions in Software Reengineering</h3><p>The field of software reengineering is itself being reengineered by emerging technologies. Four trends in particular are reshaping how organizations approach legacy modernization.</p><p><strong>AI-Assisted Reengineering</strong></p><p>Large language models can now read legacy COBOL or Fortran code and generate modern equivalents, summarize undocumented functions, suggest refactoring patterns, and flag security vulnerabilities — dramatically reducing the manual effort of the analysis phase.</p><p><strong>Cloud Migration</strong></p><p>Many reengineering projects now end with the system running on cloud infrastructure. This unlocks elastic scaling, managed databases, and serverless functions — capabilities that on-premises legacy systems simply cannot provide.</p><p><strong>Microservices Architecture</strong></p><p>Reengineered systems are increasingly broken into small, independently deployable services. Each service can be updated, scaled, or replaced without touching the rest of the system — making future maintenance far less risky.</p><p><strong>DevOps and Continuous Delivery</strong></p><p>Modern reengineering does not produce a single big release. Instead, teams use CI/CD pipelines to ship improvements continuously, catching problems early and delivering value to users throughout the reengineering process rather than only at the end.</p><h3>Conclusion</h3><p>Software reengineering is one of the most practical and underappreciated disciplines in modern computing. It acknowledges a simple truth: most of the world’s critical software is old, and replacing it entirely is neither affordable nor safe. Instead, reengineering gives organizations a methodical path from fragile and outdated to robust and modern — preserving decades of embedded business logic while making systems faster, cheaper to maintain, and capable of meeting tomorrow’s demands.</p><p>By combining techniques such as reverse engineering, structured redesign, and forward engineering — supported by powerful tools and guided by proven models — development teams can transform even the most daunting legacy codebase into a competitive asset. As artificial intelligence, cloud computing, and microservices continue to mature, the toolkit available to reengineering professionals is only becoming more powerful.</p><p>In essence, software reengineering is not about admitting defeat to the past. It is about respecting what past engineers built, understanding it deeply, and having the skill and confidence to carry it forward into a better future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6c3961e5844" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Spark: A Modern Distributed System for Big Data Processing]]></title>
            <link>https://medium.com/@sanmugarasathaoogithan/apache-spark-a-modern-distributed-system-for-big-data-processing-21c3071049f6?source=rss-b85ff4b6f7e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/21c3071049f6</guid>
            <category><![CDATA[apache-spark]]></category>
            <dc:creator><![CDATA[Sanmugarasa Thanoogithan]]></dc:creator>
            <pubDate>Fri, 27 Mar 2026 04:09:14 GMT</pubDate>
            <atom:updated>2026-03-27T04:09:14.668Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R0kDWdRvD0KdA7ls.png" /></figure><h3>Introduction</h3><p>In today’s data-driven world, organizations generate massive volumes of data from sources such as social media, sensors, financial transactions, and web applications. Processing this data efficiently requires systems that can scale beyond the limits of a single machine. Apache Spark is a powerful open-source distributed computing framework designed to address this challenge. It provides a unified platform for large-scale data processing, supporting batch processing, real-time analytics, machine learning, and graph computation.</p><p>Unlike traditional systems such as Hadoop MapReduce, Spark performs computations in memory, significantly improving speed and performance. Its flexibility, ease of use, and compatibility with multiple programming languages (Python, Java, Scala, and R) have made it one of the most widely used big data processing frameworks.</p><h3>Type of Distributed System</h3><p>Distributed systems are commonly categorized into architectures such as <strong>client-server</strong>, <strong>peer-to-peer</strong>, and <strong>n-tier (including 3-tier systems)</strong>.</p><ul><li><strong>Client-Server Model:</strong> In this model, clients send requests and a central server processes them. Apache Spark partially follows this model. The <strong>driver program acts as the server</strong>, coordinating tasks, while users or applications act as clients submitting jobs.</li><li><strong>Peer-to-Peer Model:</strong> In peer-to-peer systems, all nodes are equal and share responsibilities. Spark does not fully follow this model because it has centralized coordination via the driver. However, worker nodes collaborate in processing distributed data, showing limited peer-like behavior.</li><li><strong>N-Tier / 3-Tier Architecture:</strong> This model separates systems into layers such as presentation, logic, and data. Spark aligns most closely with this structure:</li><li>The <strong>client layer</strong> submits applications</li><li>The <strong>driver layer</strong> handles logic and scheduling</li><li>The <strong>worker nodes (executors)</strong> process and store data</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CFRedOMRd4oJyt2d.png" /></figure><p>Thus, Apache Spark can be best described as a <strong>Cluster-based distributed computing system</strong>, primarily following a <strong>master-worker (client-server) architecture with characteristics of n-tier systems</strong>. In this model, a central coordinator (the driver) manages and distributes tasks across multiple worker machines (nodes). Each node processes a portion of the data in parallel, enabling high-performance computation.</p><p>Spark operates on distributed datasets, dividing data into partitions and processing them concurrently across nodes. This type of system supports <strong>horizontal scalability</strong>, allowing organizations to increase computing power simply by adding more machines to the cluster. It is particularly suitable for big data analytics, iterative algorithms, and real-time data processing.</p><h3>Key Components of Apache Spark Architecture</h3><h4>Driver Program</h4><p>The driver program acts as the central coordinator of a Spark application. It runs the main application code and creates the SparkContext, which serves as the entry point for interacting with Spark. The driver converts user-defined operations into tasks and schedules them across the cluster.</p><p>It includes critical internal components such as the DAG Scheduler, Task Scheduler, and Block Manager, which collectively manage execution flow, task distribution, and memory usage.</p><h4>Cluster Manager</h4><p>The cluster manager is responsible for resource allocation across multiple applications. Spark supports several cluster managers, including Standalone, Hadoop YARN, Kubernetes, and Apache Mesos. It assigns CPU and memory resources to the driver and executors, ensuring efficient distributed processing.</p><h4>Executors</h4><p>Executors are worker processes that run on cluster nodes. They execute tasks assigned by the driver and store intermediate data either in memory or on disk. Executors are dynamically allocated based on workload, which helps optimize resource utilization.</p><h4>Worker Nodes</h4><p>Worker nodes are the machines in the cluster where executors run. Each worker node can process multiple tasks simultaneously, depending on its available resources. These nodes perform the actual computation and send results back to the driver.</p><h3>Execution Flow in Spark</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/0*pLiiPocOB46DoVl6" /></figure><p>When a Spark application is submitted, the driver initializes the Spark Context and requests resources from the cluster manager. The cluster manager allocates executors on worker nodes. The driver then distributes tasks to these executors, which process data in parallel.</p><p>Spark uses a Directed Acyclic Graph (DAG) to represent the sequence of operations. The DAG Scheduler divides jobs into stages, and each stage is further split into tasks. This structured execution model ensures efficiency and fault tolerance.</p><h3>Modes of Execution</h3><p>Spark supports different execution modes depending on the use case:</p><ul><li><strong>Cluster Mode:</strong> The driver runs inside the cluster, making it suitable for production environments.</li><li><strong>Client Mode:</strong> The driver runs on the client machine, often used for interactive analysis.</li><li><strong>Local Mode:</strong> The application runs on a single machine, ideal for testing and development.</li></ul><h3>Desired Properties of a Distributed System</h3><h4>Fault Tolerance</h4><p>Spark achieves fault tolerance through Resilient Distributed Datasets (RDDs). RDDs store lineage information, which tracks how data is derived. If a node fails, Spark can recompute lost data using this lineage, ensuring system reliability without excessive replication.</p><h4>High Availability</h4><p>High availability ensures continuous system operation despite failures. Spark achieves this through cluster managers that monitor nodes and restart failed components. Tasks from failed nodes are reassigned to other nodes, minimizing downtime.</p><h4>Recoverability</h4><p>Recoverability refers to the system’s ability to restore operations after failure. Spark supports this through lineage-based recomputation and checkpointing. Checkpointing stores intermediate results in reliable storage, enabling faster recovery for long-running jobs.</p><h4>Consistency</h4><p>Consistency ensures that all nodes in a distributed system see the same data at the same time or eventually reach the same state.</p><ul><li>Spark maintains consistency through its deterministic computation model using RDD lineage.</li><li>Since RDDs are immutable, data is not modified after creation, reducing inconsistency issues.</li><li>Transformations always produce new datasets, ensuring predictable and consistent results across nodes.</li></ul><h4>Scalability</h4><p>Scalability refers to the system’s ability to handle increasing workloads by adding more resources.</p><ul><li>Apache Spark supports <strong>horizontal scaling</strong>, allowing more nodes to be added to the cluster.</li><li>It can efficiently process data from gigabytes to petabytes.</li><li>Dynamic resource allocation enables Spark to scale resources up or down based on workload demands.</li></ul><h4>Predictable Performance</h4><p>Predictable performance ensures the system delivers stable, consistent response times across varying workloads.</p><ul><li>Spark achieves this through <strong>in-memory computation</strong>, reducing disk I/O delays.</li><li>The DAG execution model optimizes task scheduling and execution order.</li><li>Parallel processing ensures faster and more consistent performance across large datasets.</li></ul><h4>Security</h4><p>Security ensures that data and resources are protected from unauthorized access.</p><ul><li>Spark supports authentication mechanisms such as <strong>Kerberos</strong>.</li><li>It provides encryption for data in transit and at rest.</li><li>Integration with cluster managers like YARN and Kubernetes enhances access control and security policies.</li></ul><h4>Quality of Service (QoS)</h4><p>Quality of Service ensures that the system meets performance requirements such as latency, throughput, and reliability.</p><ul><li>Spark supports <strong>fair scheduling</strong> to allocate resources among multiple users or applications.</li><li>It allows priority-based job execution to meet deadlines.</li><li>Resource management via cluster managers ensures efficient utilization and consistent service levels.</li></ul><h3>Spark Core: The Foundation</h3><p>Spark Core is the fundamental component of Apache Spark and the backbone of its functionality. It handles task scheduling, memory management, fault recovery, and interaction with storage systems.</p><p>Spark Core provides the API for creating and manipulating RDDs, enabling distributed and parallel data processing. Higher-level libraries such as Spark SQL, Spark Streaming, MLlib, and GraphX are built on top of Spark Core, leveraging its capabilities.</p><h3>Advantages of Spark Architecture</h3><ul><li><strong>In-Memory Computation:</strong> Processes data faster than disk-based systems.</li><li><strong>Fault Tolerance:</strong> Automatically recovers lost data using RDD lineage.</li><li><strong>Scalability:</strong> Can scale from a single machine to thousands of nodes.</li><li><strong>Polyglot Support:</strong> Supports multiple programming languages.</li></ul><h3>Applications of Spark</h3><p>Apache Spark is widely used across industries for:</p><ul><li>Batch data processing</li><li>Real-time data streaming</li><li>Machine learning and AI</li><li>Graph processing and network analysis</li></ul><p>Its ability to integrate with diverse data sources makes it highly versatile.</p><h3>Real-World Example</h3><p>A practical example of Apache Spark can be seen in the operations of a large e-commerce platform. Such a platform processes millions of transactions, user interactions, and product views daily. Spark is used to analyze this data in real time to provide personalized recommendations.</p><p>For instance, when a user browses products, Spark Streaming processes clickstream data instantly and updates recommendation models using MLlib. If a node fails during this process, Spark’s fault tolerance ensures that computations continue without interruption. High availability ensures that the recommendation system remains active, while recoverability mechanisms allow quick restoration in case of system failures.</p><h3>Conclusion</h3><p>Apache Spark is a robust and efficient distributed computing framework that exemplifies the principles of modern distributed systems. Its cluster-based architecture, combined with components such as the driver, executors, and cluster manager, enables scalable and high-performance data processing.</p><p>By supporting key distributed system properties such as fault tolerance, high availability, and recoverability, Spark ensures reliable operation in complex environments. With its strong foundation in Spark Core and versatile ecosystem, Apache Spark continues to play a critical role in big data analytics and real-world applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21c3071049f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Caching in Spring Boot]]></title>
            <link>https://medium.com/@sanmugarasathaoogithan/caching-in-spring-boot-7b2784d7999a?source=rss-b85ff4b6f7e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b2784d7999a</guid>
            <dc:creator><![CDATA[Sanmugarasa Thanoogithan]]></dc:creator>
            <pubDate>Wed, 17 Dec 2025 06:09:05 GMT</pubDate>
            <atom:updated>2025-12-17T06:09:05.345Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/369/0*PZrhS2_v2wZnXUuf" /></figure><p>When we are building an application, we need to fetch data from the database. Sometimes we frequently fetch some data that time our application will slow its process.</p><p>This is where caching helps us.</p><p>In this article, I will explain <strong>Spring Boot caching and Redis</strong> in a simple and easy way.</p><h3>In What Is Caching?</h3><p>Caching means <strong>saving data temporarily</strong> so that we can reuse it later. Instead of calling the database every time, we return the saved data from memory.</p><p><strong>For example: —</strong>In a shop, a shopkeeper often needs to go to the storeroom to fetch items for customers. Since this takes time, the overall process becomes slow. To make the process faster, the shopkeeper keeps frequently asked items close by. This reduces the time needed to serve customers and improves efficiency. This is similar to how <strong>caching</strong> works in programming. Frequently used data is kept in a fast-access location so that it doesn’t have to be fetched repeatedly from a slower source.</p><h3>Why Is Caching Important?</h3><p>Caching helps us to:</p><ul><li>Improve application performance</li><li>Reduce database calls</li><li>Handle more users at the same time</li><li>Save server resources</li></ul><p>For applications with <strong>read-heavy data</strong>, caching is very useful.</p><h3>Caching in Spring Boot</h3><p>Spring Boot provides a very clean and simple way to add caching.</p><p>We only need to:</p><ol><li>Enable caching</li><li>Add a few annotations</li></ol><p>For example:</p><pre>@Cacheable(&quot;users&quot;)<br>public User getUserById(Long id) {<br>    return userRepository.findById(id).orElse(null);<br>}</pre><p>The first time this method is called, data comes from the database.<br> The next time, Spring Boot returns the data from the cache.</p><p>This happens automatically, which is very convenient.</p><pre>@CachePut(value = &quot;products&quot;, key = &quot;#product.id&quot;)<br>public Product updateProduct(Product product) {<br>    return productRepository.save(product);<br>}</pre><pre>@CacheEvict(value = &quot;products&quot;, key = &quot;#id&quot;)<br>public void deleteProduct(Long id) {<br>    productRepository.deleteById(id);<br>}</pre><p>@CachePut is used when you want to <strong>update the cache along with updating the database</strong>.</p><ul><li>It <strong>always executes the method</strong></li><li>It <strong>updates the cache with the new value</strong></li><li>It does <strong>not</strong> check the cache before execution</li></ul><h3>What happens here?</h3><ul><li>The product is updated in the database</li><li>The cache entry for that product ID is also updated</li><li>Next time, updated data is returned from cache</li></ul><p><strong>Real-World Example:</strong><br> When a shopkeeper updates the price of an item, he also updates the price label on the shelf immediately</p><pre>@CacheEvict(value = &quot;products&quot;, key = &quot;#id&quot;)<br>public void deleteProduct(Long id) {<br>    productRepository.deleteById(id);<br>}</pre><p>@CacheEvict is used to <strong>remove data from the cache</strong>, usually after a delete operation.</p><h3>What happens here?</h3><ul><li>The product is deleted from the database</li><li>The corresponding cache entry is removed</li></ul><p><strong>Real-World Example:</strong><br> If an item is no longer sold, the shopkeeper removes it from both the store and the display shelf.</p><h3>There are two types of caching</h3><h3>1. In-Memory Caching</h3><p>In-memory caching means storing data <strong>inside the application memory</strong>.</p><p>Examples:</p><ul><li>Spring Boot default cache</li><li>Caffeine</li></ul><h3>How it works</h3><ul><li>Data is stored in the same JVM</li><li>Very fast access</li><li>The cache is cleared when the application restarts</li></ul><h3>When to use</h3><ul><li>Small applications</li><li>Single server setup</li><li>Development or testing environments</li></ul><h3>Limitation</h3><ul><li>Not shared across multiple servers</li></ul><h3>2. Distributed Caching</h3><p>Distributed caching stores data in a <strong>separate system</strong> that can be shared across many applications.</p><p>Examples:</p><ul><li>Redis</li><li>Memcached</li></ul><h3>How it works</h3><ul><li>Multiple services connect to the same cache</li><li>Cache survives application restarts</li><li>Suitable for scalable systems</li></ul><h3>When to use</h3><ul><li>Microservices</li><li>High traffic applications</li><li>Multiple application instances</li></ul><h3>What Is Redis?</h3><p>Redis is an <strong>in-memory data store (</strong>Redis stores its data in <strong>RAM</strong>, not on disk like a traditional database<strong>)</strong>.<br> It is very fast and commonly used as a cache.</p><p>Redis is different from local memory caching because:</p><ul><li>It can be shared across multiple services</li><li>It supports data expiration</li><li>It works very well in distributed systems</li></ul><p>Because of this, Redis is a popular choice for production systems.</p><h3>Spring Boot and Redis Together</h3><p>When Spring Boot uses Redis as a cache:</p><ol><li>A request comes to the application</li><li>Spring checks Redis for cached data</li><li>If data exists, it is returned immediately</li><li>If not, data is fetched from the database and stored in Redis</li></ol><p>This flow improves speed and reliability.</p><h3>When Should You Use Redis Caching?</h3><p>Redis caching is useful when:</p><ul><li>Your application has many read requests</li><li>You are using microservices</li><li>You need a shared cache across servers</li><li>Performance is very important</li></ul><p>For small applications, in-memory caching may be enough.</p><h3>Common Mistakes to Avoid</h3><p>Some common caching mistakes are:</p><ul><li>Caching data that changes too often</li><li>Forgetting to clear cache after updates</li><li>Using caching without monitoring</li></ul><p>Caching should always be used carefully.</p><h3>Conclusion</h3><p>Caching is a powerful feature in Spring Boot.<br> With Redis, it becomes even more effective.</p><p>By using caching correctly, we can build faster and more scalable applications.<br> I hope this article helped you understand Spring Boot caching in a simple way.</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b2784d7999a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Use of Static and This Keyword in Java]]></title>
            <link>https://medium.com/@sanmugarasathaoogithan/use-of-static-and-this-keyword-in-java-a11bb47be2ba?source=rss-b85ff4b6f7e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/a11bb47be2ba</guid>
            <dc:creator><![CDATA[Sanmugarasa Thanoogithan]]></dc:creator>
            <pubDate>Wed, 17 Dec 2025 04:44:37 GMT</pubDate>
            <atom:updated>2025-12-17T04:44:37.548Z</atom:updated>
            <content:encoded><![CDATA[<p>I want to share something that I have learned about the most important keywords static and this in our coding. Let’s see each of the elements one by one.</p><ol><li>static</li></ol><p>static is the keyword that we can use in variables, classes, methods, and nested classes. These are mainly used for memory management. If we assign a variable as static, we can access it anywhere in the application. The items defined with the keyword are loaded when the classes are called. For example, if you have a static method and the constructor definition, the static method will be executed first.</p><p>When I start to learn about the static keyword, I have some questions, like why do we assign our main method as static? Where do we use the static keyword? What are some real-world examples where we use the static keyword?</p><p>let&#39;s see one by one,</p><h3>Why is the main() Method Static?</h3><pre>public static void main(String[] args) {<br>   System.out.println(&quot;hello&quot;);<br>}</pre><p>The main method is static because:</p><ul><li>The <strong>JVM starts execution without creating an object</strong></li><li>It needs a method that it can call <strong>directly using the class name</strong></li><li>A static method does not require an object</li></ul><p>If main() were not static, the JVM wouldn’t know how to create the first object.</p><h3>Where Do We Use the static Keyword?</h3><h3>1. Static Variables</h3><p>Used when a value is <strong>shared by all objects (</strong>A static variable is used when a value is shared by all objects of a class. Since only one copy of the static variable exists in memory, any change made to it will be reflected across all objects that access that variable)</p><pre>class Employee {<br>    static String companyName = &quot;CodeGeneraters&quot;;<br>    int employeeId;<br>    String name;<br>}</pre><p>📌 <strong>Real-World Example</strong><br> All employees work for the same company, but each has a unique ID and name.</p><h3>2. Static Methods</h3><p>Used when a method:</p><ul><li>Does not depend on object data</li><li>Performs a common or utility task</li></ul><pre>class Calculator {<br>    static int add(int a, int b) {<br>        return a + b;<br>    }<br>}</pre><p>Usage:</p><pre>Calculator.add(5, 10);</pre><p>📌 <strong>Real-World Example</strong><br> A calculator does not need a “person” to add numbers. The operation is universal.</p><h3>3. Static Blocks</h3><p>Static blocks run <strong>once</strong> when the class is loaded.</p><pre>class DatabaseConfig {<br>    static {<br>        System.out.println(&quot;database configuration&quot;);<br>    }<br>}</pre><p>📌 <strong>Real-World Example</strong><br> Like setting up office electricity <strong>once</strong> when the building opens, not every time an employee enters.</p><h3>4. Static Nested Classes</h3><p>Used for better structure and memory efficiency.</p><pre>class Bank {<br>    static class InterestCalculator {<br>        static double calculate(double amount) {<br>            return amount * 0.05;<br>        }<br>    }<br>}</pre><p>📌 <strong>Real-World Example</strong><br> A department inside a company that works independently of individual employees.</p><h3>2. This “this” Keyword in Java</h3><h3>What is this?</h3><p>This “this” keyword refers to the <strong>current object</strong>. It helps Java understand which object’s data or method we are referring to.</p><p>📌 <strong>Real-World Analogy</strong><br> When you say, <strong>“this phone is mine”</strong>, you are pointing to the phone you’re holding — not someone else’s.</p><h3>Where Do We Use “this&quot;?</h3><h3>1. To Differentiate Instance Variables from Parameters</h3><pre>class Student {<br>    int id;<br>Student(int id) {<br>        this.id = id;<br>    }<br>}</pre><p>📌 <strong>Real-World Example</strong><br> Imagine filling a form:</p><ul><li>“ID” on the form is temporary</li><li>“My ID” stored in the records is permanent</li></ul><p>this.id refers to the stored value.</p><h3>2. Constructor Chaining</h3><pre>class Laptop {<br>    String brand;<br>    int price;<br>   Laptop() {<br>        this(&quot;Dell&quot;, 50000);<br>    }<br>    Laptop(String brand, int price) {<br>        this.brand = brand;<br>        this.price = price;<br>    }<br>}</pre><p>📌 <strong>Real-World Example</strong><br> One form auto-fills another form using default values.</p><h3>3. Calling Current Class Methods</h3><pre>class Printer {<br>    void start() {<br>        System.out.println(&quot;Printer started&quot;);<br>    }<br>    void print() {<br>        this.start();<br>        System.out.println(&quot;Printing...&quot;);<br>    }<br>}</pre><p>📌 <strong>Real-World Example</strong><br> Before printing a document, the printer must turn itself on.</p><h3>4. Passing the Current Object as a Parameter</h3><pre>class Order {<br>    void process(Order o) {<br>        System.out.println(&quot;Order processed&quot;);<br>    }<br>    void placeOrder() {<br>        process(this);<br>    }<br>}</pre><p>📌 <strong>Real-World Example</strong><br> Hand over <strong>your own order slip</strong> to the cashier.</p><h3>Key Differences Between static and this</h3><p>The static keyword belongs to the class itself, meaning only one copy exists in memory, and it can be accessed without creating an object. In contrast, this keyword belongs to the object and refers to the current instance. While static members do not require an object and cannot use this, instance members depend on objects and frequently use this to access object-specific data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a11bb47be2ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Asgardeo IDP for Authentication in an E-Commerce Application]]></title>
            <link>https://medium.com/@sanmugarasathaoogithan/implementing-asgardeo-idp-for-authentication-in-an-e-commerce-application-1a26a255d35a?source=rss-b85ff4b6f7e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a26a255d35a</guid>
            <dc:creator><![CDATA[Sanmugarasa Thanoogithan]]></dc:creator>
            <pubDate>Sun, 07 Sep 2025 06:43:50 GMT</pubDate>
            <atom:updated>2025-09-07T18:37:38.586Z</atom:updated>
            <content:encoded><![CDATA[<p>Implementing Asgardeo IDP for Authentication in an E-Commerce Application</p><p>Asgardeo is one of the cloud-based IDPs (Identity Providers).WSO2 developed this IDP. We need to implement this in both the frontend and backend. It supports OIDC and OAuth 2.0 for secure login purposes. When I tried for the first time, Asgardeo lot of errors and bugs that did not support HTTPS initially. At one point, the login page did not come up due to passing a config in the wrong way in the frontend AuthProvider tag. We integrate Asgardeo in the frontend using a single-page application section to handle user authentication, and integrate it in the backend to validate the tokens from frontend requests. In frontend we we use Asgardeo SDK(@asgardeo/auth-react) and backend, we use Asgardeo’s JWKS endpoint to verify tokens.</p><p>lets see about the steps of actions for implementing the Agardeo</p><ol><li>Create Asgardeo Account -go to the console.asgadeo.io page and create an account.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*iMzLMzmuEZAcB_3-3Z4Btg.png" /></figure><p>2. Then we will go to the Asgardeo page there is a section called Application. When we click, we can see our Past applications, and we can also create new applications. Other wise on the Home page also we can also create a new Application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qw08hysbEavqljOB6LIz6Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TNjVq4unLUfZgYChRgynvA.png" /></figure><p>If we are going to develop a frontend, we can select a single-page application, and if we are going to develop a backend, we can select a Traditional application.</p><p>3) Create a new Application-When selecting the new application section, it asks for the details as mentioned in the picture below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6yjDdqz6B5bIvy0R8_R3uQ.png" /></figure><p>give name and URL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*TdvLGUL7LjaI1vMcj-2Ngg.png" /></figure><p>After creating the application, we go to the protocol section and are able to change the details mentioned in the picture.</p><p>These are the starting steps. We can find more details about the coding implementation from the official documentation.</p><p>This is the link for the documentation →<a href="https://wso2.com/asgardeo/docs/">Asgardeo documentation</a></p><p>In my application I used following <strong>Authentication protocols:-</strong></p><ol><li><strong>OAuth 2.0</strong>: Used for authorization and access delegation.</li><li><strong>OIDC (OpenID Connect)</strong>: Built on top of OAuth 2.0, used to fetch user profile and authentication details.</li></ol><ul><li><strong>Frontend (React)</strong> → Used @asgardeo/auth-react SDK to manage the authentication flow.</li><li><strong>Backend (Node.js)</strong> → Verified JWT access tokens issued by Asgardeo using the <strong>JWKS endpoint</strong>.</li></ul><p>I learn following things by implementing my application as secured one using asgardeo:</p><p>This project gave me hands-on experience with:-</p><ul><li>understanding how external services manage authentication.</li><li>applying them in a real-world scenario.</li><li>linking SPA authentication with API token validation</li><li>enforcing HTTPS, input sanitization, rate limiting, and secure JWT handling.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a26a255d35a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Software license]]></title>
            <link>https://medium.com/@sanmugarasathaoogithan/software-license-2479917ec196?source=rss-b85ff4b6f7e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/2479917ec196</guid>
            <category><![CDATA[software-licensing]]></category>
            <dc:creator><![CDATA[Sanmugarasa Thanoogithan]]></dc:creator>
            <pubDate>Wed, 26 Jun 2024 11:23:01 GMT</pubDate>
            <atom:updated>2024-06-26T11:23:01.988Z</atom:updated>
            <content:encoded><![CDATA[<p>A license is everywhere people use license to protect them and their properties from other factors. One of the major mistakes that a software developer can make is neglecting software license. It causes many negative impacts like losing jobs, some legal problems, ownership changes to people who neglect software license.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*qhUhlSyCJK9ClvncI__6Sg.jpeg" /></figure><p>First let’s see about “what is software license?”.</p><p>What is Software License?</p><p>A software license is a legal agreement between the software developer or publisher and the end user that outlines the terms and conditions under which the software can be used. It specifies the rights and restrictions associated with the software, such as the number of installations allowed, the duration of use, and any limitations on copying or modifying the software.</p><p>There are 5 approaches to the software licensing</p><p>1)<strong>public domain license</strong></p><p>Anyone can use or modify the software</p><p>2)<strong>license general public license</strong></p><p>Can link to open-source libraries and code can be licensed under any license type.</p><p>3)<strong>permissive</strong></p><p>Has some requirements for distribution and modification.</p><p>4)<strong>copy left</strong></p><p>Licensed code can be distributed or modified if all the code involved is distributed under the same license.</p><p>5)<strong>property</strong></p><p>Software cannot be copied, modified or distributed.</p><p>There are two main categories of software licenses:</p><ol><li><strong>Proprietary Licenses:</strong> These are the most common type of license for commercial software. They give you the right to use the software, but the copyright remains with the owner. You typically must agree to a license agreement (EULA) that restricts what you can do with the software, such as copying it or modifying it. Examples of proprietary licenses include those for Microsoft Windows and Adobe Photoshop.</li><li><strong>Open-Source Licenses:</strong> These licenses grant users more freedom to use, modify, and distribute the software. There are many different open-source licenses, each with its own terms. Some popular open-source licenses are:</li></ol><ul><li>Permissive licenses: These licenses allow you to use, modify, and distribute the software for any purpose, even commercial purposes. Examples include the MIT License and the Apache License.</li><li>Copyleft licenses: These licenses require that any modified or derivative works of the software must also be open-source and use the same license. The most well-known copyleft license is the GNU General Public License (GPL).</li></ul><p>Next important thing in software license is copy right</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*MRvTHTWgsSm65uUX-9ZeHw.jpeg" /></figure><p>Copyright law is a legal framework that protects the creators of original works from unauthorized use of their creations.in simpler terms it gives the copyright owner exclusive rights to control how their work is used.</p><p>Next see about differences between ownership and licensing</p><p><strong>Ownership and licensing</strong> are two different ways to control and access something, especially creative works or software. <strong>Ownership </strong>gives you maximum control rights, while licensing provides a more restricted and often temporary form of access. The best option depends on your needs. If you need complete control and the potential for future benefits, ownerships might be better.</p><p>Why we need software license?</p><p>1)Protections for developers</p><p>2)Benefits for users</p><p>3)Overall Stability</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2479917ec196" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>