<?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 Prasad Jayashanka on Medium]]></title>
        <description><![CDATA[Stories by Prasad Jayashanka on Medium]]></description>
        <link>https://medium.com/@prasadjay?source=rss-3f20ebae808f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*K0SjhCnGe8ejbHhr-YnGXQ.jpeg</url>
            <title>Stories by Prasad Jayashanka on Medium</title>
            <link>https://medium.com/@prasadjay?source=rss-3f20ebae808f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 08:14:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prasadjay/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[Trincomalee and Wilpattu — Exploring Sri Lanka]]></title>
            <link>https://medium.com/@prasadjay/trincomalee-and-wilpattu-exploring-sri-lanka-fcce1b6d64b3?source=rss-3f20ebae808f------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcce1b6d64b3</guid>
            <category><![CDATA[wilpattu]]></category>
            <category><![CDATA[4k]]></category>
            <category><![CDATA[sri-lanka]]></category>
            <category><![CDATA[gopro]]></category>
            <category><![CDATA[travel]]></category>
            <dc:creator><![CDATA[Prasad Jayashanka]]></dc:creator>
            <pubDate>Sat, 15 Dec 2018 06:00:21 GMT</pubDate>
            <atom:updated>2018-12-15T07:17:00.257Z</atom:updated>
            <content:encoded><![CDATA[<h3>Trincomalee and Wilpattu — Exploring Sri Lanka</h3><p>Four day journey around Trincomalee and safari in wilpattu Sri Lanka summarized in 13 minutes. Shot with Go Pro 7. Enjoy!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FACHpz8cvw7Q%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DACHpz8cvw7Q&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FACHpz8cvw7Q%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a10302096b702b255244f7b32fe0e72c/href">https://medium.com/media/a10302096b702b255244f7b32fe0e72c/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcce1b6d64b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon Cognito User Pools in NodeJS as fast as possible.]]></title>
            <link>https://medium.com/@prasadjay/amazon-cognito-user-pools-in-nodejs-as-fast-as-possible-22d586c5c8ec?source=rss-3f20ebae808f------2</link>
            <guid isPermaLink="false">https://medium.com/p/22d586c5c8ec</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[user-pool]]></category>
            <category><![CDATA[oauth2]]></category>
            <category><![CDATA[cognito]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Prasad Jayashanka]]></dc:creator>
            <pubDate>Tue, 05 Jun 2018 17:22:38 GMT</pubDate>
            <atom:updated>2018-10-22T05:12:18.288Z</atom:updated>
            <content:encoded><![CDATA[<p>Amazon cognito simplifies the authentication, authorization and user management for you. It has apis for sign in, sign up and miscellaneous user management apis built in and based on Oauth2 specification. Best thing about is it supports all major web platforms and mobile. SDKs are available for Obj-C, java and Swift as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*NTVIKDh8_tmdinB8pBJzhA.jpeg" /></figure><p>When it comes to Cognito there are two main attractions. And those two are there to do server different purposes.</p><ol><li>User pools</li><li>Identity pools</li></ol><p><strong>User pools </strong>is an identity provider. You can use this to authenticate users to your mobile app, website and manage users.</p><p><strong>Identity pools </strong>are used to authorize users to give access to your aws resources such as IAM, S3 and etc. That means you can configure an identity pool with many identity providers such as Amazon , Facebook, twitter and also user pools to give access to outside users without any kind of registration. Pretty neat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6TeBm2nxup6YeDm7axm_uA.png" /></figure><p>The scope of this story is to cover up accessing user pools via nodejs. Managing identity pools will be covered in another story. We will be using the JavaScript package and using it in NodeJS.</p><p><strong>Setting up User Pools</strong></p><p>First login to your aws account and go to cognito section. If you don’t have an aws account yet, create a free account which will be free for an year. Then go to Cognito section and then create a user pool.</p><ol><li>Give a name for the pool.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cbq_C7oDDrAyc2ioMjF4vQ.jpeg" /></figure><p>2. Select how you want to authenticate users using either email, phone or both.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*6F46R9wSV5YpLvFHRRXtHQ.jpeg" /></figure><p>3. When a user is successfully authenticated, you will receive 3 tokens. An id token, access token and a refresh token. The attributes you specify here will be mentioned in id token claims. You can use this claims as data in your services if you desire.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mKyM60RZcO_3Qd-SMTBYHQ.jpeg" /></figure><p>4. Define password and signup criteria.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lHDvqP3n0qrX-avJM4zFOA.jpeg" /></figure><p>5. Define multi factor authentication settings. I’m just going to leave it disabled for demo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sssMVkIcZ8oiB9wiwnth3g.jpeg" /></figure><p>6. If you want you can customize your email messages. So when a user sign ups he will get an email to confirm his account. You can customize that message in this screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6QzMbToeXYiz2bbYB2wOrQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5wa8rujAtFd3rX89IZzTXA.jpeg" /></figure><p>7. Add any tags you want to pool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*DcOWr44mHhX10kYiycXNKw.jpeg" /></figure><p>8. Define if remember user devices or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*D_sS6QPji658Yf_aIp25Rg.jpeg" /></figure><p>9. In here you have to click on “Add an app client” and create the app client. The app client generates an app client Id and it’s needed to access the pool from code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*ZOP7nyMEuEWyfOdnjTBVVA.jpeg" /></figure><p>EDIT : You should un-check the “Generate client secret”option since Javascript SDK doesn’t support client secret. Thanks to Alain who pointed out the error which I’ve missed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q9pFgfcP27XXWIg7V7kEUQ.jpeg" /></figure><p>10. If you want to execute any defined lambda functions at certain point of auth flow, you can specify those here. If not just skip it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HCCH-AF7D1VHLAJOWKsc-g.jpeg" /></figure><p>11. Finally review settings and create the pool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*08XpuODeWdiizuWtkS0YpQ.jpeg" /></figure><p>That’s about it. Now note down the pool region, pool id and app client id. When you click on created pool overview section you can retrieve pool id, if you go to app clients, you can retrieve the app client id. You are going to need those for next steps.</p><p>First install must needed packages.</p><pre>npm install --save amazon-cognito-identity-js<br>npm install --save aws-sdk<br>npm install --save request<br>npm install --save jwk-to-pem<br>npm install --save jsonwebtoken<br>npm install --save node-fetch</pre><p>Then import all packages.</p><pre>const AmazonCognitoIdentity = require(&#39;amazon-cognito-identity-js&#39;);<br>const CognitoUserPool = AmazonCognitoIdentity.CognitoUserPool;<br>const AWS = require(&#39;aws-sdk&#39;);<br>const request = require(&#39;request&#39;);<br>const jwkToPem = require(&#39;jwk-to-pem&#39;);<br>const jwt = require(&#39;jsonwebtoken&#39;);<br>global.fetch = require(&#39;node-fetch&#39;);</pre><p>Reason for importding node-fetch to global.fetch is because of amazon-cognito-identity-js package. It’s a javascript library meant for web browser and it uses fetch in library. Since nodejs don’t have fetch in built we have to emulate it like that.</p><p>Then define pool info.</p><pre>const poolData = {    <br>UserPoolId : &quot;&quot;, // Your user pool id here    <br>ClientId : &quot;&quot; // Your client id here<br>}; </pre><pre>const pool_region = &#39;us-east-1&#39;;</pre><p>Initiate user pool.</p><pre>const userPool = new AmazonCognitoIdentity.CognitoUserPool(poolData);</pre><p>Register User</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1790a9acbdb19c7a8b4fa6e464ac21a0/href">https://medium.com/media/1790a9acbdb19c7a8b4fa6e464ac21a0/href</a></iframe><p>Login</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89f70a1baa2f5460a9c40d1e674bfdc3/href">https://medium.com/media/89f70a1baa2f5460a9c40d1e674bfdc3/href</a></iframe><p>Update user data</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6156aab30622a2a16b3ac8ab47f6141/href">https://medium.com/media/d6156aab30622a2a16b3ac8ab47f6141/href</a></iframe><p>Validate/verify JWT token</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3fa263426fff0d3db21fc7cf122321cf/href">https://medium.com/media/3fa263426fff0d3db21fc7cf122321cf/href</a></iframe><p>Renew JWT tokens via refresh token. Usually id tokens retire after 1 hour of time, which is a hard limit for cognito. Using the refresh you obtained earlier you can get a new id_token, access_token with this rather than logging in again.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/769062022580a51b325260e205942d99/href">https://medium.com/media/769062022580a51b325260e205942d99/href</a></iframe><p>Delete User</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bce39c2438ff3ce413af71d4adde08d3/href">https://medium.com/media/bce39c2438ff3ce413af71d4adde08d3/href</a></iframe><p>Delete attributes</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c448b130ea3d8cf03529a5b8cee0c4a5/href">https://medium.com/media/c448b130ea3d8cf03529a5b8cee0c4a5/href</a></iframe><p>Change Password</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a12744ec363f031bb3220c38f50748ed/href">https://medium.com/media/a12744ec363f031bb3220c38f50748ed/href</a></iframe><p>There are lot of other tasks, but since the scope is to cover the most basic ones, this is it for now. On to Identity pools in the next story. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22d586c5c8ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GraphQL by example with NodeJs]]></title>
            <link>https://medium.com/@prasadjay/graphql-by-example-with-nodejs-c741d35a5e13?source=rss-3f20ebae808f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c741d35a5e13</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[graphql]]></category>
            <dc:creator><![CDATA[Prasad Jayashanka]]></dc:creator>
            <pubDate>Sun, 25 Feb 2018 15:55:21 GMT</pubDate>
            <atom:updated>2018-02-25T15:55:21.488Z</atom:updated>
            <content:encoded><![CDATA[<p>GraphQL is the new kid in the block ( sort of, not exactly new though ) from facebook. So let’s figure it out in QA style!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*BgClbseDdhGP2G9w5tTVYQ.png" /></figure><h3><strong>What is GraphQL?</strong></h3><p>GraphQL is a <a href="http://graphql.org/learn/">common language developed by facebook</a> for data querying. Project began on 2012 and was publicly available since 2015, but first stable release came up on 2016 October. And this doesn’t concern with a particular language. This is <a href="http://graphql.org/code/">already available with most popular languages</a> so far.</p><h3><strong>So what’s all this fuss? We already have REST, why would we possibly want another?</strong></h3><p>Nothing is superior. Everything has its own strengths and weaknesses. But GraphQL shines on following key factors.</p><ol><li>Less number of API endpoints. In a REST service we would want to have multiple enpoints to query different datasets. But with GraphQL, we only have 0 or very few number of endpoints. With a single request, we can get an object and its related objects.</li><li>Allows the requester to define the response JSON rather than giving a pre coded response.</li><li>Version management is easy with fields since requester can define the response. In REST services, usually we manage by version identities like v1, v2… etc. But with GraphQL we can easily add/remove fields from GraphQL schema to reflect changes.</li><li>Solves over/under fetching since the response we get is as what we need, nothing more.</li><li>Ability to call multiple endpoints in a single request.</li></ol><p>Still confused? Let’s build ourselves a small API and see all in action!</p><p>The sample code for this article is available at my <a href="https://github.com/prasadjay/graphql-vehicleshop/">Github graphql-vehicleshop repository</a>.</p><p>This will be a small API to create, delete and query on entries of vehicles. Language I’m going to use is NodeJs with MongoDB as the database for application. You should have already installed MongoDB for this, if not quickly <a href="https://www.mongodb.com/download-center#community">download community installer</a>.</p><h3><strong>Setting up the project.</strong></h3><ol><li>Create a new directory and go in to that directory from the terminal. Run following codes in terminal to get this running up.</li><li>npm init</li><li>Answer the small set of questions, give entry point as app.js and a package.json will be created for you. Then create an app.js file inside the directory.</li><li>Install express. npm intall --save express</li><li>Install GraphQL packages. npm install --save graphql express-graphql</li><li>Install Mongoose as the ORM for MongoDB. npm install --save mongoose</li><li>That’s everything for setting up the project. Since this is just a sample code I’m not going to bother about using env variables for configurations, I will hard code them, but remember for production code, always use configurations in ENV variables. ( <a href="https://12factor.net/">See 12 factor app methodology</a> )</li></ol><p>Even we are using express, you can use even restify library for this also since express-graphql supports both libraries.</p><h3><strong>Setting up the service.</strong></h3><p>Let’s set up the app.js file. We are going to do few things first. First we have to open up the express server then connect to mongodb.</p><ol><li>Setup express server.</li></ol><pre><strong>const </strong>express = require(<strong>&#39;express&#39;</strong>);<br><strong>const </strong>app = express();<br><strong>const </strong>mongoose = require(<strong>&#39;mongoose&#39;</strong>);<br><br>app.get(<strong>&#39;/&#39;</strong>, (req, res)=&gt;{<br>    res.<strong>end</strong>(<strong>&quot;graphql-vehicleshop is running on 3000 port...&quot;</strong>);<br>})<br><br>app.listen(<strong>&#39;3000&#39;</strong>, ()=&gt;{<br>    <strong>console</strong>.log(<strong>&quot;Server is starting on 3000 port...&quot;</strong>)<br>})</pre><p>Now if you run the code node app.js you will see in the terminal a message saying server has started. If you type localhost:3000 on browser you will be treated with the message saying the same.</p><p>2. Connect to mongoDB.</p><pre><em>//connect to mongodb...<br></em>mongoose.connect(<strong>`mongodb://127.0.0.1/vehicledb`</strong>);<br>mongoose.<strong>connection</strong>.<strong>on</strong>(<strong>&#39;error&#39;</strong>, err =&gt; <strong>console</strong>.error(<strong>&#39;FAILED to connect to mongodb instance.&#39;</strong>, err));<br>mongoose.<strong>connection</strong>.<strong>once</strong>(<strong>&#39;open&#39;</strong>, () =&gt; <strong>console</strong>.log(<strong>&#39;Connected to mongodb instance.&#39;</strong>));`</pre><p>You can place this right below where mongoose in imported. If your MongoDB has authentication, you may want to change the connection string.</p><p>Okay now basic service is up and running. Next let’s define the mongodb schema for this service and the GraphQL schema.</p><h3><strong>Define MongoDB schema.</strong></h3><p>Create a sub directory as “ model” inside the project and create a javascript file. I created as “vehicle.js”. Inside it import mongoose and schema constants and define the schema. Finally export it.</p><pre><strong>const </strong>mongoose = require(<strong>&#39;mongoose&#39;</strong>);<br><strong>const </strong>Schema = mongoose.Schema;<br><br><strong>const </strong>vehicle = <strong>new </strong>Schema({<br>    <strong>carname</strong>: String,<br>    <strong>year</strong>: Number,<br>    <strong>transmission</strong>: String,<br>    <strong>fuelType</strong>: String,<br>    <strong>engineCapacity</strong>: Number<br>});<br><br>module.exports = mongoose.model(<strong>&#39;vehicle&#39;</strong>, vehicle);`</pre><p>When new data is inserted a new collection inside mongodb will be created as “vehicle” with the attributes mentioned. So in the end your vehicle.js should look like above code.</p><h3><strong>Define GraphQL schema.</strong></h3><p>Create another sub directory as “graphSchema” and create another javascript file (vehicleSchemaGQL.js) inside it to define the GraphQL schema.</p><p>In here we should import graphql library and the Mongoose model we created from “model/vehicle.js”. Then create a basic schema, define query and mutator interfaces and export them. Let’s do it!</p><ol><li>Importing stuff</li></ol><pre><strong>const </strong>graphql = require(<strong>&#39;graphql&#39;</strong>);<br><strong>const vehicle </strong>= require(<strong>&#39;./../model/vehicle&#39;</strong>);</pre><p>2. Then define the basic GraphQL schema.</p><pre><strong>const </strong>VehicleSchema = <strong>new </strong>graphql.<strong>GraphQLObjectType</strong>({<br>    <strong>name</strong>: <strong>&#39;vehicle&#39;</strong>,<br>    <strong>description</strong>: <strong>&#39;a vehicle to be sold&#39;</strong>,<br>    <strong>fields</strong>: {<br>        <strong>_id</strong>: {<strong>type</strong>: graphql.<strong>GraphQLString</strong>},<br>        <strong>carname</strong>: {<strong>type</strong>: graphql.<strong>GraphQLString</strong>},<br>        <strong>year</strong>: {<strong>type</strong>: graphql.<strong>GraphQLInt</strong>},<br>        <strong>transmission</strong>: {<strong>type</strong>: graphql.<strong>GraphQLString</strong>},<br>        <strong>fuelType</strong>: {<strong>type</strong>: graphql.<strong>GraphQLString</strong>},<br>        <strong>engineCapacity</strong>: {<strong>type</strong>: graphql.<strong>GraphQLInt</strong>}<br>    }<br>})</pre><p>Note that fields in mongoose schema are available here as well. This is where versioning becomes easy, when you change API you can easily swap fields and not bother about result because it all depends on how requester requests it. More on that comes later. You can say which of these fields you want to be in response and not.</p><p>3. Define query and mutation types. Schema should have these querying and mutator interfaces in order to interact with data. When you define the interface you can specify multiple endpoints inside the type.</p><ul><li><strong>Query Type ( 2 methods )</strong></li></ul><pre><strong>const </strong>query = <strong>new </strong>graphql.GraphQLObjectType({<br>    <strong>name</strong>: <strong>&#39;vehicleQuery&#39;</strong>,<br>    <strong>fields</strong>: {<br>        <strong>vehicle</strong>: {<br>            <strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLList</strong>(VehicleSchema),<br>            <strong>args</strong>: {<br>                <strong>_id</strong>: {<strong>type</strong>: graphql.<strong>GraphQLString</strong>},<br>                <strong>carname</strong>: {<strong>type</strong>: graphql.<strong>GraphQLString</strong>}<br>            },<br>            resolve: (_, {_id, carname}) =&gt; {<br>                <strong>let </strong>where;<br>                <strong>if </strong>(_id){<br>                    where = {<strong>_id</strong>: _id};<br>                }<strong>else if </strong>(carname){<br>                    where = {<strong>carname</strong>: carname};<br>                }<strong>else</strong>{<br>                    where = {};<br>                }<br>                <strong>return vehicle</strong>.find(where);<br>            }<br>        },<br>        <strong>getByCapacity</strong>: {<br>            <strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLList</strong>(VehicleSchema),<br>            <strong>args</strong>: {<br>                <strong>capacity</strong>: {<strong>type</strong>: graphql.<strong>GraphQLInt</strong>}<br>            },<br>            resolve: (_, {capacity}) =&gt; {<br>                <strong>let </strong>where;<br>                <strong>if </strong>(capacity){<br>                    where = {<strong>engineCapacity</strong>: { <strong>$lt</strong>: capacity }};<br>                }<strong>else</strong>{<br>                    where = {};<br>                }<br>                <strong>return vehicle</strong>.find(where);<br>            }<br>        }<br>    }<br>})</pre><ol><li>Query the vehicle. you can pass id of the entity and query by it ( simulates GetById in REST ) or pass carname and get the result ( simulates GetByName) or pass nothing and get all the results ( simulates GetAll).</li><li>Queries by capacity less than included capacity. I included this method to show that how we can call multiple endpoints in one request. More on that later in this article.</li></ol><ul><li><strong>Mutations Type ( 2 methods )</strong></li></ul><p>Below code holds the two endpoints for creating and deleting cars from database.</p><pre><strong>const </strong>mutation = <strong>new </strong>graphql.<strong>GraphQLObjectType</strong>({<br>    <strong>name</strong>: <strong>&#39;vehicleMutations&#39;</strong>,<br>    <strong>fields</strong>: {<br>        <strong>create</strong>: {<br>            <strong>type</strong>: VehicleSchema,<br>            <strong>args</strong>: {<br>                <strong>carname</strong>: {<strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLNonNull</strong>(graphql.<strong>GraphQLString</strong>)},<br>                <strong>year</strong>: {<strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLNonNull</strong>(graphql.<strong>GraphQLInt</strong>)},<br>                <strong>transmission</strong>: {<strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLNonNull</strong>(graphql.<strong>GraphQLString</strong>)},<br>                <strong>fuelType</strong>: {<strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLNonNull</strong>(graphql.<strong>GraphQLString</strong>)},<br>                <strong>engineCapacity</strong>: {<strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLNonNull</strong>(graphql.<strong>GraphQLInt</strong>)},<br>            },<br>            resolve: (_, {carname, year, transmission, fuelType, engineCapacity}) =&gt; {<br>                <strong>let </strong>v = <strong>new vehicle</strong>({carname, year, transmission, fuelType, engineCapacity});<br>                <strong>return </strong>v.save()<br>            }<br>        },<br>        <strong>delete</strong>: {<br>            <strong>type</strong>: VehicleSchema,<br>            <strong>args</strong>: {<br>                <strong>_id</strong>: {<strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLNonNull</strong>(graphql.<strong>GraphQLString</strong>)}<br>            },<br>            resolve: (_, {_id}) =&gt; {<br>                <strong>return vehicle</strong>.findOneAndRemove(_id);<br>            }<br>        }<br>    }<br>})</pre><p>In create method we specify the in arguments then then after saved in mongo return the promise by mongo. Same in the delete method. Get the id from in argument and delete from mongo, then return the promise.</p><p>Finally export the GraphQL schema with query and mutation interfaces.</p><pre>module.exports = <strong>new </strong>graphql.<strong>GraphQLSchema</strong>({<br>    query,<br>    mutation<br>})</pre><p>Final vehicleSchemaGQL.js should look like this.</p><pre><strong>const </strong>graphql = require(<strong>&#39;graphql&#39;</strong>);<br><strong>const vehicle </strong>= require(<strong>&#39;./../model/vehicle&#39;</strong>);<br><br><strong>const </strong>VehicleSchema = <strong>new </strong>graphql.<strong>GraphQLObjectType</strong>({<br>    <strong>name</strong>: <strong>&#39;vehicle&#39;</strong>,<br>    <strong>description</strong>: <strong>&#39;a vehicle to be sold&#39;</strong>,<br>    <strong>fields</strong>: {<br>        <strong>_id</strong>: {<strong>type</strong>: graphql.<strong>GraphQLString</strong>},<br>        <strong>carname</strong>: {<strong>type</strong>: graphql.<strong>GraphQLString</strong>},<br>        <strong>year</strong>: {<strong>type</strong>: graphql.<strong>GraphQLInt</strong>},<br>        <strong>transmission</strong>: {<strong>type</strong>: graphql.<strong>GraphQLString</strong>},<br>        <strong>fuelType</strong>: {<strong>type</strong>: graphql.<strong>GraphQLString</strong>},<br>        <strong>engineCapacity</strong>: {<strong>type</strong>: graphql.<strong>GraphQLInt</strong>}<br>    }<br>})<br><br><strong>const </strong>query = <strong>new </strong>graphql.<strong>GraphQLObjectType</strong>({<br>    <strong>name</strong>: <strong>&#39;vehicleQuery&#39;</strong>,<br>    <strong>fields</strong>: {<br>        <strong>vehicle</strong>: {<br>            <strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLList</strong>(VehicleSchema),<br>            <strong>args</strong>: {<br>                <strong>_id</strong>: {<strong>type</strong>: graphql.<strong>GraphQLString</strong>},<br>                <strong>carname</strong>: {<strong>type</strong>: graphql.<strong>GraphQLString</strong>}<br>            },<br>            resolve: (_, {_id, carname}) =&gt; {<br>                <strong>let </strong>where;<br>                <strong>if </strong>(_id){<br>                    where = {<strong>_id</strong>: _id};<br>                }<strong>else if </strong>(carname){<br>                    where = {<strong>carname</strong>: carname};<br>                }<strong>else</strong>{<br>                    where = {};<br>                }<br>                <strong>return vehicle</strong>.find(where);<br>            }<br>        },<br>        <strong>getByCapacity</strong>: {<br>            <strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLList</strong>(VehicleSchema),<br>            <strong>args</strong>: {<br>                <strong>capacity</strong>: {<strong>type</strong>: graphql.<strong>GraphQLInt</strong>}<br>            },<br>            resolve: (_, {capacity}) =&gt; {<br>                <strong>let </strong>where;<br>                <strong>if </strong>(capacity){<br>                    where = {<strong>engineCapacity</strong>: { <strong>$lt</strong>: capacity }};<br>                }<strong>else</strong>{<br>                    where = {};<br>                }<br>                <strong>return vehicle</strong>.find(where);<br>            }<br>        }<br>    }<br>})<br><br><strong>const </strong>mutation = <strong>new </strong>graphql.<strong>GraphQLObjectType</strong>({<br>    <strong>name</strong>: <strong>&#39;vehicleMutations&#39;</strong>,<br>    <strong>fields</strong>: {<br>        <strong>create</strong>: {<br>            <strong>type</strong>: VehicleSchema,<br>            <strong>args</strong>: {<br>                <strong>carname</strong>: {<strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLNonNull</strong>(graphql.<strong>GraphQLString</strong>)},<br>                <strong>year</strong>: {<strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLNonNull</strong>(graphql.<strong>GraphQLInt</strong>)},<br>                <strong>transmission</strong>: {<strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLNonNull</strong>(graphql.<strong>GraphQLString</strong>)},<br>                <strong>fuelType</strong>: {<strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLNonNull</strong>(graphql.<strong>GraphQLString</strong>)},<br>                <strong>engineCapacity</strong>: {<strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLNonNull</strong>(graphql.<strong>GraphQLInt</strong>)},<br>            },<br>            resolve: (_, {carname, year, transmission, fuelType, engineCapacity}) =&gt; {<br>                <strong>let </strong>v = <strong>new vehicle</strong>({carname, year, transmission, fuelType, engineCapacity});<br>                <strong>return </strong>v.save()<br>            }<br>        },<br>        <strong>delete</strong>: {<br>            <strong>type</strong>: VehicleSchema,<br>            <strong>args</strong>: {<br>                <strong>_id</strong>: {<strong>type</strong>: <strong>new </strong>graphql.<strong>GraphQLNonNull</strong>(graphql.<strong>GraphQLString</strong>)}<br>            },<br>            resolve: (_, {_id}) =&gt; {<br>                <strong>return vehicle</strong>.findOneAndRemove(_id);<br>            }<br>        }<br>    }<br>})<br><br>module.exports = <strong>new </strong>graphql.<strong>GraphQLSchema</strong>({<br>    query,<br>    mutation<br>})</pre><p>Now the hard part is almost over.. Import GraphQL schema to app.js, and GraphQL libraries, define web interface for GraphQL. Let’s do that too.</p><h3><strong>Define GraphQL service endpoints</strong></h3><ol><li>First import graphql express library and then import schema we just created. You can place this code below mongodb import in app.js</li></ol><pre><strong>const </strong>graphqlHTTP = require(<strong>&#39;express-graphql&#39;</strong>);<br><strong>const schema </strong>= require(<strong>&#39;./graphSchema/vehicleSchemaGQL&#39;</strong>);</pre><p>2. Define GraphQL service endpoint</p><pre>app.use(<strong>&#39;/graphql&#39;</strong>, graphqlHTTP({<br>    <strong>schema</strong>,<br>    <strong>graphiql</strong>: <strong>true<br></strong>}))</pre><p>First argument is the defined schema. Second argument is if we want the graphical user interface to test queries. It’s not necessary to have but nice to have to test stuff. On production disable it by putting false as the value. You can view the UI from <a href="http://localhost:3000/graphql">http://localhost:3000/graphql</a> in the web browser.</p><p>Also note that route handler is not get/post/del like but “app.use”. This interface accepts both GET and POST requests.</p><p>Now the final app.js file should look something like this.</p><pre><strong>const </strong>express = require(<strong>&#39;express&#39;</strong>);<br><strong>const </strong>app = express();<br><strong>const </strong>mongoose = require(<strong>&#39;mongoose&#39;</strong>);<br><br><em>//connect to mongodb...<br></em>mongoose.connect(<strong>`mongodb://127.0.0.1/vehicledb`</strong>);<br>mongoose.<strong>connection</strong>.<strong>on</strong>(<strong>&#39;error&#39;</strong>, err =&gt; <strong>console</strong>.error(<strong>&#39;FAILED to connect to mongodb instance.&#39;</strong>, err));<br>mongoose.<strong>connection</strong>.<strong>once</strong>(<strong>&#39;open&#39;</strong>, () =&gt; <strong>console</strong>.log(<strong>&#39;Connected to mongodb instance.&#39;</strong>));<br><br><strong>const </strong>graphqlHTTP = require(<strong>&#39;express-graphql&#39;</strong>);<br><strong>const schema </strong>= require(<strong>&#39;./graphSchema/vehicleSchemaGQL&#39;</strong>);<br><br>app.get(<strong>&#39;/&#39;</strong>, (req, res)=&gt;{<br>    res.<strong>end</strong>(<strong>&quot;graphql-vehicleshop is running on 3000 port...&quot;</strong>);<br>})<br><br>app.use(<strong>&#39;/graphql&#39;</strong>, graphqlHTTP({<br>    <strong>schema</strong>,<br>    <strong>graphiql</strong>: <strong>true<br></strong>}))<br><br>app.listen(<strong>&#39;3000&#39;</strong>, ()=&gt;{<br>    <strong>console</strong>.log(<strong>&quot;Server is starting on 3000 port...&quot;</strong>)<br>})</pre><p>That’s the end of configuring the project. Now lets test it!</p><h3><strong>Testing the API</strong></h3><p>If everything is correct when you run the node application. You can either access by UI from <a href="http://localhost:3000/graphql">http://localhost:3000/graphql</a> or use POSTMAN like rest client or use a <a href="https://insomnia.rest/">GraphQL supported REST client like Insomnia</a> which I highly recomment. I mean seriously, Insomnia client is that good!</p><p>But nevermind let’s check out both!</p><h3><strong>GraphiQL UI</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b1k6oLcV9V88XWZzEg6t4g.png" /></figure><p>This is the editor you will get when you launch. You can type queries in the left pane and execute. Let’s do some.</p><p><strong>Insert vehicle</strong></p><p>mutation {<br> create(carname: “Ferrari 488 GTB”, year:2017, transmission:”dual clutch auto”, fuelType:”petrol”, engineCapacity:4000) {<br> _id,<br> carname,<br> year,<br> transmission,<br> fuelType,<br> engineCapacity<br> }<br>}</p><p>Query is quite simple. We want to mutate, use the create function and when it’s done return the specified field values in the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gzzqN9EXc0IBuMnAKkbnrw.png" /></figure><p>You an execute by pressing play button on left side and response is shown in the right side. Add few items using this.</p><p><strong>Get all vehicles</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*Zkf0n_ggGbObKO6NWM9hJg.png" /></figure><p>Query explains it self.. Get all vehicles but return only field values of carname, year and enginecapacity.</p><p><strong>Get By name</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*cYOEkJILRcSn83r6QcgLdw.png" /></figure><p><strong>Get By ID</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*LIfvS5oxeVxGLXsMxn6E9Q.png" /></figure><p><strong>Execute multiple queries in one request.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*h0mSjiy6Ho2GWVnKz3eXyA.png" /></figure><p>This is one of the killer features of GraphQL. See in here we have requested both available endpoints and the response does include both responses. In REST we would have to do 2 requests or make combined endpoints, but in here it’s all ready to use at no extra development cost. Ain’t that grand!</p><p>And as you seen, for all these stuff there is only one endpoint exposed. Which is pretty incredible considering if we used REST endpoints there will be around 5–6 different endpoints just for these few tasks.</p><p>Refer the querying guide on official documentation since this article doesn’t cover on that department entirely.</p><h3><strong>GraphQL Web interface</strong></h3><p>What if you don’t want to use the UI. Easiest way is to use<a href="http://insomnia.rest/"> Insomnia REST client which has built in GraphQL support</a> which is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*BgClbseDdhGP2G9w5tTVYQ.png" /></figure><p>Or you can use normal postman like REST client which doesn’t support GraphQL over HTTP. <a href="http://graphql.org/learn/serving-over-http/">For more information take a look at this document.</a></p><p>To send over HTTP you have to format the query to a JSON without changing the URL then send via a POST request.</p><p>ex:</p><p>{“query”:”query {\n vehicle(carname:\”Nissan GTR\”) {\n carname,\n year,\n engineCapacity\n }\n}”}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ILvyuZda4d-FAVJEyOrZjg.png" /></figure><p>So that’s about it. Quite a long article. But I believe it will be a usable one. It was really interesting working with GraphQL for a change and I think this will go forward in time and looking forward to it. Until next time. Adios! 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c741d35a5e13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Percona Monitoring and Management]]></title>
            <link>https://medium.com/@prasadjay/percona-monitoring-and-management-b10b6d84f89a?source=rss-3f20ebae808f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b10b6d84f89a</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[percona]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[mongodb]]></category>
            <dc:creator><![CDATA[Prasad Jayashanka]]></dc:creator>
            <pubDate>Sat, 30 Sep 2017 12:19:23 GMT</pubDate>
            <atom:updated>2017-09-30T12:20:08.523Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.percona.com/">Percona</a> is a company which makes software for MySQL, MongoDB and MariaDB and also provides managed services and consultations for businesses. They have their own Percona Server which is derived from MySQL with lots of optimizations and also another derived from MongoDB.</p><p><a href="https://www.percona.com/software/database-tools/percona-monitoring-and-management">Percona monitoring and management(PMM)</a> is an awesome tool from them to monitor MySQL based dbs like MySQL, ProxySQL and also for MongoDB. It generates user friendly beautiful metric monitoring thanks to Grafana like this. Ain’t that grand, eh? ;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xAv4aI5IPi5AzEigHPvoGA.png" /></figure><p>Not only that also comes with query analytics. This is very useful tool for sysadmins and developers to keep track of their cluster health. Also with plugins also can be used to manage replication.</p><p>This runs as twin module server and client nodes. Following diagram is an overview of the architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rzWfIcVj9iDpdsFn4ectvw.png" /></figure><p>Client is installed at database instance node and server is installed in a dedicated host. As an example if you have multiple databases client software should be installed at all server hosts and there should be another server running for installing server module for monitoring. If it’s just one mysql server you can install it in the same server but at the cost of 5–10% processor usage.</p><p><a href="https://www.percona.com/blog/2016/03/08/orchestrator-mysql-replication-topology-manager/"><strong>Orchestrator</strong></a> is a MySQL replication topology manager. At default settings orchestrator is enabled in PMM server module but can be activated with a simple argument passed to it’s init. It can make topology changes with GUI easily or with CLI or via API. And also monitors replication states.</p><p><a href="https://prometheus.io/"><strong>Prometheus</strong></a><strong> </strong>is an open source monitoring API. It’s what responsible of extracting metrics off of mysql, proxysql, mongodb and system.</p><p><a href="https://github.com/percona/qan-api"><strong>QAN API</strong></a> is a Golang API for query analytics by Percona. For MySQL it uses slow query log to analyze queries.</p><p><a href="https://grafana.com/"><strong>Grafana</strong></a><strong> </strong>is a open source analytic and metric software with lots of plugins for 3rd party integrations such as percona. The main UI components are composed from Grafana.</p><p>So the handcrafted package of those components presents as percona monitoring and management. Setting up is relatively easy.</p><p>To setup PMM there are few ways. The way I used was using the docker way for PMM Server and getting PMM client off of apt repository for the MySQL server node I had on a Ubuntu 14.04 instance. <a href="https://learn.percona.com/download-percona-monitoring-and-management-pmm-1-3-manual">For full installation steps use the guide downloadable from here for all other ways included.</a></p><p>Following are the steps I followed for my testing environment with minimal settings required. You need to have either MySQL variant or MongoDB installed to fetch metrics.</p><p><strong>Setting up the PMM Server</strong></p><pre>1) Install docker ( Must be version 1.2 or up )<br>2) docker pull percona/pmm-server:latest<br>3) docker create -v /opt/prometheus/data -v /opt/consul-data -v /var/lib/mysql -v /var/lib/grafana --name pmm-data percona/pmm-server:latest /bin/true<br>(That line creates a docker to save data.)</pre><pre>4) docker run -d -p 80:80 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server:latest<br>(If your server&#39;s 80 port is occupied use another port. ex: -p 8080:80)</pre><pre>5) Run &quot;docker ps&quot; and check if it&#39;s running</pre><p>Now you must be able to check the UI of PMM server component via browser. But server is yet to be configured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kN2M4xLYXqna5mR7JmsgyQ.png" /></figure><p>Next SSH in to the instance which your database instance is running on.</p><p><strong>Setting up the PMM Client</strong></p><pre>1) wget <a href="https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release">https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release</a> -sc)_all.deb</pre><pre>2) sudo dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb</pre><pre>3) sudo apt-get update</pre><pre>4) sudo apt-get install pmm-client</pre><p>Now PMM client is installed. Next step is to connect to server.</p><pre>sudo pmm-admin config --server &lt;PMM_server_ip:port&gt;</pre><pre>This should output like this.</pre><pre>----------------------------------------------------<br>OK, PMM server is alive.</pre><pre>PMM Server | &lt;ip&gt; <br>Client Name | &lt;hostname&gt; <br>Client Address | &lt;ip&gt;<br>----------------------------------------------------</pre><p>Now can start specifying which dbs should be used for monitoring.</p><p>For MySQL</p><pre>$ sudo pmm-admin add mysql --password &lt;password&gt;</pre><p>For MongoDB</p><pre>$ sudo pmm-admin add mongodb --password &lt;password&gt;</pre><p>For ProxySQL</p><pre>$ sudo pmm-admin add proxysql:metrics</pre><p>To recheck what are the db sources being monitored, run following command.</p><pre>$ sudo pmm-admin list</pre><pre>This should output some the list of configs you have done so far. Something which look like this.</pre><pre>pmm-admin 1.3.1</pre><pre>PMM Server      | &lt;ip&gt;:&lt;port&gt;<br>Client Name     | &lt;hostname&gt;<br>Client Address  | &lt;ip&gt;<br>Service Manager | linux-upstart</pre><pre>-------------- --------------- ----------- -------- ------------------------------------------- ---------------------------------------------<br>SERVICE TYPE   NAME            LOCAL PORT  RUNNING  DATA SOURCE                                 OPTIONS<br>-------------- --------------- ----------- -------- ------------------------------------------- ---------------------------------------------<br>mysql:queries  &lt;hostname&gt;-           YES      root:***@unix(/var/run/mysqld/mysqld.sock)  query_source=perfschema, query_examples=true<br>linux:metrics  &lt;hostname&gt;  42000       YES      -<br>mysql:metrics  &lt;hostname&gt;  42002       YES      root:***@unix(/var/run/mysqld/mysqld.sock)</pre><p>That’s it for the configurations. Pretty easy.</p><p>Following are some of the screenshots I grabbed from my instance.</p><p><strong>Query Analytics</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sDBTgd7hevFo09zVzgTjFQ.png" /><figcaption>From this screen can fetch information such as QPS, load and latency.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*agoF7ObICljPmJPhUUwF8Q.png" /><figcaption>When clicked on an entry you can view more information about that specific query and the breakdown of it.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lZlqmbjN4T1mgsLb5aX9VA.png" /><figcaption>System Overview ( Screen 1 )</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-3bf9MKYLvURQORN2eVNQ.png" /><figcaption>System Overview ( Screen 2 )</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pRdBmgalxhFslgiamuJ6Eg.png" /><figcaption>InnoDB metrics ( Transactions, deadlocks, I/O, ICP )</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJFw5uXyQvQepEg3flzzPw.png" /><figcaption>InnoDB metrics ( Pool pages, Pool requests, Buffer activity )</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a9q4j8dUN_AvgRBF7G1izA.png" /><figcaption>Cross Server Graphs ( Memory, MySQL transaction, traffic, network and query count )</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NqNXqjYJ7ia27_hDg0va6A.png" /><figcaption>MySQL performance schema monitoring</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MkOBCZem-VZ5QOc1lReA0A.png" /><figcaption>MySQL table stats</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YiUwGOWuXddiU2R2YM7Ofg.png" /><figcaption>Summary dashboard for both system and databases</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NvWgdh22UpKc0ZVesk8ilA.png" /><figcaption>Disk load, utilization, I/O</figcaption></figure><p>These are few of many monitoring capabilities of Percona monitoring and management system. I’m definitely a fan of this. Other than rough 5% performance hit everything worked well. But then again it’s an agent residing on instance polling in timeouts so can’t really complaint. Refresh cycle timing can be changed as low as 5 seconds but once 30 seconds or once a month is a much better choice. Next would be testing replication management with this. If all goes well I will have something to write on as well. A day well spent anyway :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b10b6d84f89a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hola Mundo…]]></title>
            <link>https://medium.com/@prasadjay/hola-mundo-41e2126b168c?source=rss-3f20ebae808f------2</link>
            <guid isPermaLink="false">https://medium.com/p/41e2126b168c</guid>
            <dc:creator><![CDATA[Prasad Jayashanka]]></dc:creator>
            <pubDate>Fri, 29 Sep 2017 17:39:26 GMT</pubDate>
            <atom:updated>2017-09-29T17:39:26.348Z</atom:updated>
            <content:encoded><![CDATA[<p>As the time of writing I’m a 26 year old tinker from Sri Lanka who likes solving puzzles and learning new things. I work at a company called Duo Software and my work is mostly based on back-end services and middleware. Other than that I’m very keen on cars and games. Oh yes keeping up with clichés.</p><p>I always wanted some space in web which has all my thoughts and adventures in a single place. But every attempt to do so have result in complete failure. Let’s see if I can keep up with this from now on. Well you could reach me via <a href="https://www.facebook.com/prasad.jayashanka">Facebook</a> or <a href="https://www.linkedin.com/in/prasad-jayashanka/">LinkedIn</a> or just good old <a href="/service/mailto:prasadjayashanka@gmail.com">Email</a>. Adios…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41e2126b168c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>