<?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 Nilasi Jayathilake on Medium]]></title>
        <description><![CDATA[Stories by Nilasi Jayathilake on Medium]]></description>
        <link>https://medium.com/@nilasi2002?source=rss-f4ea61c24226------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MvLaP0eaRsu92oVIP1j5XQ.jpeg</url>
            <title>Stories by Nilasi Jayathilake on Medium</title>
            <link>https://medium.com/@nilasi2002?source=rss-f4ea61c24226------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:35:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nilasi2002/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[Are You Ready To Scale With Firebase?]]></title>
            <link>https://medium.com/@nilasi2002/are-you-ready-to-scale-with-firebase-dacc5388be60?source=rss-f4ea61c24226------2</link>
            <guid isPermaLink="false">https://medium.com/p/dacc5388be60</guid>
            <category><![CDATA[scalable-applications]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[firestore]]></category>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Nilasi Jayathilake]]></dc:creator>
            <pubDate>Wed, 15 Jan 2025 09:36:22 GMT</pubDate>
            <atom:updated>2025-01-15T09:36:22.305Z</atom:updated>
            <content:encoded><![CDATA[<p>If you had created any Full Stack Project of your own, Congratulations! It’s a feat on its own. As the next step, It’s natural for you to wonder how to take your application up a notch.</p><p>Your application is great! It can perform basic CRUD operations, make API calls, and it has a stellar UI, But Is it Ready To Scale?</p><p>What is the use of your service if your target audience cannot access it Efficiently, Effectively, and Simultaneously?</p><p><strong>A Scalable Application?</strong></p><p>To put it very simply a Scalable Application is where an App does not crash when the traffic is high.</p><p>As of 2025, Firebase is a popular choice among developers to build Modern Scalable Applications.</p><p><strong>Firebase?</strong></p><p>First of all, What is Firebase? Google’s Firebase is a popular platform that provides Backend-as-a-Service (BaaS) to build and scale web and mobile applications.</p><p>It’s very popular for Real-Time Data Synchronization. Meaning it works well to develop Dynamic Databases. Apart from that, Firebase is also popular for its easy User Authentication Services and Cloud Solutions.</p><p><strong>Dynamic Databases </strong>are not your average database. Meaning, the data saved is constantly updated with real-time data. When you build an application which involves a dynamic database, it needs careful consideration of the Database Design and Backend Utilization.</p><p>To make sure, Your App meets the standards and utilizes the power of Firebase, there are a few tips you can follow while building.</p><p>Let’s take a simple example, A blogging platform built with Firebase and React.js for the front end. This Blogging Site is simple.</p><p>Users can Log-In / Sign-Up for the site. They can Publish, Update or Delete their Articles. The site will Load Articles to Read and Users can also Upvote and Comment on their favourite articles. Let’s call this site <strong>Capslock Content</strong>.</p><p>Building an Authentication System for Capslock Content using Firebase is easy. Firebase supports registering users in multiple ways. Whether you want to integrate the traditional Email and Password for authentication Or use Google or Facebook to register to the site, It has multiple providers to choose from.</p><ol><li><strong>Optimized Firebase Authentication</strong></li></ol><p>All right! You have chosen your provider, and Now you need to make Authentication calls to check whether a User has Logged In or Not. In Capslock Content I want a User to be logged in if they want to Upvote or Comment on a particular Article.</p><p>Making Authentication Calls is repetitive. Each network request it makes consumes a lot of bandwidth and time.</p><p>Users with slow internet connections will find your application to be dreadfully slow. Leading them to leave your site, or opt for alternatives. That’s not a healthy sign of a scalable application!</p><p>To prevent that Firebase has “Persistent User Sessions” For example, onAuthStateChanged can detect user state changes (Signed-In or Signed-Out). With this, you can maintain the connection without making authentication calls repetitively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wTVBO4J_Haf77flH" /><figcaption>Figure 1: React Hook, ‘useUser’ used in Capslock Content which leverages Firebase’s <em>onAuthStateChanged </em>function. Used to track user authentication state effectively.</figcaption></figure><p>Also ensures effective Firebase Listeners usage by cleaning up with unsubscribe.</p><p><strong>2. Database Optimisation</strong></p><p>While Authentication can be improved in the above means, There is one particular aspect You cannot ignore if you want a Scalable Application. It is to build an Optimized Database. The key to an optimised database is the Database Structure.</p><ul><li><strong>Using Flat Data Model Structures</strong></li></ul><p>When you work with Firebase, it’s better to work with Flat Data Models contrary to Deeply Nested Data.</p><p>Example :</p><p>You might have come across errors which say “Maximum Capacity Reached” Or Payload Errors. One of the common causes is that the data model is deeply nested so the fetching is done recursively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1-obsAzFAoVjOGml" /><figcaption>Figure 2: Example of a Deeply Nested Data Model</figcaption></figure><p>It’s inefficient and will create a lot of issues in fetching data. Firebase Servers work in optimised conditions when using Flat Data Models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mmgBoR3n1jfecsUD" /><figcaption>Figure 3: Flat Data Model</figcaption></figure><p>Users, articles, and comments are separate collections. Efficient, scalable, and simplifies data queries and management.</p><ul><li><strong>Using Pagination</strong></li></ul><p>Another way to achieve this is via Pagination. Which loads the data in batches when the data is too big. What Pagination does is fetch and load data in smaller batches. Which helps to avoid deeply nested structures.</p><p>For example: In Capslock Content, Instead of loading all articles at once. Which would increase the loading time. We can use pagination to load a number of articles at first. Let’s say 5. Five articles will load at the beginning, as you scroll down or press the button “view more” other articles will load in batches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4ZR8sCFZ-tUfy9o2" /><figcaption>Figure 4: Firebase query to load articles in batches (5 articles per batch) using Pagination .limit()</figcaption></figure><ul><li><strong>Using Optimized Queries</strong></li></ul><p>Instead of using single queries to fetch data, We can use composite queries. For example, Let’s say you need to fetch an article posted by a certain user. Instead of writing 2 queries, you can use a query as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HGSE8jZKkThvOf84" /><figcaption>Figure 5: Optimized Composite Query which is used to find articles in order of articleId in descending order, with the tag ‘Firebase’ and a limit of 5.</figcaption></figure><p><strong>3. Real-Time Features Optimization</strong></p><p>As mentioned in the beginning, Firebase is ideal for dynamic databases. Firebase, has Real-Time features, such as Listeners. These need to be used efficiently.</p><p>Unsubscribing the Listeners, when they are not used, and Using Targeted Listeners are efficient ways to optimise Firebase. (Refer to Figure 1)</p><p>Firebase works as a powerhouse to build great scalable applications offering useful in-built functions. Whether it is by designing a Flat Data structure, Keeping in mind to use the Listeners effectively Or Using network resources effectively, developing these small steps makes a big impact.</p><p>By following these simple principles you can level up your project to an Advanced level, Customer-focused Application, that meets the Industry Standards. Harnessing the Power of Firebase!</p><p>The Source Code for Capslock Content can be found here: <a href="https://github.com/NilasiJayathilake/CapslockCW_Blogsite">https://github.com/NilasiJayathilake/CapslockCW_Blogsite</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dacc5388be60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Would Artificial Intelligence (AI) Dominate Earth?]]></title>
            <link>https://medium.com/@nilasi2002/would-artificial-intelligence-ai-dominate-earth-459fc6fa2bd6?source=rss-f4ea61c24226------2</link>
            <guid isPermaLink="false">https://medium.com/p/459fc6fa2bd6</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[world-domination]]></category>
            <dc:creator><![CDATA[Nilasi Jayathilake]]></dc:creator>
            <pubDate>Wed, 15 Jan 2025 09:30:24 GMT</pubDate>
            <atom:updated>2025-01-15T09:30:24.214Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*1dc2ndEZT0w6efMaE1SWTw.jpeg" /></figure><p>It’s 2024 already, and I am pretty sure we all know a couple of AI like the back of our hand. You and I have used <em>ChatGPT</em> or Bard or <em>BeautifulAI</em> to carry out tasks we were so lazy to do by ourselves. At times, you might have thanked anyone who invented AI repeatedly, especially when you had just submitted that task you were assigned at 11:59 pm thanks to ChatGPT!</p><p>However, a question arises, are we <em>Safe</em> from the very technology that is growing at a rapid pace, taking over the world?</p><p>As of 2024, AI can write codes, build websites, generate beautiful images to given prompts, create your presentations, do your accounts, give you legal advice or even create your own anime girlfriend who will tend to all your needs. So basically, AI is replacing whatever that humans have been doing or have been trying to perfect from centuries ago.</p><p>“The real problem of humanity is the following. We have Palaeolithic Emotions, Medieval Institutions and Godlike Technology, And it is terrifically dangerous. It is now approaching a point of crisis overall”</p><p>-Edward O. Wilson (American biologist and naturalist)</p><p>The job market is already competitive. Thousands of undergraduates find it difficult to land a job in the current market. The last thing you want is to go to an interview, barely land a job and one month later “boom!”. You got replaced by an AI named “Rogers”. Guess what, “Rogers” can and will do your job far better than you originally did.</p><p>Sounds ridiculous? Honestly, take your time to think about it.</p><p>By 2030, 30% of the working hours in USA can be replaced by AI according to McKinsey analysis. It even suggests 300 million full time jobs can be lost due to AI replacement. Writers, Market Analysts, Legal jobs, Software Developers, Accountants all of these mark as in the risk category. Minimal Wage jobs are getting replaced by AI rapidly.</p><p>The truth is, more repetitive your task is without much to process or think, with less specific skills there is a higher chance of your job getting replaced by AI in the near future. Sure, these jobs doesn’t seem to look grand in a bird’s eye view. However minimum wage jobs solves the problem of unemployment at any country in the world. When these jobs get replaced by AI it leads, to various socio economic issues.</p><p>Even when it comes to jobs like Software Engineering which is a highly skilled job position as of now, has a risk. The team of 8 IT professionals who needed to work on a task for months now can only need about 4 people, and an AI model. The task will be carried out within less time as well.</p><p>However, there is a different font for this specific issue aroused by AI. First of all let us take a look at, “How AI works”.</p><p>AI is self-evolving. It’s like teaching someone how to make bread and then they read a paratha recipe online and they make one themselves. Just like that, We provide AI with data and simple instructions at first. The large amounts of data provided to AI from various sources are then processed, it recognises patterns and in return it is able to give solutions to similar scenarios. AI compares the problems with similar issues and forms an answer.</p><p>Now let’s say, you took away the data. It can no longer consume data as it used to do. This way AI looses touch with the most recent and relevant information. Now it is unable to find patterns leading to inaccurate results. This is when “AI Hallucination” begins. It tries to connect dots and complete missing data sets, and tries to predict answers without solid patterns. This is called AI Hallucination.</p><p>One of the very famous examples for AI Hallucination so far is when Google’s Bard chatbot claimed world’s first images of a planet outside our solar system. Which was a result of inaccurate biased data leading to AI hallucination.</p><p>What people do not understand is, these everyday repetitive jobs that people do, collect so much data in general. When these sorts of jobs completely gets replaced by AI, it also leads to inadequate and false positive data. Which eventually leads to AI Hallucinations.</p><p>Job replacement is just one aspect of threats that is posed to humanity through AI. There are many risk factors regarding Transparency, Ethical values, Data privacy etc.</p><p>We are still at the very beginning of the era of AI. What we see today is just a sliver of what AI is capable of. The future holds so much potential, as well as risks to humanity.</p><p>Humans and technology has to go hand in hand. As one of the greatest theoretical physicists of the past decades Stephen Hawking quotes,</p><p>“Success in creating AI would be the biggest event in human history. Unfortunately, it might also be the last, unless we learn how to avoid the risks”</p><p>Bibliography</p><p>Thomas, M. (2021). <em>The Risks of Artificial Intelligence</em>. [online] Built In. Available at: <a href="https://builtin.com/artificial-intelligence/risks-of-artificial-intelligence">https://builtin.com/artificial-intelligence/risks-of-artificial-intelligence</a> [Accessed 8 Feb. 2024].</p><p>IBM (2024). <em>What Are AI hallucinations? | IBM</em>. [online] <a href="http://www.ibm.com./">www.ibm.com.</a> Available at: <a href="https://www.ibm.com/topics/ai-hallucinations">https://www.ibm.com/topics/ai-hallucinations</a> [Accessed 8 Feb. 2024].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=459fc6fa2bd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do You Hear The Whisper?]]></title>
            <link>https://medium.com/thegavelclub/do-you-hear-the-whisper-7be8ee78f18e?source=rss-f4ea61c24226------2</link>
            <guid isPermaLink="false">https://medium.com/p/7be8ee78f18e</guid>
            <category><![CDATA[inner-voice]]></category>
            <category><![CDATA[you]]></category>
            <category><![CDATA[dreams]]></category>
            <category><![CDATA[lost]]></category>
            <dc:creator><![CDATA[Nilasi Jayathilake]]></dc:creator>
            <pubDate>Mon, 20 Jan 2020 14:40:01 GMT</pubDate>
            <atom:updated>2020-01-20T14:40:01.447Z</atom:updated>
            <content:encoded><![CDATA[<p>“What is your dream? What do you want to become when you grow up?”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ny5bxDjj6NDrUsxvfvRHYA.jpeg" /></figure><p>How many of us has a proper exact answer to this typical question?</p><p>If you do congratulations! but if you don’t and if you are lost you might want to read this.</p><p>We all have our secrets. Maybe <strong>your dreams are your secrets</strong>. Secrets that even you do not acknowledge yourself. You don’t have a dream? Think again. You do. We all do. Maybe it’s just not a certain proffesion. It may not be a certain destination. But dreams they are real. There is no one without a dream.</p><p>As a 7 year old , 11 years back I never even cared about this question. when other kids would answer raising their hands eargerly saying “I want to become a doctor! I want to become a Teacher! an engineer!” I was lost. I remember when my chance came and I got up and told the class that i want to join the army! Fight for the country, avenge the nation,and the entire class cracked up. I may have added a little bit of action as well.</p><p>As i grew up even on my mid teenage years i did not have a proper dream. “What are you ging to do when you grow up?”That became the most hated question that i had no intentions of answering. I did not know whom i want to become in life. I did not understand what my skills are. I did not know what i am good at. but i was still a13 year oldright? why should i care about them? I am just going to concentrate on the present and watch my cartoon! I even considered becoming a movie director, by watching movies everyday!</p><p>Whenever someone talks about their passion openly, I used to look at them with so much of admiration. Whenever Iget to know a person who’s working hard for his or her dream. I used to wonder “Why cannot I become like them?” I respected those people and maybe slightly envied them. Because when it came to me I could never explain it. I always ended up saying “It’s Complicated”</p><p>Now i know for a fact that i am not alone. Most of us are lost just like that. Unable to understand themselves and just trying to spend another day. It can be scary at times. Because we keep questioning ourselves, wondering why are we supposed to be here? We keep convincing ourselves that we are unworthy. Unworthy of dreaming. You question yourself “why?” “why should i do this? why am i excisting? What is the point? Why am i here on earth?”</p><p>But through all the years of being lost and feeling insecure and unworthy. I realised something. It’s not that you do not have a dream. You do. We all do. Only some of us are just seriously afraid to let the world know what it is. Why?! Because we keep questioning us. We keep thinking we won’t be able to achieve what we dream of; and that we will fail one day. And the society will mock us for not achieving supposed things in life. We fear the society’s judgement. What if someone else says you you will not be able to achieve what you want in life?</p><p>More than anything you fear your own judgement. What if you had big dreams, One thing you need so bad and end up not achieving it? What if you look back one day and become dissapointed for not achieving your dream? What if your future self blame you at a certain point in life?</p><p>So we think dreaming is only for the winners. That you will be happy with whatever or wherever you end up being. That you have no ambition. That you do not have a sketching of what you want to do in life.</p><p>But is it what you should do? Are dreams only for the best? Should you never dream, never voice out what you want in life for the sake of others? Must you ignore your inner voice? If you think you will be satisfied with never even trying; you are wrong. Think again.Give your best. Make sure you will not regret. <strong>All</strong> <strong>Winners are Dreamers.</strong></p><p>If you are lost; If you have zero idea with what you will end up doing. Do not step aside and let fate decide what you will become. Do not anyone else forge you to something you are not. Fate, Destiny… that power resides within you. It’s not anyone else or superior power which should decide your life, But You.</p><p>Close Your eyes. Listen to that tiny voice, deep inside you. Whispering, waiting for a chance to be heard. Listen to it. You will not be lost anymore.</p><p><strong><em>Do you hear the whisper?</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7be8ee78f18e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thegavelclub/do-you-hear-the-whisper-7be8ee78f18e">Do You Hear The Whisper?</a> was originally published in <a href="https://medium.com/thegavelclub">The Colombo Gavel Club</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>