<?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 Vindhya kulasinghe on Medium]]></title>
        <description><![CDATA[Stories by Vindhya kulasinghe on Medium]]></description>
        <link>https://medium.com/@vindhyakulasinghe?source=rss-3fcbcda04ee6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*C7s6MhDe9ECM81dzLSkisw.jpeg</url>
            <title>Stories by Vindhya kulasinghe on Medium</title>
            <link>https://medium.com/@vindhyakulasinghe?source=rss-3fcbcda04ee6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 11:57:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vindhyakulasinghe/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[Why I Stopped Using MySQL for Sessions and Never Looked Back]]></title>
            <link>https://blog.stackademic.com/why-i-stopped-using-mysql-for-sessions-and-never-looked-back-830fed76eafa?source=rss-3fcbcda04ee6------2</link>
            <guid isPermaLink="false">https://medium.com/p/830fed76eafa</guid>
            <dc:creator><![CDATA[Vindhya kulasinghe]]></dc:creator>
            <pubDate>Thu, 25 Jun 2026 12:34:07 GMT</pubDate>
            <atom:updated>2026-06-25T12:34:07.633Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How a slow login page sent me down a rabbit hole and Redis changed the way I think about data.</em></p><p>I’m a software engineer intern. I don’t have ten years of war stories or a PhD in distributed systems. What I do have is a login page that used to take <strong>2.3 seconds to respond </strong>and the embarrassing realization that I was the one who made it that slow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xULY033eRG4jy7I8PRjzhA.png" /></figure><h3>It Started With a Complaint</h3><p>A few months into my first real project a web app where users could log in and manage their tasks I got a message from a friend who was testing it.</p><blockquote>“Bro why is your login so slow”</blockquote><p>Classic. Not a bug report. Not a GitHub issue. Just a WhatsApp message with zero punctuation and maximum damage to my ego.</p><p>I opened Chrome DevTools. The login request was taking <strong>2,300 milliseconds</strong>. Over two full seconds just to check if a user was logged in.</p><p>I had no idea why. I mean, the logic seemed fine to me:</p><ul><li>User sends request</li><li>Server checks the session in the <strong>MySQL database</strong></li><li>MySQL finds the row, returns it</li><li>Server lets the user in</li></ul><p>Simple, right? What could go wrong?</p><p>Everything, apparently.</p><h3>What I Was Doing Wrong</h3><p>Here’s what my session logic actually looked like under the hood. Every single request not just login, <strong>every request </strong>was doing this.</p><pre>SELECT * FROM sessions <br>WHERE session_id = &#39;abc123xyz&#39; <br>AND expires_at &gt; NOW();</pre><p>On the surface, that looks harmless. But think about what’s actually happening:</p><ul><li>MySQL has to <strong>open a connection</strong> from the connection pool</li><li>It has to <strong>scan the sessions table</strong> (which was growing every day)</li><li>It has to <strong>read from disk</strong> to find the matching row</li><li>It has to <strong>send the result back</strong> over the network</li></ul><p>And this was happening <strong>on every single page load</strong>. Not once. Every. Request.</p><p>When you have 5 users, you don’t notice. When you have 50? Your login page starts feeling like it’s running on a potato.</p><h3>Then I Found Redis</h3><p>I was watching a YouTube tutorial on backend optimization mostly hoping for a quick fix when the instructor casually said:</p><blockquote>“And for sessions, you’d obviously use Redis instead of your main database…”</blockquote><p><strong>Obviously.</strong> He said it like it was common knowledge. Like everyone just knew this.</p><p>I paused the video. Opened a new tab. Started reading.</p><p>Within 20 minutes, I understood the problem I’d been ignoring for months. I was using a <strong>disk-based relational database</strong> to store data that had three very specific characteristics:</p><ul><li>It was <strong>temporary</strong> (sessions expire anyway)</li><li>It was <strong>simple</strong> (just a key pointing to some user data)</li><li>It needed to be <strong>accessed constantly and fast</strong></li></ul><p>MySQL is brilliant. But it’s designed for permanent, structured, relational data. Session data is none of those things. I was using a forklift to move a coffee cup.</p><p>Redis, on the other hand, stores everything in <strong>RAM</strong>. No disk reads. No SQL parsing. No table scans. You give it a key, it gives you the value back in <strong>microseconds</strong>.</p><p>It’s almost embarrassingly simple</p><pre># Store a session<br>SET session:abc123xyz &#39;{&quot;userId&quot;: 17, &quot;name&quot;: &quot;Pesh&quot;}&#39; EX 3600<br><br># Retrieve it on every request<br>GET session:abc123xyz<br><br># It auto-deletes after 3600 seconds (1 hour). No cron job needed. No cleanup.</pre><p>That’s it. That’s the whole thing.</p><h3>The Switch</h3><p>I spent one afternoon migrating sessions from MySQL to Redis. I won’t pretend it was instant. I had to learn a bit about how Redis works, install it locally, and update my session middleware. But it wasn’t hard. Not even close to hard.</p><p>The results though?</p><p>My session lookup went from <strong>~180ms</strong> (on a good day) to <strong>under 2ms</strong>.</p><p>I sent my friend a new link.</p><blockquote>“try it now”</blockquote><p>His reply:</p><blockquote>“ok that’s fast”</blockquote><p>High praise from someone who communicates exclusively in lowercase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cfleTnXI5jF1nHB3OVbKjQ.png" /></figure><h3>What Redis Actually Gives You (That MySQL Doesn’t)</h3><p>After a few weeks of using Redis for sessions, I noticed a few things I didn’t expect:</p><p><strong>1. Automatic expiry is a game changer</strong></p><p>With MySQL, I had to write a cron job to delete expired sessions. I kept forgetting to set it up properly. Sessions piled up. The table grew. With Redis, you just set EX 3600 and it disappears on its own. No cleanup code. No cron. Just gone.</p><p><strong>2. It makes you think differently about data</strong></p><p>Not everything needs to live in your main database forever. Some data is temporary by nature — sessions, OTPs, rate limit counters, cached API responses. Redis taught me to ask: <em>does this data actually need to be permanent?</em> If not, why am I treating it like it does?</p><p><strong>3. It’s surprisingly simple</strong></p><p>I expected Redis to be some complex infrastructure thing that senior devs gatekeep. It’s not. The commands are almost English. SET to store, GET to retrieve, DEL to delete, EXPIRE to set a timer. A beginner can be productive in Redis in an afternoon.</p><h3>When Should You NOT Use Redis for Sessions?</h3><p>To be fair, Redis isn’t a silver bullet. There are trade-offs worth knowing:</p><ul><li><strong>Redis stores data in RAM</strong> — RAM is more expensive than disk. If you have millions of long-lived sessions with huge payloads, costs can add up.</li><li><strong>By default, Redis can lose data</strong> if the server crashes before flushing to disk. For sessions this is usually fine (users just log in again), but it’s worth knowing.</li><li><strong>You’re adding another service</strong> to your stack. More things to monitor, more things that can go wrong.</li></ul><h3>The Bigger Lesson</h3><p>The real thing I learned wasn’t “use Redis for sessions.” That’s just a pattern. The bigger lesson was this:</p><p><strong>Different data has different needs. Use the right tool for each.</strong></p><p>MySQL is incredible at what it does. Redis is incredible at what it does. The mistake I made was assuming my main database should handle everything just because it was already there.</p><p>Now, when I add any new piece of data to an app, I ask myself:</p><ul><li>Does this need to be permanent?</li><li>Does this need complex queries?</li><li>How often will this be accessed?</li></ul><p>Sessions are temporary, simple, and accessed constantly. Redis wins every time.</p><p><em>If you’re a beginner like me and you’ve never touched Redis , give yourself one afternoon. Install it, spin up the CLI, run a few SET and GET commands. It clicks fast. And once it does, you’ll start seeing places to use it everywhere.</em></p><p><em>That slow login page was one of the best things that ever happened to my backend education.</em></p><h3>Contacts</h3><p>medium : <a href="https://medium.com/@vindhyakulasinghe">https://medium.com/@vindhyakulasinghe</a></p><p>linkedin : <a href="https://www.linkedin.com/in/vindhya-kumari-kulasinghe-4a828925b/">https://www.linkedin.com/in/vindhya-kumari-kulasinghe-4a828925b/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=830fed76eafa" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/why-i-stopped-using-mysql-for-sessions-and-never-looked-back-830fed76eafa">Why I Stopped Using MySQL for Sessions and Never Looked Back</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Rise of Self-Healing Electronics-How Tomorrow’s Devices Fix Themselves]]></title>
            <link>https://medium.com/@vindhyakulasinghe/the-rise-of-self-healing-electronics-how-tomorrows-devices-fix-themselves-dcfe43a12f66?source=rss-3fcbcda04ee6------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcfe43a12f66</guid>
            <dc:creator><![CDATA[Vindhya kulasinghe]]></dc:creator>
            <pubDate>Fri, 16 May 2025 03:01:47 GMT</pubDate>
            <atom:updated>2025-05-16T03:01:47.297Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*UoC48uJRyvj7Hwm6VabbfA.png" /></figure><p><strong>The Next Leap in Smart, Autonomous Systems</strong></p><p>Imagine a world where your gadgets, medical implants, or even the sensors in your car can sense when something’s wrong, diagnose the issue, and repair themselves — no technician required. This isn’t just a futuristic fantasy anymore. Thanks to breakthroughs in <strong>self-healing electronics</strong>, we’re on the verge of a revolution in how devices function. These innovations blend the power of <strong>IoT</strong>, <strong>embedded systems</strong>, <strong>automation</strong>, and <strong>AI</strong>, paving the way for a new generation of smarter, self-sustaining technologies.</p><p><strong>Why Do We Need Self-Healing Devices?</strong></p><blockquote><em>Electronics have become an invisible backbone in our homes, workplaces, factories, hospitals, and even inside our bodies. But as we rely on them more, the stakes of device failure rise dramatically. A single faulty sensor in a smart grid can cause blackouts. A glitch in a medical implant could threaten a life. Downtime in factories can cost millions.</em></blockquote><blockquote><em>Traditional maintenance is expensive and often reactive-fixing things only after they break. What if our devices could fix themselves before, we even knew something was wrong? That’s the promise of self-healing electronics: longer lifespans, fewer interruptions, and safer, more reliable technology.</em></blockquote><p><strong>How Do Self-Healing Electronics Work?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NzHR-Cu9rkxmMMz8EusOVQ.png" /><figcaption>Self-healing soft electronics</figcaption></figure><blockquote><strong><em>Sensing and Diagnostics<br></em></strong><em>Modern smart devices are packed with tiny sensors constantly monitoring their own health-tracking temperature, voltage, vibration, humidity, and more. Embedded microcontrollers process this data in real time, always on the lookout for anything unusual.</em></blockquote><blockquote><strong><em>AI-Powered Fault Detection Sensing and Diagnostics<br></em></strong><em>Artificial intelligence takes this a step further. Machine learning models analyze the data stream, spotting the earliest warning signs of trouble. A small temperature spike might mean a component is about to fail. A change in vibration could hint at a mechanical issue. These models learn from years of data, getting better at predicting problems before they happen.</em></blockquote><blockquote><strong><em>Automated Recovery <br></em></strong><em> When a problem is detected, the device can spring into action-sometimes instantly. Some systems reroute signals around damaged parts. Others use special materials, like microcapsules filled with conductive liquid or shape-memory polymers, to physically repair broken circuits or restore structural integrity. If a fix isn’t possible, the device can alert you or a technician, often before the issue becomes critical.</em></blockquote><blockquote><strong><em>Continuous Learning <br></em></strong><em> Thanks to IoT connectivity, devices can share what they learn about failures and repairs. This collective intelligence helps make future predictions and fixes even smarter, as each device contributes to a growing pool of knowledge.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M9DwepZF_ukFJ40TkEuPvQ.png" /><figcaption><em>Self-healing soft electronics</em></figcaption></figure><p><strong>Where Is This Happening Already?</strong></p><p>Self-healing electronics are already making an impact across several industries.</p><blockquote><em>Smart Grids: Power networks use self-healing sensors to isolate faults and reroute electricity in milliseconds, reducing the risk of widespread outages.</em></blockquote><blockquote><em>Medical Devices: Some new implants can detect and correct minor issues internally, reducing the need for risky surgeries and improving patient safety.</em></blockquote><blockquote><em>Industrial Automation: Robots and controllers are starting to self-diagnose and fix problems on the fly, minimizing costly downtime and boosting productivity.</em></blockquote><blockquote><em>Consumer Electronics: Imagine phones or wearables that heal minor circuit damage, lasting longer and reducing e-waste. Some research labs have already demonstrated batteries and screens that can self-repair small cracks.</em></blockquote><p><strong>The Science Behind Self-Healing Materials</strong></p><p>At the heart of many self-healing systems are innovative materials inspired by nature. For example, some polymers mimic the way human skin heals after a cut. When a circuit is damaged, microcapsules embedded in the material break open and release a conductive liquid, which flows into the gap and restores electrical connectivity. Other approaches use heat- or light-activated materials that “remember” their original shape and can close cracks or breaks when triggered.</p><p>Researchers are even experimenting with materials that can heal repeatedly, making devices far more durable over time. Dynamic polymers-materials with bonds that can be broken and reassembled under specific conditions-are a key ingredient, especially for flexible and stretchable electronics.</p><p><strong>Real-World Inspiration: Electronic Skin and Beyond</strong></p><p>One of the most exciting applications is electronic skin, or “e-skin.” These ultra-thin, flexible devices can mimic the stretchability and self-healing abilities of human skin. For example, some self-healing e-skins can be attached to a person’s hand to monitor gestures, or even to the throat to recognize speech patterns. After being cut or damaged, these materials can heal themselves within seconds, restoring both their structure and function. This opens up new possibilities for wearable tech, human–machine interfaces, and even soft robotics.</p><p><strong>Challenges on the Road Ahead</strong></p><p>Despite the promise, self-healing electronics still face hurdles:</p><ul><li>Material Limitations: Many self-healing materials are still experimental. Making them affordable, reliable, and easy to manufacture is a big challenge.</li><li>Energy Efficiency: Running AI on tiny embedded devices requires clever engineering to balance intelligence with battery life.</li><li>Security: Self-healing mechanisms must be robust against cyberattacks. Imagine if malware could trigger or block self-repair routines.</li><li>Standardization: As devices become more autonomous, we’ll need new standards and protocols so they can communicate and cooperate safely.</li></ul><p><strong>The Broader Impact: Sustainability and Beyond</strong></p><p>Self-healing electronics could have a profound impact on sustainability. By extending the lifespan of devices and reducing the need for replacements, we can cut down on electronic waste-a growing global problem. Longer-lasting devices mean fewer resources spent on manufacturing and shipping replacements. In critical applications, such as medical devices and infrastructure monitoring, self-healing technology can save lives and prevent disasters.</p><p>What’s Next?</p><p>The future of self-healing electronics is bright and full of possibilities.</p><blockquote><em>Wider adoption in consumer devices: Phones, laptops, and wearables that recover from minor damage on their own.</em></blockquote><blockquote><em>Smarter infrastructure: Bridges, roads, and buildings equipped with embedded sensors and self-healing materials to automatically patch cracks or corrosion.</em></blockquote><blockquote><em>Autonomous vehicles: Cars, drones, and robots that can self-diagnose and repair, improving safety and reliability.</em></blockquote><blockquote><em>Space exploration: Spacecraft and satellites that can withstand micro-meteoroid impacts and harsh environments by healing themselves.</em></blockquote><p><strong>The Takeaway</strong></p><p>We’re on the verge of a new era where our devices don’t just work smarter-they take care of themselves. The journey to truly self-healing electronics is a collaborative effort, blending innovation in hardware, software, AI, and materials science. As we keep pushing boundaries, the dream of self-sustaining, reliable technology is quickly becoming reality.</p><p><strong>References</strong></p><p>1. IDTechEx. Self-Healing Materials 2025–2035: Technologies, Applications, and Players. Comprehensive market analysis covering key technologies and emerging applications of self-healing materials. Available at:<br><a href="https://www.idtechex.com/en/research-report/self-healing-materials-2025-2035-technologies-applications-and-players/1079"> https://www.idtechex.com/en/research-report/self-healing-materials-2025-2035-technologies-applications-and-players/1079</a></p><p>2. Terasaki Institute for Biomedical Innovation. Scientists Develop Novel Self-Healing Electronic Skin for Health Monitoring. Demonstrates ultra-rapid self-healing e-skin technology integrated with AI for health applications. Available at:<br> <a href="https://terasaki.org/institute/news/pr/scientists-develop-novel-self-healing-electronic-skin-for-health-monitoring.html">https://terasaki.org/institute/news/pr/scientists-develop-novel-self-healing-electronic-skin-for-health-monitoring.html</a></p><p>3. Sigma-Aldrich. Recent Trends in Self-Healing Soft Electronic Materials and Devices. Discusses materials science advances enabling autonomous repair in soft electronics, including transparent and stretchable polymers. Available at:<br> <a href="https://www.sigmaaldrich.com/US/en/technical-documents/technical-article/materials-science-and-engineering/microelectronics-and-nanoelectronics/recent-trends-self-healing-soft-electronic-materials-devices">https://www.sigmaaldrich.com/US/en/technical-documents/technical-article/materials-science-and-engineering/microelectronics-and-nanoelectronics/recent-trends-self-healing-soft-electronic-materials-devices</a></p><h4>Contacts</h4><p>medium : <a href="https://medium.com/@vindhyakulasinghe">https://medium.com/@vindhyakulasinghe</a></p><p>linkedin : <a href="https://www.linkedin.com/in/vindhya-kumari-kulasinghe-4a828925b/">https://www.linkedin.com/in/vindhya-kumari-kulasinghe-4a828925b/</a></p><h4><strong>Thank you for reading!</strong></h4><p>The future of self-healing electronics is full of exciting possibilities.Feel free to share your thoughts.If you enjoyed this article, please give it a like.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcfe43a12f66" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>