<?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 Kasuni Madhushika on Medium]]></title>
        <description><![CDATA[Stories by Kasuni Madhushika on Medium]]></description>
        <link>https://medium.com/@kasunimadhushika77?source=rss-a5f1ad1acea5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*F434zIsMEn9AbK3nvgf_rQ.jpeg</url>
            <title>Stories by Kasuni Madhushika on Medium</title>
            <link>https://medium.com/@kasunimadhushika77?source=rss-a5f1ad1acea5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 22:19:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kasunimadhushika77/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[Spring Boot]]></title>
            <link>https://kasunimadhushika77.medium.com/spring-boot-9a304e28a25f?source=rss-a5f1ad1acea5------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a304e28a25f</guid>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Kasuni Madhushika]]></dc:creator>
            <pubDate>Tue, 11 May 2021 20:23:26 GMT</pubDate>
            <atom:updated>2021-05-15T00:47:14.260Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*GRRk9AXApygWfLuyNwiEww.png" /><figcaption>Figure 1: Spring Logo</figcaption></figure><p>Spring Boot is an open-source and Java-based framework. It is used to develop <strong>“Micro Services”</strong>. Micro Services is an architecture that enables developers to independently develop and deploy their services and each running service has its own process. The <strong>“Pivotal Team”</strong> created it. Spring applications are used to create stand-alone and production-grade applications. They offer the Spring platform and third-party libraries.</p><p>Spring Boot is a hybrid of the “Spring Framework” and “Embedded Servers”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*CeUHFIg5L16BxHayQVz-kA.png" /><figcaption>Figure 2: <strong>Spring Framework + Embedded Servers</strong></figcaption></figure><h4>Uses of Spring Boot Framework</h4><ul><li>Employs the dependency injection approach.</li><li>It has advanced database transaction management capabilities.</li><li>It provides powerful batch processing and manages REST endpoints.</li><li>It lowers the application’s cost and development time.</li><li>It includes Embedded Servlet Container.</li><li>It offers an annotation-based spring application.</li></ul><h3>How does it work?</h3><p>Spring Boot configures your application automatically based on the dependencies that we added to the project with the @<strong><em>EnableAutoConfiguration</em></strong> annotation. The entry point of the spring boot application is the class that contains @<strong>SpringBootApplication</strong> annotation and the main method. By using the @<strong>ComponentScan</strong> annotation, Spring Boot automatically scans all of the project’s components.</p><h4>Requirements</h4><p>Your system needs to have the following minimum requirements to create a Spring Boot application.</p><ul><li>Java 7</li><li>Maven 3.2</li><li>Gradle 2.5</li></ul><p>The Spring Boot Application’s entry point is the class that includes the @<strong>SpringBootApplication</strong> annotation. The main method of this class should be used to run the Spring Boot application. Auto-Configuration, Component Scan, and Spring Boot Configuration are all included in the @<strong>SpringBootApplication</strong> annotation.</p><pre>import org.springframework.boot.SpringApplication;<br>import org.springframework.boot.autoconfigure.SpringBootApplication;<br><br>@SpringBootApplication<br>public class DemoApplication {<br>   public static void main(String[] args) {<br>      SpringApplication.run(DemoApplication.class, args);<br>   }<br>}</pre><h4>Spring Boot CLI</h4><p>Spring Boot CLI is a command-line tool that lets one run Groovy scripts. Using the Spring Boot Command Line Interface, this is the simplest way to build a Spring Boot program. In the command prompt, you can build, run, and evaluate the program.</p><p>you need to use the following two folders:</p><ul><li><strong>spring-boot-cli-2.0.0.BUILD-SNAPSHOT-bin.zip</strong></li><li><strong>spring-boot-cli-2.0.0.BUILD-SNAPSHOT-bin.tar.gz</strong></li></ul><p>In the command prompt, navigate to the Spring Boot CLI bin directory and execute the command spring –-version to ensure that Spring CLI is properly enabled. Create a simple groovy file that contains the Rest Endpoint script, save it as “<strong>hello.groovy”</strong> and run with spring boot CLI. Then required dependencies will download automatically and it will start the application in the Tomcat server.</p><pre>@Controller<br>class Example {<br>   @RequestMapping(&quot;/&quot;)<br>   @ResponseBody<br>   public String hello() {<br>      &quot;Hello Spring Boot&quot;<br>   }<br>}</pre><p>Finally, go to the browser and hit the URL (ex: <a href="http://localhost:8080/"><strong>http://localhost:8080/</strong></a>) and see the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5vwHh1OLTCy8rcnWvj8T3Q.png" /><figcaption>Figure 3: localhost:8080</figcaption></figure><h4>Advantages of Spring Boot</h4><ul><li>It creates <strong>stand-alone</strong> Spring applications that can be started using Java <strong>-jar</strong>.</li><li>It provides “<strong>starter</strong>” POMs with strong opinions to help us simplify our Maven configuration.</li><li>Easy to understand and develop spring applications.</li><li>Increases productivity.</li><li>Reduces the development time.</li><li>No requirement for <strong>XML</strong> configuration.</li><li>Offers the number of <strong>plug-ins</strong>.</li><li>Offers a <strong>CLI</strong> tool for developing and testing the Spring Boot application.</li></ul><h4>Goals of Spring Boot</h4><ul><li>To avoid complex XML configuration.</li><li>To develop a production-ready Spring application in an easier way.</li><li>To reduce the development time and run the application independently.</li><li>Avoids writing import statements.</li><li>Avoids defining more Annotation Configuration.</li></ul><h4>References</h4><pre>1.<a href="https://www.tutorialspoint.com/spring_boot/spring_boot_quick_start.htm">https://www.tutorialspoint.com/spring_boot/spring_boot_quick_start.htm</a></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a304e28a25f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React.js]]></title>
            <link>https://kasunimadhushika77.medium.com/react-js-c4c1cf6f6b29?source=rss-a5f1ad1acea5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4c1cf6f6b29</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Kasuni Madhushika]]></dc:creator>
            <pubDate>Mon, 19 Apr 2021 14:03:08 GMT</pubDate>
            <atom:updated>2021-04-21T01:21:38.046Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introduction to ReactJS</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MF5V_dkybUTcfzwHFh0VSw.jpeg" /><figcaption>Figure 1: React JS Logo</figcaption></figure><p><strong>React.js </strong>(also known as <strong>React </strong>or <strong>ReactJS</strong>) is an open-source, component-based front-end JavaScript library (javascript framework) for building user interfaces and UI components. Also, it is a declarative, efficient, and flexible JavaScript library for User interfaces. React can be used for single-page web applications or mobile applications. Therefore, it requires the use of additional libraries for routing and certain client-side functionalities. ReactJS is maintained by Facebook and a community of individual companies.</p><p>The application looks like simple views for each state. React will efficiently update and render just the right component when your data changes. The declarative view makes your code more prognosticable and more facile to debug. As well as it is composed of multiple components, each responsible for rendering a minute, reusable piece of HTML. Those <strong>components </strong>can be nested within other components to built out of simple building blocks.</p><p><strong>Introduction to React Native</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*JwM00fXe1Z35quV_lKvXuQ.png" /><figcaption>Figure 2: React Native</figcaption></figure><p>React has native libraries. It is a JavaScript framework for developed mobile applications for IOS and Android and UPD. It is introduced by Facebook in 2015. It uses the same design as React and it looks truly “native”.</p><p>React Native applications also written using <strong>JavaScript </strong>and <strong>JSX </strong>(XML-esque markup). It exposes JavaScript interfaces for platform APIs.These can access platform features like the location or camera, like that.</p><h4>Top Feature of React.Js?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*LZFxXfO75TTHBneJpmi_qQ.jpeg" /><figcaption>Figure 3: Top uses of ReactJs</figcaption></figure><p>There are so many platforms for developing front-end web applications. But in React, has some unique features for developing your application easier. The following are the key features of it ;</p><ul><li><strong>Easy to learn:</strong> Anyone can easily understand this language. But you need basic knowledge of HTML and CSS.</li><li><strong>Performance:</strong><em> </em>React does not offer any concept of a built-in container for dependency. Can use <strong>Require JS</strong>,<strong> EcmaScript</strong> 6 modules which we can use via Babel, ReactJS-di to inject dependencies automatically.</li><li><strong>Simplicity:</strong><em> </em>The component-based approach, use of plain JavaScript, and its lifecycle make ReactJs very simple to learn. It helps us to build professional web applications or mobile applications. React uses a <em>special syntax called</em> “<strong>JSX” </strong>which allows you to mix HTML with JavaScript. Because JSX is much easier to use for developing our applications. Also, we can use plain JavaScript to build it.</li><li><strong>Data Binding:</strong><em> </em>Uses <strong>one-way data binding</strong> and an application architecture (<strong>Flux)</strong> that controls the flow of data to components through one control point. Therefore, it is easier to debug.</li><li><strong>Native Approach:</strong><em> </em>This <em>can</em> be used to create mobile applications. It is reusability-supported. So we can make Android, IOS, and Web applications.</li><li><strong>Testability:</strong> We can test these applications very easily.</li></ul><h4>References</h4><pre><a href="https://www.oreilly.com/library/view/learning-react-native/9781491929049/ch01.html">https://www.oreilly.com/library/view/learning-react-native/9781491929049/ch01.html</a></pre><pre><a href="https://reactjs.org/docs/getting-started.html">https://reactjs.org/docs/getting-started.html</a></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4c1cf6f6b29" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Koa.js — RESTful APIs]]></title>
            <link>https://kasunimadhushika77.medium.com/koa-js-restful-apis-36f28eca1138?source=rss-a5f1ad1acea5------2</link>
            <guid isPermaLink="false">https://medium.com/p/36f28eca1138</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[koa]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Kasuni Madhushika]]></dc:creator>
            <pubDate>Sun, 04 Apr 2021 13:26:42 GMT</pubDate>
            <atom:updated>2021-04-08T12:54:54.493Z</atom:updated>
            <content:encoded><![CDATA[<h3>Koa.js — RESTful APIs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b_lwoQ9IlCJmzxgI5e0kiA.jpeg" /><figcaption>Figure 1: Koa.js Logo</figcaption></figure><p>In this article, I am going to discuss <strong>Koa.js </strong>&amp;<strong> REST APIs. </strong>Using those things we can build a <strong>server-side API</strong> with <strong>Node.js</strong> as a runtime environment.</p><h3><strong>What is Koa.js?</strong></h3><p>Koa is also an open-source Node.js web framework designed by the team behind ExpressJS. Their main aims are a smaller, more expressive, and more robust foundation for web applications and APIs. Koa is an expressive HTTP middleware framework for node.js.</p><p><strong>Koa has so many functions called,</strong></p><ul><li><em>app.callback()</em></li><li><em>app.context()</em></li><li><em>app.keys =</em></li><li><em>app.listen()</em></li><li><em>app.use()</em></li><li><em>Request &amp; Respon</em>s (These two also have so many functions)</li></ul><p>These features are used to tackle API’s asynchronous calls. That means the Koa help eliminate the need for callbacks and significantly improves error handling.</p><h4>Features of Koa.js</h4><p>Koa.js has its own features that make it a more expressive, developer-friendly, and more robust foundation. Following are the features of it,</p><ul><li><strong>ES6 generators: </strong>This uses for asynchronous programming and controls the code execution.</li><li><strong>Modern and future-proof: </strong>Koa.js build is based on ES6. So, it makes complex applications simpler by providing new classes and modules. Using this developers can build more maintainable applications.</li><li><strong>Has a small footprint:</strong> Compare to other Node.js frameworks, Koas has a smaller footprint. This helps to write thinner middlewares. It makes web applications and APIs more enjoyable to write.</li><li><strong>Designed as a lightweight and flexible framework for Node.js:</strong> This provides a minimal interface for developing web applications and APIs.</li><li><strong>Identifies and understands all HTTP methods: </strong>There are so many HTTP methods. Koa can identify those methods and it will helpful for developers to build their applications more reliably.</li><li><strong>Has a built-in catchall:</strong> This will help for error handling.</li><li><strong>Uses a context object:</strong> It is an encapsulation of request and response objects.</li></ul><h3>What are Rest APIs?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*P412MgexQ42ZnNR6iqIw-A.jpeg" /><figcaption>Figure 2: Rest API</figcaption></figure><p>Rest APIs are created by a computer scientist called “<em>Roy Fielding</em>”. <strong>RESTful API</strong> or <strong>REST APIs</strong> is an application programming interface (API or web API). It allows for interaction with RESTful web services. “REST” stands for <strong>representational state transfer.</strong></p><blockquote>An API is a set of definitions and protocols for building and integrating application software. It’s sometimes referred to as a contract between an information provider and an information user — establishing the content required from the consumer (the call) and the content required by the producer (the response).</blockquote><h3>How to Install Koa.js?</h3><p>First of all, we have to Init an npm project. We can use “<strong><em>Webstrome</em></strong><em>”</em> as our IDE. Create a directory for all the project-related files.</p><pre>$ npm init</pre><p>This will generate a package.json file that holds all dependencies we added to our project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L_IAxX39kugJLx1dLKHLdQ.png" /><figcaption>Figure 3: Package.json file</figcaption></figure><p>Then add Koa to the local dependency. Koa requires <strong>node v7.6.0</strong> or higher for ES2015 and async function support.</p><pre>$ npm i koa --dev -- save</pre><h4>Koa Application</h4><p>Create a file called server.js. (require “koa” dependency on it)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u8k-i6Mx6WmawrHFag4ZQQ.png" /><figcaption>Figure 4: server.js</figcaption></figure><p>Now, open the <strong>terminal or your browser</strong> and run the following command;</p><pre><a href="http://localhost:3000/">http://localhost:3000</a></pre><p>Now you can see a “Hello World” message in your browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*wkG5zxJqaALAIvrTzPl3eA.png" /><figcaption>Figure 5: “Hello World”</figcaption></figure><h4>Building the REST API</h4><p>Install the “@koa/router” to your project.</p><pre>$ npm i @koa/router</pre><p>Then create a directory named <strong>routes</strong> and in there create a file called “<em>home.router.js” </em>inside it. and import “@koa/router”.</p><p>Then <strong>export</strong> the router object according to the following image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uRCKnOY1GnTlr8OLn2ReCg.png" /><figcaption>Figure 6: “home.router.js”</figcaption></figure><p>Import this file to your server.js file. (Note: this will be different according to your file names)</p><pre>$ const HomeRoutes = require(&#39;./routes/home.router&#39;);</pre><p>Then you need your server to understand JSON type that can be achieved by using body-parser. For that, you need to install a koa-body parser and register this with your koa application.</p><pre>$ const bodyParser = require(&#39;koa-bodyparser&#39;);</pre><pre>app.use(bodyParser()); //register this with your koa application</pre><p>Next, allow the HTTP methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VsLsjbtNfHrDH7dtnzToVQ.png" /><figcaption>Figure 7: “koa body-parser”</figcaption></figure><p>You can improve your application using GET, POST methods also.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X84-ezPAYxhI_mgDB3Qw6Q.png" /><figcaption>Figure 8: POST method</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gH9pzyvj-xPeHnsV3j18Uw.png" /><figcaption>Figure 9: Post.route.js</figcaption></figure><p>This is a little introduction to koa.js and REST APIs. You can follow more documents and articles for more details.</p><h4>References</h4><pre><a href="https://koajs.com/">https://koajs.com/</a><br><a href="https://www.redhat.com/en/topics/api/what-is-a-rest-api">https://www.redhat.com/en/topics/api/what-is-a-rest-api</a><br><a href="https://www.tutorialspoint.com/koajs/koajs_restful_apis.htm">https://www.tutorialspoint.com/koajs/koajs_restful_apis.htm</a></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36f28eca1138" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Node.js]]></title>
            <link>https://medium.com/codex/introduction-to-node-js-173251658bbd?source=rss-a5f1ad1acea5------2</link>
            <guid isPermaLink="false">https://medium.com/p/173251658bbd</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[runtime-environment]]></category>
            <category><![CDATA[cross-platform]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Kasuni Madhushika]]></dc:creator>
            <pubDate>Sun, 21 Mar 2021 14:18:39 GMT</pubDate>
            <atom:updated>2021-03-25T01:33:50.915Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="http://medium.com/codex">CODEX</a></h4><figure><img alt="Node.js logo" src="https://cdn-images-1.medium.com/max/600/1*azGfZjK3Z8rIlwaKYxqkBg.png" /><figcaption>Figure 1: Node.js Logo</figcaption></figure><p>Node.js is a server-side, open-source and cross-platform JavaScript runtime environment. This built on Google Chrome’s JavaScript Engine (V8 Engine). The definition of Node.js is as follows ;</p><blockquote>Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.</blockquote><p>This systems are developed using JavaScript. We can use Microsoft Windows, Linux and OS for run these applications. As well as this provides various libraries for web applications. We can use “npm” (Node Package Manager) for install these libraries.</p><h4>Features of Node.js</h4><p>There are some important of Node.js</p><ol><li><strong><em>Asynchronous and Event Driven : </em></strong>In the Node.js, all the API libraries are asynchronous. Asynchronous means that the client never wants to wait till the data return message. After calling that, the server moves to another API and Node.js helps the server to get a response from the previous API call.</li><li><strong><em>Single Threaded but Highly Scalable : </em></strong>Node.js uses a single threaded programming language. Event mechanism helps the server to respond in a asynchronous way. Then it makes the server highly scalable create limited threads to handle requests. Since it uses a single threaded programming language it can provide service to a much larger number of requests than traditional servers.</li><li><strong><em>No Buffering : </em></strong>These applications simply output the data in chunks rather than buffer.</li><li><strong><em>Very Fast : </em></strong>Node.js libraries are very fast in code execution.</li></ol><h4>Node.js Concepts</h4><p>In the following image we can see all of the using Node.js concepts.</p><figure><img alt="Node.js Concepts" src="https://cdn-images-1.medium.com/max/629/1*POxgYaIP9Njj-Z1rS-cs5w.png" /><figcaption>Figure 2: Node.js Concepts</figcaption></figure><h4>Where to Use Node.js?</h4><ul><li>Single Page Applications</li><li>I/O bound Applications</li><li>Data Intensive Real-time Applications (DIRT)</li><li>Data Streaming Applications</li><li>JSON APIs based Applications</li></ul><h4>Where Not to Use Node.js?</h4><ul><li>CPU intensive applications</li></ul><h4>Create an application</h4><p>There are some components before creating the application.</p><ol><li><strong><em>Import required modules : </em></strong>Use the <strong>require</strong> directive to load Node.js modules. For this create a file called index.js in your terminal. You can use Visual Studio Code or WebStorm for this.</li></ol><pre>var http = require(&quot;http&quot;);</pre><p><strong><em>2. Create server :</em> </strong>Similar to Apache HTTP Server. In here we use http instance and call “<strong>http.createServer()</strong>” method to create a server instance and bind it at port 8081 using the <strong>listen</strong> method associated with the server instance. Then pass a function with parameters request and response.</p><pre>http.createServer(function (request, response) {</pre><pre>response.writeHead(200, {&#39;Content-Type&#39;: &#39;text/plain&#39;});<br>   <br>response.end(&#39;Hello World\n&#39;);<br>}).listen(8081);<br><br>console.log(&#39;Server running at http://127.0.0.1:8081/&#39;);</pre><p><strong>3. Read request and return response : </strong>The server created and read the HTTP request made by the client and return the response.</p><pre>var http = require(&quot;http&quot;);<br><br>http.createServer(function (request, response) {<br>   // Send the HTTP header <br>   // HTTP Status: 200 : OK<br>   // Content Type: text/plain<br>   response.writeHead(200, {&#39;Content-Type&#39;: &#39;text/plain&#39;});<br>   <br>   // Send the response body as &quot;Hello World&quot;<br>   response.end(&#39;Hello World\n&#39;);<br>}).listen(8081);<br><br>// Console will print the message<br>console.log(&#39;Server running at http://127.0.0.1:8081/&#39;);</pre><p>Then we can execute the index.js file. In the terminal simply execute this code.</p><pre>$ node main.js</pre><p>You can see the output in the server. Open <a href="http://127.0.0.1:8081/">http://127.0.0.1:8081/</a> in any browser and observe the following result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*Xg6CgkP6v-UAF7KlghhA3Q.png" /><figcaption>Figure 3 : “Hello World!”</figcaption></figure><h4>References</h4><p>You can refer Node.js official website for more information.</p><pre><a href="https://nodejs.org/en/docs">https://nodejs.org/en/docs/</a></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=173251658bbd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/introduction-to-node-js-173251658bbd">Introduction to Node.js</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MySQL vs NoSQL]]></title>
            <link>https://kasunimadhushika77.medium.com/mysql-vs-nosql-b0838f6ae10?source=rss-a5f1ad1acea5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0838f6ae10</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[relational-databases]]></category>
            <category><![CDATA[nosql]]></category>
            <category><![CDATA[mysql]]></category>
            <dc:creator><![CDATA[Kasuni Madhushika]]></dc:creator>
            <pubDate>Sat, 27 Feb 2021 20:45:12 GMT</pubDate>
            <atom:updated>2021-03-30T01:44:19.511Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="http://medium.com/codex">CODEX</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*flO2txrxPEFX6bBX5TxO0w.jpeg" /><figcaption>Figure 1: MySQL-vs-NoSQL</figcaption></figure><h3>MySQL</h3><p>MySQL is a freely available open source Relational Database Management System(RDBMS) that uses Structured Query Language(<strong>SQL</strong>). SQL is the most powerful and popular language in database management. Using this language we can add, access and manage all the databases through it’s quick processing, reliability, ease and flexibility. Almost every open source <strong>PHP</strong> application use MySQL as their database management system.</p><p>MySQL development project has made its source code available under the terms of GNU license and proprietary agreements. Initially, its owned by a Swedish company called MySQL AB. But now owned by Oracle Corporation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*I9XozZaeaQ2IzK3E-wOfgA.jpeg" /><figcaption>Figure 2: MySQL + PHP</figcaption></figure><h4>MySQL Features</h4><ul><li><strong><em>Easy to use</em></strong><em> </em><strong>:</strong><em> </em>We can use only a few simple SQL statements to interact with MySQL.</li><li><strong><em>Secure</em></strong> <strong>:</strong> Passwords are encrypted in MySQL. As well as, it consist of a solid data security layer tp protect the sensitive data from intruders.</li><li><strong><em>Client/ Server Architecture :</em></strong> MySQL is a client/server system. There is a database server(MySQL) and arbitrarily many clients(application programs), which communicate with the server; that is, they query data, save changes and etc. The client can run on the same computer as the server or on another computer. All of the familiar large database systems like Oracle, Microsoft SQL Sever are client/server systems. These are in contrast to the file-server systems, which include Microsoft Access, dBase and FoxPro. The decisive drawback to file-server systems is that when run over a network, they become extremely inefficient as the number of users grows.</li><li><strong><em>Free to download :</em></strong> Can download from MySQL official website freely.</li><li><strong><em>Scalable :</em></strong> Supports multi-threading that makes it easily scalable. t can handle almost any amount of data, up to as much as 50 million rows or more. The default file size limit is about 4 GB. But we can increase this number to a theoretical limit of 8 TB of data.</li><li><strong><em>Speed :</em></strong> MySQL is considered one of the very fast database languages, backed by a large number of the benchmark test.</li><li><strong><em>High Flexibility :</em></strong> It supports a large number of embedded applications, which makes MySQL very flexible.</li><li><strong><em>Compatible on many operating systems :</em></strong> Novell NetWare, Windows* Linux*, many varieties of UNIX* (such as Sun* Solaris*, AIX, and DEC* UNIX), OS/2, FreeBSD* are some examples for operating systems. As well as in here, client can run on the same computer as the server or on another computer. That means clients can communicate via a local network or the network.</li><li><strong><em>Allows roll-back :</em></strong> This allows transactions to be rolled back, commit, and crash recovery.</li><li><strong><em>Memory efficiency :</em></strong> Efficiency is high because of the low memory leakage problem.</li><li><strong><em>High Performance :</em></strong> We can use Triggers, Stored procedures, functions, and views that allow the developer to give higher productivity.</li><li><strong><em>Platform Independent :</em></strong> Can download, install, and execute on most of the available operating systems.</li><li><strong><em>Partitioning :</em></strong> Improves the performance and provides fast management of the large database.</li><li><strong><em>GUI Support :</em></strong> MySQL provides a unified visual database graphical user interface tool named “<strong>MySQL Workbench</strong>” to work with database architects, developers, and Database Administrators. MySQL Workbench provides SQL development, data modeling, data migration, and comprehensive administration tools for server configuration, user administration, backup, and many more.</li><li><strong><em>Dual Password Support :</em></strong> MySQL version 8.0 provides support for dual passwords: one is the current password, and another is a secondary password, which allows us to transition to the new password.</li></ul><h4>Disadvantages of MySQL</h4><ul><li>MySQL lower versions like 5.0 or less versions doesn’t support ROLE, COMMIT and Stored procedure.</li><li>MySQL doesn’t support a very large database size as efficiently.</li><li>MySQL doesn’t handle transactions very efficiently, and it is prone to data corruption.</li><li>MySQL is accused that it doesn’t have a good developing and debugging tool compared to paid databases.</li><li>MySQL doesn’t support SQL check constraints.</li></ul><h3>NoSQL</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*aft5e_gFeDW4DQ8tayEsrA.png" /><figcaption>Figure : 3</figcaption></figure><p>NoSQL stands for <strong>“not only SQL,”</strong> is an approach to database design that provides flexible schemas for the storage and retrieval of data beyond the traditional table structures found in relational databases. In here <strong>“No”</strong> in “NoSQL” is an abbreviation for “not only” and not the actual word “No”. NoSQL databases are recently become more popular in the era of cloud, big data and high-volume web and ease of use. However, NoSQL and relational databases are now commonly used together in a single application. There are most common types of NoSQL databases called key-value, document, column and graph databases.</p><p>A NoSQL database can manage information using any of four primary data models:</p><ol><li><strong><em>Key-value databases :</em></strong> A simple type database where each item contains <strong>keys and values</strong>. In here, the key is usually a simple string of characters and the value is a series of uninterrupted bytes that are opaque to the database. As well as, the data is usually some primitive data type like String, Integer, array or a more complex object that an application needs to persist and access directly.</li></ol><ul><li>Key-value stores have no query language. They simply provide a way to store, retrieve, and update data using simple GET, PUT and DELETE commands. The simplicity of this model makes a key-value store fast, easy to use, scalable, portable, and flexible. So, this allows developer to easily modify fields and object structures as their application evolve.</li><li>Key-value databases are best for use cases to store large amount of data. But we don’t need to perform complex queries to retrieve it. Common use cases include storing user preferences or caching. <strong>Redis</strong> and <strong>DynanoDB</strong> are popular key-value databases.</li></ul><p><strong><em>2. Document databases : </em></strong>Stores data in documents similar to “JavaScript Object Notation”<strong> </strong>(JSON) objects. Each one contains pairs of <strong>fields and values</strong>. The value can be Strings, numbers, booleans, arrays, or objects and their structures typically align with objects developers are working with in code. As well as document databases are best for wide variety of use cases and can be used as a general purpose database because of the variety of field value types and powerful query languages. They can horizontally scale-out to accomodate large data volumes.</p><ul><li>These are designed for flexibility. They aren’t typically forced to have a schema and are therefore easy to modify. Document databases are good option for the applications that requires the ability to store varying attributes along with the large amounts of data. <strong>MongoDB</strong> and <strong>Apache CouchDB</strong> are popular examples for this.</li></ul><p><strong>3. Wide-column stores :</strong> This is also called “column database”. This enables very quick data access using a row key, column name, and cell timestamp. column stores store data in tables, rows and dynamic columns. They provide a lot of flexibility than relational databases because each row is not required to have the same columns.</p><ul><li>Wide-column stores are used for storing IOT(internet of things) data and user profile data. <strong>Apache</strong> <strong>Cassandra</strong> and <strong>HBase</strong> are popular examples for this.</li></ul><p><strong>4. Graph databases : </strong>This is a data storage and processing engine that make persistence and exploration of data and relationships more efficient. In here, each structure contains <strong>vertices</strong> and <strong>edges </strong>(data and connections). But now it called as “data relationships”. Nodes store data about people, places, and things and edges store data about the relationships between the nodes.</p><ul><li>Graph databases are use for visualizing, analyzing, or helping you find connections between different pieces of data. <strong>Neo4j </strong>and <strong>JanusGraph </strong>are examples for Graph databases.</li></ul><h4>When to use NoSQL</h4><ul><li>To store large amounts of unstructured data with changing schemas.</li><li>When using cloud computing and storage.</li><li>For rapid developments.</li><li>When a hybrid data environment makes sense.</li></ul><h3>Comparison Between MySQL and NoSQL</h3><p>Below figure represents the main differences between MySQL vs NoSQL.</p><figure><img alt="Main differences between MySQL vs NoSQL databases." src="https://cdn-images-1.medium.com/max/955/1*41Mg0wZLflvXuTSGvfNp_A.jpeg" /><figcaption>Figure 4: Difference between MySQL vs NoSQL</figcaption></figure><ul><li>MySQL is a relational database that is based on tabular design and NoSQL is a non-relational database with its document-based design.</li><li>MySQL is not so easily scalable with their rigid schema restrictions. But, NoSQL can be easily scaled with their dynamic schema nature.</li><li>MySQL needs a detailed database model before creating the database. But, no detailed modeling is required in the case of NoSQL database types.</li><li>MySQL is available with a wide array of reporting tools help application’s validity whereas NoSQL databases lack reporting tools for analysis and performance testing.</li><li>MySQL is less flexible and NoSQL is more flexible.</li><li>MySQL is being used with a standard query language called <strong>SQL. </strong>But,<strong> </strong>NoSQL doesn’t have any standard query language.</li><li>MySQL can provide a performance issue for huge amount of data. So, then require optimization of queries. But, NoSQL databases like MongoDB are good at performance even with the huge database.</li></ul><h3>Conclusion</h3><p>Nowadays, NoSQL databases are becoming a major part of the industry. Because of its advantages like performance at a big data level, scalability, and flexibility of design, etc. Also, the other special things like lower cost and open source features are reasons for its success. As well as MySQL is also still covering a huge chunk of the market. MySQL database with its settled market encompasses a huge community than the NoSQL database. Therefore, upcoming problems can easily resolve.</p><h3>References</h3><p><a href="https://www.educba.com/mysql-vs-nosql"><strong>https://www.educba.com/mysql-vs-nosql</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0838f6ae10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript]]></title>
            <link>https://medium.com/codex/javascript-c3e8412b6742?source=rss-a5f1ad1acea5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3e8412b6742</guid>
            <category><![CDATA[cross-platform]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[scripting]]></category>
            <category><![CDATA[object-oriented]]></category>
            <dc:creator><![CDATA[Kasuni Madhushika]]></dc:creator>
            <pubDate>Thu, 25 Feb 2021 16:16:30 GMT</pubDate>
            <atom:updated>2021-03-30T10:49:01.831Z</atom:updated>
            <content:encoded><![CDATA[<p>Chapter 01- <strong>What is JavaScript?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/236/1*o0OR2VfZzkIn3-HLhU4EYQ.jpeg" /><figcaption>JavaScript</figcaption></figure><p>JavaScript is a dynamic, cross-platform, object-oriented scripting language. It can be used to make web applications more interactively using complex animations, popup windows etc. There are more advanced server side versions such as Node.js, and that code can be seen as C, C# or any other server side language code. This allows you to add more functionalities to your application than downloading files and libraries.</p><p>JavaScript was first know as <strong>LiveScript</strong>, but Netscape changed its name to JavaScript. The general purpose core of the language has been embedded in Netscape, Internet Explorer and other browsers.</p><p>This contains more standard library of objects like <strong>Array, Date, </strong>and <strong>Math </strong>and a core set of language elements such as operators, control structure and statements. Core JavaScript can be extended for <strong>Client-side JavaScript</strong> and <strong>Server-side JavaScript</strong>.</p><h4>Client Side JavaScript (CSJS)</h4><p>CSJS is an extended version of JavaScript and the most common form of the language. This enables the administration and intensification of web pages and client browsers. The main tasks of CSJS are validating inputs, administrating UI/UX elements, animations, styles, calculation parts, popup windows are done when you don’t want the page to refresh so often. The script should be included <strong>HTML </strong>document for the interpreted by the browser. This is not static HTML, but can include programs that interact with the user, dynamically create HTML content.</p><p>This provides many advantages. As an example, we can use JavaScript to check a user input email address or a password in a form field. The JavaScript code is executed when the user submits the form, and only if all the entries are valid, it would submitted to the web server.</p><h4>Server Side JavaScript (SSJS)</h4><p>SSJS is also an extended version of JavaScript that enables <strong>back-end access</strong> to databases, servers and other file systems. It’s running over a local resources like <strong>C#</strong> or <strong>Java</strong>. But it’s syntaxes is based on JavaScript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*xfaX0k0j-5KIYNypAijfCg.jpeg" /><figcaption><strong>Node.JS</strong></figcaption></figure><p><strong>Node.JS</strong> is the best example for this. With Node.JS we write JavaScript to program on the server side, and that code can be seen as normal C#, C, or any other server side language code. As well as with server-side code, we can still send JavaScript to the client-side, but there is a huge difference between both, because CSSJ code is restricted to the clients machine resources according to the terms of computing permissions. As a example, client-side JavaScript can’t access the clients <strong>hard disk</strong>. But using server-side, clients can access to the hard disk without any problem.</p><p>SSJS advantage is the ability to highly customize the response based on the client’s requirements, access rights into data stores.</p><h4>Advantages of JavaScript</h4><ul><li><em>Less server interactions — </em>Validate user inputs before sending the page off to the server.</li><li><em>Immediate feedback to the visitors — </em>Don’t have to wait until the reload page.</li><li><em>Richer interfaces —</em>Can add more elements to the web pages.</li></ul><h4>Limitations of JavaScript</h4><ul><li>Client-side JavaScript doesn’t allow reading or writing files because of the computing permissions.</li><li>Can’t use for networking applications because there isn’t any support.</li><li>It doesn’t have any multithreading or multiprocessing capabilities.</li></ul><h4>JavaScript Development Tools</h4><p>There are many JavaScripting tools. As well as we can use a simple text editor like Notepad or Notepad++.</p><ul><li><em>WebStorm </em>— Provides full <strong>support</strong> for JavaScript, TypeScript, <strong>HTML</strong>, CSS.</li><li><em>Microsoft FrontPage</em> — Provides number of JavaScript tools to assist in the creation of interactive websites.</li><li><em>Macromedia Dreamweaver MX — </em>Provides several handy prebuilt JavaScript components, integrates well with databases, and conforms to new standards such as XHTML and XML.</li><li><em>Macromedia HomeSite 5 — </em>Used to manage personal websites effectively.</li></ul><h4>References</h4><pre><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">https://developer.mozilla.org/en-US/docs/Web/JavaScript</a></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3e8412b6742" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/javascript-c3e8412b6742">JavaScript</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>