<?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 Manish Rai Jain on Medium]]></title>
        <description><![CDATA[Stories by Manish Rai Jain on Medium]]></description>
        <link>https://medium.com/@manishrjain?source=rss-c9b525a6d2bd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VF__uGC4VpwgbDP6.jpeg</url>
            <title>Stories by Manish Rai Jain on Medium</title>
            <link>https://medium.com/@manishrjain?source=rss-c9b525a6d2bd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 02:05:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@manishrjain/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why am I trying Ergodox after 8.5 years of Kinesis Advantage?]]></title>
            <link>https://medium.com/@manishrjain/why-am-i-trying-ergodox-after-8-5-years-of-kinesis-advantage-b6641c18e747?source=rss-c9b525a6d2bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6641c18e747</guid>
            <category><![CDATA[keyboard]]></category>
            <category><![CDATA[vim]]></category>
            <category><![CDATA[ergonomics]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Manish Rai Jain]]></dc:creator>
            <pubDate>Tue, 02 Jan 2018 00:56:58 GMT</pubDate>
            <atom:updated>2018-03-13T18:12:45.412Z</atom:updated>
            <content:encoded><![CDATA[<p>Late last week, I received a new shiny <a href="https://ergodox-ez.com/">Ergodox EZ</a> keyboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mx7TY4CeWZUE72ELQS9RmQ.jpeg" /><figcaption>Wings of ErgoDox EZ</figcaption></figure><p>This is the configuration:</p><ul><li>1x Tilt/Tent Kit — Black</li><li>1x The Wing: Custom ErgoDox EZ Wrist Rest</li><li>1x ErgoDox EZ Shine Standalone — Blank / Black / Cherry MX Clear</li></ul><p>I decided to go with the more resistant Cherry MX Clear keys, because I tend to bottom out with my current Kinesis Advantage keyboard, with the Cheery MX Brown. You can see a list of <a href="https://ergodox-ez.com/pages/keyswitches">keyswitches offered</a> here.</p><h3>The similarities to Kinesis Advantage are obvious.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ASOESIkiPoOwXtiXmsq1Q.jpeg" /><figcaption>Kinesis Advantage 2</figcaption></figure><p>The entire keyboard, minus a vertical set of keys is directly from the Advantage. In fact, this vertical set of keys (left most on right split, right most on left) is a bit hard to reach with thumb without accidentally pressing nearby keys, as my initial attempts to use them found. Over the day though, I realized pressing them with my index finger rather than thumb is a better approach. I mapped them out to Ctrl and Windows keys.</p><p>You can see my <a href="http://configure.ergodox-ez.com/keyboard_layouts/krravv/edit">current keyboard layout here</a>. This is still a work in progress, so expect more updates as time goes — each update has an incrementing roman numeral (currently at VI).</p><p>I’ve designed the layout around Qwerty, Vim, i3-wm and Go language.</p><h3>What’s so unique about Ergodox?</h3><p>Ergodox is a lot smaller and more lightweight than Advantage. The splits are small enough to take along with the laptop during trips, which means Ergodox would see lot more action if you do frequent travels. <strong>This was the prime reason for me to order it,</strong> and I’d consider it the most unique selling point (USP) of the product.</p><p>The second biggest USP is the <a href="http://configure.ergodox-ez.com/keyboard_layouts/new">online graphical configurator</a>. Never has remapping keys been so easy. It’s so useful that I decided to forgo the key<br>prints on the keycaps entirely, and use the blank edition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eiIAp1HnufMu40xLnBEETQ.jpeg" /><figcaption>Blank keys are like blank canvases, customize away.</figcaption></figure><p>The configurator really brought the advantage of layers to me. Before this, I<br>think I was familiar with the concept, but it just never took hold. While coding, with the typical QWERTY layout, the brackets were never convenient, either too far down, or too far up. With Ergodox, I put those into a new layer (Layer 1), right in my left home row. Not only those, but I ran a little script and found the most common letters used in the posting package of Dgraph.</p><p>It’s a work in progress, but I mapped those to layer 1 as well.</p><blockquote>sed ‘s/\(.\)/\1\n/g’ *.go | sort | grep -v ‘[a-z A-Z]’ | uniq -c | sort -nrk 1</blockquote><p>Also have a look at the <a href="http://configure.ergodox-ez.com/keyboard_layouts/krravv/edit">Windows key I set</a>, which is in a great location for all<br>the <a href="https://i3wm.org/">i3-wm</a> keyboard actions. I still need to gain familiarity with layer 1 containing all the special letters, which I hope to do over time.</p><p>Overall, I feel this keyboard is a bit less ergonomic than Kinesis Advantage. My hands extend out a bit more than the Advantage, and they don’t sit as nicely. But the mobility and layers are definitely winning me over. I have been using Advantage since mid-2009, and I doubt that’d go anywhere, but this keyboard would be my new go to for travel (and currently doubling as my desktop keyboard).</p><p><em>This is it for now. As I gain more experience with the keyboard, I’ll add more things.</em></p><p><strong>Update (13 Mar 2018)</strong>: It’s been a few months since I got Ergodox, so I’ve had a good chance to get used to it. But, I still reach out to my Kinesis Advantage 2.0 if I’m at my desk or at my office. And Ergodox is the keyboard I bring along if I’m working from a cafe or traveling. Kinesis has a better, more ergonomic feel; while Ergodox is smaller and easy to carry along.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6641c18e747" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Releasing Dgraph 1.0: Production-Ready Graph Database]]></title>
            <link>https://medium.com/@manishrjain/releasing-dgraph-1-0-production-ready-graph-database-16cabe253117?source=rss-c9b525a6d2bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/16cabe253117</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[press-release]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[production]]></category>
            <category><![CDATA[graph]]></category>
            <dc:creator><![CDATA[Manish Rai Jain]]></dc:creator>
            <pubDate>Sat, 23 Dec 2017 02:41:13 GMT</pubDate>
            <atom:updated>2017-12-23T02:41:13.147Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://github.com/dgraph-io/dgraph">Dgraph</a> started around end-August, picked up steam in mid-October, and v0.1 was released in early-December, 2015. From one, the contributors grew to 46, with the project amassing over 4000 Github stars over the past two years. 2190 commits (<em>we squash our branches</em>), 277 branches and 25 releases later, <strong>we’re proud to announce that </strong><a href="https://github.com/dgraph-io/dgraph/releases"><strong>Dgraph has reached v1.0</strong></a><strong>, our first production-ready release.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LBr9eDN3Ii4OP9EH1yNHvQ.jpeg" /><figcaption><a href="https://www.nasa.gov/image-feature/expedition-53-launches-to-the-international-space-station"><em>Expedition 53 Launches to the International Space Station</em></a></figcaption></figure><p>To give a bit of a background — Dgraph, as a graph database, is designed to excel at the weaknesses of traditional relational databases: traversing relationships and efficiently executing complex joins at scale. Relational databases are not going anywhere, and they would continue to play a huge role in tech. But, at the same time, there’s a big need for handling highly interconnected, sparse data with flexible schema, to truly understand user queries. Google is <a href="http://indianexpress.com/article/technology/google-search-algorithm-fake-news-machine-learning-ben-gomes-4975997/">going this way</a>, and so is the rest of the world. This is what inspired us to build <a href="https://github.com/dgraph-io/dgraph">Dgraph</a> back in 2015, and this basic premise continues to shape the project.</p><p>Our investors immediately saw the value of what we were building and where the database market is headed. While it is hard as an outsider to raise funds from the valley, we got backing from some of the smartest investors. <strong>We’re thrilled to announce that we have raised $3M in seed funding,</strong> led by Salil Deshpande of Bain Capital Ventures, joined by Mike Cannon-Brookes of Atlassian, Blackbird Ventures, and AirTree Ventures.</p><p>With experience in early-stage infrastructure software and open source, Salil will make an invaluable asset to Dgraph Labs by joining the board. He’s been on Midas list of top 100 VCs, with prominent investments in Mulesoft, Lending Club and, Redis Labs. This funding round comes at the right time for us to expand our offerings to the cloud, and continue to build the most advanced graph database in the world.</p><p>For this next phase of <a href="https://github.com/dgraph-io/dgraph">Dgraph</a>, we’re moving our engineering team to the SF bay area, which is where the inspiration of Dgraph came from, and where we’ll have access to an unparalleled level of knowledge, talent, and market. At the same time, we’re opening an office in Bangalore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/0*uHHgV-7MAiDB_9y7.jpg" /><figcaption>Dgraph’s Australia team went for a splash during summer in Sydney.</figcaption></figure><h3>Dgraph version 1.0</h3><p>At Dgraph, our mission is to build <strong>world’s best graph database.</strong> We’re the only graph database which inspires to become the primary database in the tech stack. This idea has been the driving factor behind the design choices of <a href="https://github.com/dgraph-io/dgraph">Dgraph</a>, which we’ll explore now.</p><h3>Distributed Graph</h3><p>Dgraph is built to scale horizontally. Modern data sets have long grown beyond the capabilities of a single server. However, most SQL and graph databases are limited by design to store the universal data set into a single machine. This has many disadvantages, including introducing a <a href="https://en.wikipedia.org/wiki/Single_point_of_failure">single point of failure</a> and being <a href="https://www.345.systems/architecture/vertical-scalability-even-thing/">disproportionately more expensive</a> to run.</p><p>Building a distributed graph database is a hard challenge. Graph DBs must provide a superset of relational database operations, including storing the data in a way which can execute constant time edge traversals and arbitrarily deep joins, without a view of the universal data set. Most graph databases are, therefore, either a single server architecture or a graph layer built on top of other databases, where they can get this vantage point of universal view. This leads to either lack of scalability, or lack of performance, <em>choose at least one</em>.</p><p><a href="https://github.com/dgraph-io/dgraph">Dgraph</a>, on the other hand, was designed keeping the problems of a fast-growing company in mind. It not only shards the data in a way where it can execute queries (<em>joins, traversals, filters, sorts, paginations</em>) without this universal view, it also minimizes the number of network calls and disk seeks required to execute these queries. Both of these factors become prominent in datasets spanning hundreds of servers. Not only that, as you add more servers, data automatically gets sharded and moved to fill the new ones. Dgraph automatically rebalances shards among servers to ensure that load is evenly distributed.</p><p>While being distributed, Dgraph provides lock-free ACID transactions with snapshot isolation, designed for low latency. Transactions make it a lot easier for application developers to think through database behavior, removing any data integrity issues.</p><h3>Consistent Replication and High-Availability</h3><p><a href="https://github.com/dgraph-io/dgraph">Dgraph</a> does away with the whole master-slave replication architecture. Early on, we decided against providing an eventual consistency model. In that model, a replica which is running behind the <em>master</em> would not show latest writes, and the developer needs to handle this in the application logic. We want Dgraph system to be reliable and consistent, where <strong>scalability is an operational feature, not a hurdle application developers need to code around.</strong></p><p>Instead, <a href="https://github.com/dgraph-io/dgraph">Dgraph</a> provides consistent (synchronous) replication, utilizing Raft, a consensus algorithm, allowing k servers dying in a 2k+1 replication setting, without affecting any reads or writes. Each data shard can be replicated an odd number of times, and replicas located in different datacenters, or availability zones to allow faster communication from your clients. Dgraph guarantees atomic consistency of writes, which means irrespective of which replica is hit for reading, any write done before is guaranteed to be available. This guarantee makes it a lot easier to build applications, which can then serve queries from the closest datacenter to the end-user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*WHOxySmX1OuCih2n.jpg" /><figcaption>Aircraft transitioning from subsonic to supersonic speed</figcaption></figure><p>Despite the focus on distribution, <a href="https://github.com/dgraph-io/dgraph">Dgraph</a> performs exceptionally well as a single server. In fact, many Dgraph users run it on a single server and benefit from the amazing performance it brings. You can read more about the capabilities of Dgraph, in <a href="https://blog.dgraph.io/post/neptune/">this recent post</a>.</p><h3>What Next</h3><p>The next chapter of <a href="https://github.com/dgraph-io/dgraph">Dgraph</a> is very exciting. We’re planning to provide a managed hosted service, to make it easier for adopters to use Dgraph without any of the operational overhead. We’ll also be significantly improving our user interface, to allow cluster management and advanced data exploration.</p><p>They say the true test of any distributed system is <a href="https://jepsen.io/">Jepsen</a>, and in the coming year, we’re going to be working with <a href="https://twitter.com/aphyr">Kyle Kingsbury</a> to help set up the tests for Dgraph. Simultaneously, we’ll push our design to span globally, with automatic replication across geographically distributed regions, to become the <strong>Spanner of Graph Databases</strong>.</p><p>We’ll be expanding our list of languages to include <a href="https://www.opencypher.org/">Open Cypher</a> and <a href="https://tinkerpop.apache.org/gremlin.html">Gremlin</a>. Both of these are very popular graph languages, and would make it easier for existing graph users to switch to Dgraph. We also plan to support the standard version of <a href="http://facebook.github.io/graphql/October2016/">GraphQL</a>.</p><h3>Onwards and Upwards</h3><p>We’re really excited about <a href="https://github.com/dgraph-io/dgraph/releases">v1.0 release</a> of Dgraph. Pushing it this far has been a particularly challenging road, full of experimentation. <a href="https://github.com/dgraph-io/dgraph">Dgraph</a> is the only graph database which is building for native geographical distribution of data, while providing efficient arbitrarily deep joins and traversals. <em>Those are hard problems that we have solved.</em></p><p>Lacking a guiding Google paper on distributed graph databases, we built a system which puts together the best of Bigtable (<a href="https://en.wikipedia.org/wiki/NoSQL">NoSQL</a>) and Spanner (<a href="https://en.wikipedia.org/wiki/NewSQL">NewSQL</a>). Within Dgraph, we term this <strong>NewGraph — a graph database which is horizontally scalable, multi-versional, transactional, synchronously replicated and inherently capable as a primary database.</strong> In fact, we think a paper describing the unique design of <a href="https://github.com/dgraph-io/dgraph">Dgraph</a> is quite important, so we’re working towards writing one. Being engineers, we can’t think of a better way to celebrate the last over two years of hard work.</p><p>With Dgraph, we hope to break the cycle of many fast-growing companies from <em>looking for a graph database, trying something, giving up and building their own graph system;</em> to <em>looking for a graph database, finding Dgraph and building applications on top.</em></p><p>While traditional databases only serve data, graph databases allow machine interpretation of data, which is crucial to build smart systems. We look forward to putting <a href="https://github.com/dgraph-io/dgraph">Dgraph</a> into the hands of users who need the stability of v1.0, and hear about all smart use cases they are building. And we’re confident that Dgraph would make their use cases successful. We have taken giant strides in graph database world, and we promise to continue taking those, so our users can push the envelope for what’s possible and maintain the competitive edge.</p><p><strong>Also read coverage on </strong><a href="https://techcrunch.com/2017/12/19/dgraph-raises-3m-for-its-open-source-distributed-graph-database-hits-1-0-release/"><strong>TechCrunch</strong></a><strong>.</strong></p><p><em>Originally published at </em><a href="https://blog.dgraph.io/post/releasing-v1.0/"><em>blog.dgraph.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16cabe253117" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open Source Alternative to Amazon Neptune]]></title>
            <link>https://medium.com/@manishrjain/open-source-alternative-to-amazon-neptune-e13b21afec79?source=rss-c9b525a6d2bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/e13b21afec79</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[graph]]></category>
            <dc:creator><![CDATA[Manish Rai Jain]]></dc:creator>
            <pubDate>Thu, 30 Nov 2017 17:43:01 GMT</pubDate>
            <atom:updated>2017-12-02T10:09:26.322Z</atom:updated>
            <content:encoded><![CDATA[<p>Amazon just announced their new graph database service, called <a href="https://aws.amazon.com/neptune/">Amazon Neptune</a>. As per a <a href="https://techcrunch.com/2017/11/29/amazon-introduces-an-aws-graph-database-service-called-amazon-neptune/">TechCrunch article</a>,</p><blockquote>Amazon Neptune has been optimized to handle billions of relationships and run queries within milliseconds. Neptune supports fast-failover, point-in-time recovery and Multi-AZ deployments. And you can also encrypt data at rest.</blockquote><p>This is very exciting news for the entire tech ecosystem. It clearly shows that graph databases are going mainstream. Already many tech companies are using <a href="https://neo4j.com/users/airbnb/">existing</a> <a href="https://github.com/JanusGraph/janusgraph#users">graph</a> <a href="https://github.com/orientechnologies/orientdb/issues/4806">solutions</a> or <a href="https://www.facebook.com/notes/facebook-engineering/tao-the-power-of-the-graph/10151525983993920/">building</a> <a href="https://github.com/twitter-archive/flockdb">their</a> <a href="https://searchengineland.com/library/google/google-knowledge-graph">own</a> graph-like systems.</p><p>Many devs would be happy users of Neptune, given Amazon is running this as a managed service. People trust Amazon; they have done a great job with <a href="https://aws.amazon.com/">AWS</a> so far. So, this is good news for adoption.</p><p>But, in this article, I want to look past the blinding light of Amazon — into the design of this new graph database. <strong>Despite being built by Amazon, Neptune’s design is obsolete right out of the gate.</strong> Let’s look through the design features of Neptune.</p><p><strong>Licensing</strong>: Nothing is mentioned about the availability of an open source version. It’s safe to presume that Neptune is closed source.</p><p><strong>Scalability</strong>: Neptune is vertically scalable instead of being horizontally scalable. That means if your data size increases, it must still fit on a single server, as there’s no data sharding possibility.</p><p><strong>ACID Transactions</strong>: There’s no mention of transactions on their features page, which indicates that Neptune potentially does not support ACID transactions.</p><p><strong>Replication</strong>: The replicas are global copies of the original data, with all writes going to one server, and the rest being read-only servers. Neptune provides eventual consistency for replication, (looks to be) built on top of <a href="https://aws.amazon.com/rds/aurora/details/">Amazon Aurora</a>, where the write server writes to this storage, and rest of the servers reading from this storage. They provide fast reads by bringing the data to RAM (“in-memory optimized architecture”).</p><p><strong>APIs</strong>: Neptune supports Gremlin and SPARQL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D5bSH2XbCkrIS-ovi4NRVg.jpeg" /><figcaption>Neptune — Earth size comparison. Source: <a href="https://www.universetoday.com/21581/neptune/">https://www.universetoday.com/21581/neptune/</a></figcaption></figure><p><strong>There are benefits and drawbacks to this architecture.</strong></p><p>Benefits wise, having read replicas is great for increasing the query throughput. Aurora as storage would ensure that once written; your data would have the same guarantees (protection from disk losses, etc.). Amazon has a long record in providing hosted services, so a managed service by them is great for adoption.</p><p>It comes with a fair bit of drawbacks as well. Vertical scaling introduces a <a href="https://en.wikipedia.org/wiki/Single_point_of_failure">single point of failure</a> in the system — a single server crashing could bring the entire system down. While Amazon has strict SLAs on their managed service, this is still a questionable system design from the tech giant.</p><p>Vertical scalability is also disproportionately more expensive than horizontal scalability. Having to fit the entire data into a single machine requires specialized hardware, something which gets disproportionately more expensive than just buying another server. In fact, that ship sailed a long time ago when the internet exploded in the early 2000s. Bigtable, MongoDB, Cassandra, Elastic Search, Spanner, CockroachDB, etc. — all the new technologies since the 2000s have been designed to be horizontally scalable. So, Neptune is at least 10–20 years behind regarding the needs of the market. In fact, <a href="https://www.345.systems/architecture/vertical-scalability-even-thing/">is vertical scalability even a thing anymore?</a></p><p>Lack of ACID transactions is the biggest complaint from NoSQL databases. Distributed transactions are a hard but solvable problem. But, Neptune is a single server architecture, so it’s almost unbelievable that they don’t mention a single word about their support of ACID transactions. I’m going to be optimistic and presume that they do support them but just failed to mention it in the feature list. It’s commonly believed that support of transactions is what distinguishes a database from a datastore.</p><h3>Why are these drawbacks important?</h3><p>Let’s take a step back and look at database evolution. For a long time, we only had relational databases which ran on a single server. You could potentially have an eventually consistent replica, but all the data still had to fit into one machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*RvK4ou67nbyIJMQEmiLMYg.png" /><figcaption>Exploding Kittens. Source: <a href="http://bit.ly/2iujVKD">http://bit.ly/2iujVKD</a></figcaption></figure><p>Web exploded, and Google being the search engine for the web, had to keep up. They launched <a href="https://research.google.com/archive/mapreduce.html">MapReduce</a> in 2004, which among other things, helped run the indexing system at Google to process all the data. Google realized that single server databases were not able to handle the data growth and launched <a href="https://research.google.com/archive/bigtable.html">Bigtable</a> in 2006. Bigtable was designed solely with the idea to build a horizontally scalable database, something which relational DBs didn’t provide. This was a remarkable feat at the time, but achieved at a cost to the developer, with lack of joins and transactions.</p><p>Bigtable kickstarted the entire NoSQL revolution, out of which MongoDB, RethinkDB, and Cassandra came. But, lack of transactions <a href="https://jira.mongodb.org/browse/SERVER-2804">continued</a> to <a href="https://jira.mongodb.org/browse/SERVER-11500">remain</a> an <a href="https://jira.mongodb.org/browse/SERVER-11508">issue</a> for developers. Within Google, <a href="https://research.google.com/pubs/pub36971.html">Megastore</a> and <a href="https://research.google.com/pubs/pub36726.html">Percolator</a> were born to deal with these shortcomings, but at the cost of performance.</p><p>Calling lack of transactions in Bigtable, the “<a href="http://highscalability.com/blog/2016/3/16/jeff-dean-on-large-scale-deep-learning-at-google.html">biggest mistake as an engineer</a>,” Google worked to build <a href="https://research.google.com/archive/spanner.html">Spanner</a>, a horizontally scalable, multi-version, globally-distributed, and synchronously-replicated database, with distributed transactions. Again, this kickstarted a whole new revolution, people are calling NewSQL, with <a href="https://github.com/cockroachdb/cockroach">CockroachDB</a> and <a href="https://github.com/pingcap/tidb">TiDB</a> following Spanner’s heels.</p><p>All these show where the database market is going. <strong><em>A database of the 2000s is horizontally scalable, supports distributed transactions and is consistently replicated</em></strong><em>.</em> Without these guarantees, building application on top becomes complicated, something Google’s Bigtable team and NoSQL users learned the hard way.</p><h3>Given these advancements, Amazon Neptune’s design is pre-2000. Single server vertically scaled, asynchronously replicated, lack of transactions — all this screams outdated.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*M1DZazDaShTh_dDQVWXD2Q.png" /></figure><h3>Open Source Alternative</h3><p>Now, let’s consider <a href="https://github.com/dgraph-io/dgraph">an open source alternative: Dgraph</a>, a distributed graph database.</p><p><strong>Licensing</strong>: Dgraph is available under AGPLv3 with clients under Apache 2.0, an open source license (similar to MongoDB) allowing any one to modify it, use it and run it for free.</p><p><strong>Scalability</strong>: <em>This is 2017!</em> <a href="https://github.com/dgraph-io/dgraph">Dgraph</a> is horizontally scalable. As you add more servers, data automatically gets sharded and moved to fill the new ones. Also, Dgraph would automatically rebalance shards among servers to ensure that load is evenly distributed.</p><p><strong>ACID Transactions</strong>: While Neptune doesn’t mention anything about transactions, Dgraph runs lock-free distributed ACID transactions, with snapshot isolation, designed for performance. Transactions make it a lot easier for application developers to think through database behavior, removing any data integrity issues.</p><p><strong>Replication</strong>: <a href="https://github.com/dgraph-io/dgraph">Dgraph</a> provides consistent (synchronous) replication, utilizing Raft, a consensus algorithm, to allow k servers dying in a 2k+1 replication setting. Each data shard can be replicated an odd number of times, and located in different datacenters, or availability zones to allow faster communication from your clients.</p><p><strong>Linearizable reads</strong>: Neptune’s eventual consistency model, can cause issues where a read after write might not be visible through a replica; requiring the application to build logic around this limitation.</p><p><a href="https://github.com/dgraph-io/dgraph">Dgraph</a> avoids this problem by guaranteeing atomic consistency of writes, which means irrespective of which replica is hit for reading, any write done before is guaranteed to be available. This guarantee makes it a lot easier to build applications.</p><p><strong>APIs</strong>: Dgraph supports a variant of GraphQL, a modern language to replace REST. Cypher and Gremlin support are in the pipeline.</p><p><strong>Others</strong>: While Neptune is built on top of another DB (Amazon Aurora), Dgraph is a native graph database. As such, data storage is designed for constant time edge traversals. Also, <a href="https://github.com/dgraph-io/dgraph">Dgraph</a> has a unique design, which uses posting lists, a concept from search engines, to make joins highly efficient. It’s designed for a real-world cluster, minimizing network calls and disk seeks, running automatic fail overs in case of communication delays, running all operations concurrently. All these innovations show in the low query latency provided by Dgraph.</p><h3>Conclusion</h3><p>Amazon’s Neptune is an exciting new graph database, a clear signal that graph databases are being used by companies small and large. I hope that Amazon provides more content to help developers create and switch their applications to utilize the power of graph DBs.</p><p>While Neptune comes with the convenience of a managed service, it’s design is outdated and the technology proprietary. Therefore, potential users of graph databases, who want to build smart, scalable applications and need ACID transactions, horizontally scalable design and strong replication consistency should look into the various open source graph databases available, like <a href="https://github.com/dgraph-io/dgraph">Dgraph</a>.</p><p><em>Disclaimer: I’m the founder of </em><a href="https://dgraph.io/"><em>Dgraph Labs</em></a><em>. We’re building Dgraph, a distributed graph database. Our mission is to build world’s best graph database, period. I have strong opinions about technology.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e13b21afec79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux vs Mac on a laptop]]></title>
            <link>https://medium.com/@manishrjain/linux-vs-mac-on-a-laptop-9edd1647d981?source=rss-c9b525a6d2bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/9edd1647d981</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[laptop]]></category>
            <category><![CDATA[mac]]></category>
            <dc:creator><![CDATA[Manish Rai Jain]]></dc:creator>
            <pubDate>Sun, 12 Nov 2017 09:03:14 GMT</pubDate>
            <atom:updated>2017-11-13T01:20:01.383Z</atom:updated>
            <content:encoded><![CDATA[<p>I was in this predicament not too long ago. And I see more and more people struggling with this decision, every time Apple does something.</p><p>People think Linux on a laptop doesn’t work. <em>I find that funny.</em> I have been using it since early 2016, without any issues. Here’s <a href="https://www.youtube.com/playlist?list=PLzOEKEHv-5e0P70K-91pTLm99jUWy5Cl6">me giving talks</a> at conferences, and you’ll notice my laptop isn’t a Mac.</p><h3>The Hardware</h3><p>So, here’s my setup. I got rid of my Macbook Pro (2013 model), and bought a Thinkpad T460. They have many other thinkpads, so you can choose a model and then customize the hardware all you want. I thought about going for Dell’s Linux laptop, but had bad experiences with hardware quality of Dell.</p><p>One could potentially run Linux on Mac itself. But, here’s the deal. Being an engineer, I type a lot. Back in 2009, I started having a bit of pain in my wrists, aka RSI. So, I switched over to using <a href="https://www.kinesis-ergo.com/shop/advantage2/">Kinesis Advantage</a>. That keyboard is truly ergonomic and has saved my RSI from developing further.</p><p>On Mac’s keyboard, after 10–15 mins of typing, my wrists would start paining. And I couldn’t type anymore. The keyboard design causes fingers to “bottom-out” easily. Due to this, I stopped using my Mac laptop for any real work.</p><p>Thinkpad’s keyboard is mechanical [See 1 below]. Since I got it, I have been able to type emails, code, and just use it as an essential tool laptops typically are. That itself was a great benefit to me.</p><p>On top of that, I configured my Thinkpad to come with a dual battery pack. Which makes it last an entire day of non-stop work, including hangouts sessions, without having to charge. This has been very useful as you can imagine. Long flights, conferences, or just carrying laptop to office, I don’t need to have the charger with me.</p><p>Downside: I don’t use my trackpad anymore. My first laptop back in 2003 was a Thinkpad, and I’ve been a fan of the Trackpoint. I use it, and in general just avoid using mouse. My window manager enables less mouse usage (described below), so I can get away with not using the trackpad.</p><h3>The Software</h3><p>Mac’s entire ecosystem is designed to take money from the consumer and lock them in. You can easily find the equivalent Linux programs for almost everything, free and more user friendly. For e.g., I paid for 1Password on Mac. Instead I use <a href="https://www.passwordstore.org/">pass</a> on Linux. I paid for Omnifocus on Mac. Instead I use <a href="https://neovim.io/">Neovim</a> with <a href="https://github.com/xolox/vim-notes">Notes</a>. All the video chatting happens via Hangouts, or Google Meet, or other browser supported softwares. Slack has a Linux app.</p><p>I use <a href="https://www.archlinux.org/">Arch Linux</a>, a flavor of Linux with rolling releases. So, I get the latest software update automatically, without having to wait for the release cycle of Ubuntu. Arch has a small, but ardent community.</p><p>Now here’s the killer app that I vouch most of you don’t know about. It’s called <a href="https://i3wm.org/">i3 window manager</a>. I came to know about it during <a href="https://www.youtube.com/watch?v=875NbdL39A0">this machine build</a> for Eric S. Raymond. It’s so good, that it should be installed by default for any software developer out there. Everything else feels like a struggle in comparison. Window’s UI, Mac’s UI, Ubuntu’s UI, bring anything. I’m just to outright say that nothing is as productive as i3-wm. I’m not going to go into reasons here. But, you’ll find every program that you need in the right place, you’ll use your entire screen estate to its full capacity, and you’ll never have to drag and drop, minimize, maximize anything. And that multiple desktop thing that every OS has, but you don’t use because it’s cumbersome; that’d no longer be the case with i3-wm.</p><p><em>I know the above might sound too much</em>. I’m practically saying all other window managers suck in comparison (your mileage may vary). So, you could say I’m a fan. In fact, my entire team is. All my team and I run Linux on Thinkpad, with i3-wm.</p><p>Overall, I shell out way lesser money since I switched over to Linux on my laptop, and my experience has actually improved.</p><p>Downsides: Some people find Linux lacks good photo and video editing tools in comparison with Mac. I don’t do that, so that’s never been a problem for me.</p><h3>Conclusion</h3><p>I can’t think of anything more to add about my experience using Linux on a Thinkpad. But, I’ll say this, I’ll never go back to a Mac. It’s not because I have something inherent against Apple. But, in Linux and Thinkpad, I’ve found a solid tool and medium.</p><h3>Update</h3><p>[1] As per <a href="https://medium.com/u/d2c6b8c1edd8">Michał Krzysztof Feiler</a>, ThinkPad’s keyboard is <strong>not</strong> mechanical. It is a scissor switch keyboard, a pretty good one though, with a much longer drop and much more cushioned stroke then what is found in modern Apple keyboards, so there is a neat feedback and no bottoming out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9edd1647d981" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hello, World!]]></title>
            <link>https://medium.com/dgraph-official-blog/hello-world-b32264d72ba5?source=rss-c9b525a6d2bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b32264d72ba5</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Manish Rai Jain]]></dc:creator>
            <pubDate>Mon, 25 Apr 2016 16:01:01 GMT</pubDate>
            <atom:updated>2016-04-25T16:01:01.912Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ai1lYhPLXSZAAP486tYc9A.jpeg" /><figcaption><strong><em>Hello, World!</em></strong><em> Image: </em><a href="http://go.nasa.gov/1VlGVXx"><em>Mars Rover Curiosity in Buckskin Selfie</em></a></figcaption></figure><p><strong>I’m very excited</strong> to use this first post to talk about DGraph, what it is and why it was created.</p><p>Before I explain what’s DGraph, let’s start with a basic understanding of graphs. A graph is a mathematical structure used to model pairwise relationship between entities. A graph is thus composed of nodes connected by edges. Each node represents an entity (a person, place, thing, etc.), and each edge represents the relationship between two nodes. Some popular graphs that we all know about are the <a href="https://en.wikipedia.org/wiki/Social_graph">Facebook Social Graph</a>, and the <a href="https://en.wikipedia.org/wiki/Knowledge_Graph">Google Knowledge Graph</a>.</p><p>A graph database is a database that uses graph structures with nodes and edges to represent, store and serve data.</p><p>But who really uses graph databases? More teams and companies than you’d think. Google, Facebook, Twitter, eBay, LinkedIn, Amazon, Dropbox, Pinterest — pick a company you are familiar with. If they’re doing something smart, chances are they’re probably using a graph database. Even very simple web apps have much to gain from graph databases. In the past, I’ve built a graph based REST framework, and using that <a href="https://mrjn.xyz/post/Porting-To-Gocrud/">cut down the code in half</a>.</p><p>So now that we understand graphs, let’s talk about DGraph.</p><p><strong>DGraph is an open source, low latency, high throughput, native and distributed graph database.</strong></p><p>To understand why it was created, let’s rewind a few years back to 2011.</p><p><strong>I’d been at Google</strong> about 4+ years with the Web Search Infrastructure Group. Google had just then acquired Metaweb a year earlier in 2010. I’d been wrapping my head around the newly acquired Knowledge Graph, trying to find ways to integrate Knowledge Graph with Google Search. This is when I found a problem.</p><p>At Google, we had multiple knowledge bearing feeds called One Boxes. You know, the boxed snippets that sometimes show up at the top of the search results, for instance when you search for <a href="https://www.google.com/#q=tesla+stock">Tesla stock</a>, <a href="https://www.google.com/#q=weather+in+sydney">Weather in Sydney</a>, or <a href="https://www.google.com/#q=events+in+san+francisco">Events in San Francisco</a>.</p><p>There were multiple custom built backends, each serving a One Box. A search query hitting <a href="https://www.google.com/"><em>www.google.com</em></a> would be sent iteratively through each of these One Box backends to check if any of them has a response. When one of the backends responds, the One Box data is retrieved and rendered on the top of the search results page. This is how that well formatted box with just the right information shows up below the search bar, thus saving you a few clicks.</p><p>As good as it sounded, One Boxes had several inefficiencies and missed opportunities.</p><p>For starters, each One Box was custom built by a separate team that was responsible for running and maintaining it. As a result there was no particular sharing of the framework used to build the One Box.</p><p>This also meant that there was no single standard for the data format used by the One Boxes. Each One Box kept its data in its very own data structure, and no common querying language. Thus there didn’t exist an opportunity to share data amongst the boxes, to respond to more interesting queries that required an intersection of diverse data feeds.</p><p>A good example of this would be the ability to <em>recommend events based on the weather</em> to a tourist exploring NYC — that couldn’t easily be done with the existing system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*yyhReFDTrf3H8xtE.jpg" /><figcaption><strong><em>NYC in Rain.</em></strong><em> Courtesy: </em><a href="https://flic.kr/p/azztBd"><em>Several Seconds</em></a></figcaption></figure><p>This motivated me to start a project to standardize the data structures, and eventually serve them all using a single backend. Using the vast expertise of Metaweb team, we chose a data normalization structure that was also used by Knowledge Graph, the RDF Triples. By reconciling all the various entities from the different data feeds, we could start to reuse the data.</p><p><strong>But, there was a second and more challenging part to the problem.</strong></p><p>It was to build a system that could serve structured queries with data updating in real time. The system had to run behind Web Search, which meant that if it doesn’t respond within allocated milliseconds, Search would time out and move on. Also, this system had to tackle a major chunk of query load to Web Search, which amounts to thousands of queries per second.</p><p><em>We basically had to build a low latency, high throughput system to serve graph queries.</em></p><p>It was certainly an exciting project and held much promise. But, the harsh realities of the business environment and the attendant politics resulted in the cancellation of the project. Shortly thereafter I left Google in 2013 and didn’t give much thought to the project.</p><p><strong>Fast forward two years,</strong> I was hanging out on the Go language’s Slack channel and Stack Overflow. I saw quite a few people complaining about a popular graph database’s performance and stability.</p><p>That’s when I realized that graph databases were starting to be used more frequently than it would appear from the surface. But a bit more digging around revealed a deeper problem.</p><p><em>Existing native graph databases weren’t designed to be performant or distributed.</em></p><p>The ones that sharded the data and distributed it across a cluster weren’t actually native graph databases. They were largely serving as a graph layer over another database. This meant having many network calls should the intermediate number of results be large, which leads to performance degradation.</p><p>For example, say you wanted to find <strong>[People living in SF who eat Sushi]</strong>. Assuming you have this data (<em>hey Facebook!</em>) and keeping things simple, this requires 2 steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*oqApzACXydSFJC2r.jpg" /><figcaption><strong><em>Sushi in SF.</em></strong><em> Courtesy: </em><a href="https://flic.kr/p/nLkbkQ"><em>Yannig Van de Wouwer</em></a></figcaption></figure><p>First you find all the people living in SF, and then secondly, intersect that list with all the people who eat Sushi.</p><p>As you can imagine, the intermediate step here has a <em>large fan-out</em>, i.e. there’re over a million results. If you were to shard the data by <em>entities</em> (people), you’d end up broadcasting to all the servers in the cluster. Thus this query would be affected by even a single slow machine in the cluster.</p><p>Do that for every query, and it would spike the 95%-ile latency numbers up dramatically, <em>higher latency being worse</em>.</p><p><strong>DGraph, on the other hand, is a native graph database</strong> in the sense that the data is handled directly by DGraph, and not given off to another database layer.</p><p>This allows us to shard and relocate the data better, to minimize the number of network calls required per query. In fact, the above query would run in 2 network calls, irrespective of the cluster size.</p><p>The number of network calls being <em>directly proportional to the complexity of the query</em>, not the number of intermediate or final results.</p><p>DGraph is designed to easily scale from meeting the needs of a small startup to that of Dropbox, or even Facebook. This means being able to run on a laptop as well as on a big cluster of hundreds of machines serving thousands of queries per second.</p><p>Additionally it would also have to survive machine failures and partial datacenter collapses. The data stored would have to be automatically replicated with no single point of failure, and be able to move around the cluster to better distribute traffic.</p><p><strong>This is the big vision which led to DGraph.</strong> And I’m <a href="http://dgraph.io/">fortunate to have a team</a> that believes in and shares this vision with me.</p><p>Apart from use with diverse social and knowledge graphs, DGraph can also be used to:</p><ul><li>build real-time recommendation engines,</li><li>doing semantic search,</li><li>pattern matching,</li><li>serving relationship data, and</li><li>serving web apps via <a href="https://facebook.github.io/graphql/">GraphQL</a>, a full feature graph query language by Facebook.</li></ul><p>We’ll be reporting some performance numbers for DGraph in our next few posts, to give you an idea for what you can expect from the system.</p><p>If you or your company plan to use a graph database, we’d love to hear from you at <a href="https://discuss.dgraph.io/">discuss.dgraph.io</a> and <a href="https://gitter.im/dgraph-io/dgraph">Gitter</a>. We have big dreams for DGraph, and if deep and complex open source distributed systems interest you, note that <a href="http://dgraph.io/">we’re hiring</a>! So, check out our <a href="https://github.com/dgraph-io/dgraph">Github repository</a>, then find us hanging out at <a href="https://discuss.dgraph.io/">discuss.dgraph.io</a> and come talk to us.</p><p><em>- Written by </em><a href="https://twitter.com/manishrjain"><em>Manish R Jain</em></a>. Thanks to <a href="https://twitter.com/koppula">Prashanth Koppula</a> and the team for proof reading.</p><p><em>Originally published at </em><a href="http://blog.dgraph.io/post/hello-world/"><em>blog.dgraph.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b32264d72ba5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dgraph-official-blog/hello-world-b32264d72ba5">Hello, World!</a> was originally published in <a href="https://medium.com/dgraph-official-blog">Dgraph Deprecated Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Golang + vim dev setup in Docker]]></title>
            <link>https://medium.com/@manishrjain/golang-vim-dev-setup-in-docker-5de7302684dc?source=rss-c9b525a6d2bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/5de7302684dc</guid>
            <category><![CDATA[vim]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Manish Rai Jain]]></dc:creator>
            <pubDate>Fri, 03 Apr 2015 11:10:53 GMT</pubDate>
            <atom:updated>2015-04-03T11:15:17.443Z</atom:updated>
            <content:encoded><![CDATA[<p>Every time I’d switch my development box, I used to spend hours (even days if things didn’t go well) getting my development environment to the same state. All the right packages, right settings, right bashrc, vimrc whatnot. Last December (2014) I switched to Docker for development, and since then, it’s been an easy sail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*drdt9hvH7oV1yot5FNznJg.jpeg" /><figcaption>Since I switched to Docker for my dev environment, it’s been an easy sail.</figcaption></figure><p>Have been thinking about sharing my setup with general public, but my personal setup contained, well… some sensitive data. So, it took time to fork it all out for public consumption. And ta-da, here it is.</p><ul><li><a href="https://registry.hub.docker.com/u/mrjn/godev/">mrjn/godev Repository | Docker Hub Registry - Repositories of Docker Images</a></li><li><a href="https://bitbucket.org/manishrjain/godev">manishrjain / godev</a></li></ul><p>This contains my development language of choice: Golang with my editor of choice: vim, setup for working neatly with golang. And some python, some nodejs, and some other things I need on a daily basis. Modify it to your liking, otherwise just enjoy the default setup, which works like a charm!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5de7302684dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Technical Interviews: Open ended design questions]]></title>
            <link>https://medium.com/@manishrjain/technical-interviews-open-ended-design-questions-ea7fff3486a7?source=rss-c9b525a6d2bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea7fff3486a7</guid>
            <dc:creator><![CDATA[Manish Rai Jain]]></dc:creator>
            <pubDate>Fri, 14 Feb 2014 23:50:43 GMT</pubDate>
            <atom:updated>2014-02-14T23:50:43.314Z</atom:updated>
            <content:encoded><![CDATA[<h4>And how many interviewers get it wrong.</h4><p><strong>A bit about me</strong>: I joined Google right out of school in Singapore, and my first full time project belonged to Web Search Infrastructure group. That was 2007. By last year, 2013, I’d gone through 5 different projects all belonging to Web Search/ Knowledge infrastructure within Google. I’m a big fan of massively parallel, distributed, low latency systems. They impose very interesting challenges related to threading, network communication, asynchronous / synchronous callbacks, and of course logic. I strongly believe that if a system is to be performant, you can’t add it on top as a functionality. You have to design the system from scratch for performance, weighing out every extra bit of complexity against functionality gains.</p><h4>The interviewer: While at Google, I interviewed around 50 candidates, and my favorite question was to dig into open ended design.</h4><p>Over time, I established a really nice rule to figure out if the candidate did well. The rule is simple:</p><blockquote>A: Did I have a great debate about the pros and cons of the approach taken by the candidate? Did we agree a lot? Did we disagree a lot? Did I learn something new? Overall, did I have a great conversation, the likes of which I’d want to have with him / her as my colleague?</blockquote><p>or,</p><blockquote>B: Did I have to spoon feed thoughts to the candidate? Was he really slow? Was it an effort to keep the conversation alive?</blockquote><p>Case A was amazing. I loved those interviews. I felt energized when a candidate challenged me in my thinking, could think of alternative solutions, and why they would or wouldn’t work. The best of my candidates were the ones who designed something, admitted in the middle that what they designed was flawed, and they’d do it from scratch with a new methodology. I was particularly impressed by them, because their love for perfection was above their ego.</p><p>Case B were no hires. It was an effort even to write feedback for such candidates.</p><p>And then there was a whole spectrum in between.</p><blockquote>I think a great engineer resembles a painter. He’d design something, learn what works, what doesn’t. Throw it away, and design better. Most importantly, he’d be hard to please with his own design.</blockquote><h4>The interviewee: It had been 6 years at Google, so I decided to work for a smaller company. I left Google, and started interviewing. And I was surprised!</h4><p>Interviewers were asking me design questions, and I was trying to have a great conversation, a debate, thinking / rethinking pros and cons of various alternatives. But, a lot of them weren’t looking for that.</p><p><strong><em>What were they looking for?</em></strong> Think of an algorithm question. The question is defined. The answers are well known to interviews. There’s the typical brute force solution, then there’re improvements. Then there’s the best answer, which has best space-time complexity possible. If the interviewee can come up with the best and code it, you got a happy interviewer. This is the standard.</p><p>What was surprising was, these interviewers who were asking “open ended design questions” were stuck with the same mindset. They were looking for a particular flow. They were looking for a particular answer, or a particular question that the interviewee was supposed to ask. What astounded me was how little they cared about entering a conversation, a discussion, a debate about alternatives.</p><p>Recently, I interviewed at a really well known company in Berlin. I was asked to design a key-value store. I started with explaining a design similar to Memcached. Then went onto explain the design for a persistent store, like Bigtable. Then went through the failure scenarios — if master crashes, if worker crashes, if the network goes down, if the datacenter goes down etc. I talked about replication, talked about sharding, talked about backups. I think within that hour, I’d discussed elaborately about the pros and cons of every piece and aspect of design I could think about.</p><p>The interviewer, apparently, wasn’t satisfied. He complained that I didn’t ask the “right questions.” I was rejected. I remember how we started the conversation:</p><blockquote>Interviewer: Design a distributed key value store.</blockquote><blockquote>Me: Like memcache?</blockquote><blockquote>I: Memcache isn’t distributed.</blockquote><blockquote>Me: Well, it actually is. The Memcache client supports sharding by default. And uses a continuum based consistent hasing approach, which allows us to add or remove servers without affecting all the keys… You only affect 1/(N+1) keys, yada yada.</blockquote><blockquote>I: … nothing ..</blockquote><blockquote>Me: Hmm.. alright, so here’s how a design like Memcache would work..</blockquote><blockquote>And so on..</blockquote><p>I can sense when the interview doesn’t go well. Even though, this particular one went really good in my opinion; I could feel that the interviewer wasn’t into it by the end of it.</p><p><em>How do you know if the interview went well or not?</em> You get 5 mins at the end of interview for questions. As an interviewee, you can gauge by asking the interviewer a question about the interview process (don’t ask how the interview went). If the interviewer didn’t feel good, he’d shy away or be awkward about it.</p><p>I sensed it. After the interview, I asked myself honestly. Would it be possible that the interviewer rejects me? And my experience told me, that’d be stupid. I explained so many aspects of the system, it would be hard to ignore all that “meat”. And it very well, turned out to be <strong><em>very idiotic</em></strong>.</p><h4>I think that’s deeply flawed.</h4><p>And the reason this happens is lack of experience of the interviewer, and hence lack of sensible reasonable expectations for the outcome of the interview. If you’re an interviewer, asking design questions, please do everybody a favor: Enter the discussion. See if you can have a great conversation. Keep yourself open to ideas, new ways of thinking, even though they might conflict your established design. Ask the candidate lots of questions, challenge him. You might just find yourself a colleague you’d want to be around.</p><p><strong><em>In any case, don’t sit quietly looking for a “particular question”</em></strong><em>.</em> If you’re one of those guys, stick to algorithm questions, don’t venture into open ended design territory. You suck at it!</p><h4>About the cover: Van Gogh wasn’t impressed with his now most well-known and admired work.</h4><p>In a letter to his brother, he describes the painting:</p><blockquote>The first four canvases are studies without the effect of a whole that the others have . . . The olives with white clouds and background of mountains, also the moonrise and the night effect, these are exaggerations from the point of view of arrangement, their lines are warped as that of old wood.</blockquote><p>Leonardo Da Vinci held onto his painting of “Mona Lisa”, without releasing it, continuing to work on it for years, stroking a brush now and then. It was drawn on a normal size canvas, at somebody’s request. He didn’t think of it as his masterpiece. It was supposed to be a painting for a gallery, to be hung along with many others. Definitely not deserving of an entire wall, in his opinion.</p><p>Engineers can learn a lot from such remarkable painters.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea7fff3486a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why am I leaving the American Dream?]]></title>
            <link>https://medium.com/@manishrjain/why-am-i-leaving-the-american-dream-4ea455a8f640?source=rss-c9b525a6d2bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ea455a8f640</guid>
            <dc:creator><![CDATA[Manish Rai Jain]]></dc:creator>
            <pubDate>Wed, 02 Oct 2013 05:26:58 GMT</pubDate>
            <atom:updated>2016-05-18T03:20:53.777Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*_my2L_tUdpU9r8gp.jpeg" /><figcaption>Is it worth it?</figcaption></figure><h4>Pangs of the American migration system for an India born emigrant</h4><blockquote><em>In the definition of the American Dream by James Truslow Adams in 1931, “life should be better and richer and fuller for everyone, with opportunity for each according to ability or achievement” regardless of social class or circumstances of birth. — Wikipedia</em></blockquote><h4>2006 — The Exchange Visitor</h4><p>I landed in San Francisco on a Japan Airlines flight from Singapore on a lazy Saturday afternoon. In two days, I’d be working for the best tech company there was, Google. I had realized my life long dream, to live and work in the US. The land of opportunities and equality. And I <em>believed</em> in the <strong>American dream</strong>. I was living it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*h4TQmfxa8bgUm9a_.jpeg" /><figcaption>Google Mountain View, 2006</figcaption></figure><p>Two days before my flight into US, I had received a J-1 visa, which allows interns from all over the world to come and learn from American advancements in technology, medicine and science. However, J-1 came with a clause.</p><blockquote>When you agree to participate in an Exchange Visitor Program and your program falls under the conditions explained below, you will be subject to the two-year home-country physical presence (foreign residence) requirement. This means you will be required to return to your home country for two years at the end of your exchange visitor program. This requirement under immigration law is based on Section 212(e) of the Immigration and Nationality Act.</blockquote><p><a href="http://travel.state.gov/visa/temp/types/types_1267.html#twoyear">http://travel.state.gov/visa/temp/types/types_1267.html#twoyear</a></p><p>This special requirement put my life on a trajectory I didn’t anticipate. Even though I was a student at NTU, Singapore, and had left India 3 years back already, this clause meant I was supposed to go back to India and work there.</p><h4>2007 — Singapore Permanent Residence</h4><p>I once asked visiting guest to NTU, Vivian Balakrishnan, Singapore Minister from ruling party, why he was paying for my education, my living expenses and giving me extra money to enjoy my life in Singapore. He replied, <em>“So you don’t go and work for India, China or the US. We’d rather have you working for Singapore once you graduate, and developing and innovating here.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*kYUAU2hhBMW4mIac.jpeg" /></figure><p>As soon as I graduated from NTU, Singapore, I got offered a Permanent Residence to live and work in Singapore. All I had to do was to sign a paper, and mail it in to the Singapore government, and wait a couple of weeks.</p><p><strong><em>I rejected that offer.</em></strong> I still hadn’t achieved my American dream.</p><h4>2009 — The Waiver</h4><p>I was living in Zurich, Switzerland. My H1-B visa for US was denied in 2007, due to my 2-year residency requirement. But, Switzerland welcomed me. So, I was working in Google Zurich office, living a rich life in a beautiful city, with excellent public transportation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*-5Nv_0073tA6jom_.jpeg" /></figure><p>The Swiss work permit allowed me to freely travel in Schengen region which wasn’t possible through my Indian passport, my spouse to work, and for me to receive a Permanent Residence within 5 years. <strong><em>For many, it was a dream come true. But, not for me.</em></strong></p><p>It took me 1.5 years and 7 different ministries in 3 countries to get my 2-year residency requirement waived. 4 ministries from India were involved in this process, 2 from US, and 1 from Switzerland. But, all the trouble did mean one thing: I could now apply for an American working visa. So, the process started again, and this time I got an L-1 visa, an “intra-company transfer visa” from a foreign branch to a US based branch.</p><h4>2010 — The Marriage</h4><p>I was working in Google’s Mountain View office, when I fell in love with a beautiful Googler, who decided to reply to my deliberately casual email, talk to me, and finally go out on a date with me. We married within 6 months. She was working in Google India office, and after marriage, she moved with me in San Francisco. She applied for an L-2 visa, a spouse of L-1.</p><h4>2011 — The H4</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*hpMCTZQG4ptP12fS.jpeg" /><figcaption>Being a spouse of H1-B is probably the hardest thing one has to do.</figcaption></figure><p>My 2 year L-1 visa was coming towards its expiry, and so I applied for an H1-B. This year, the H1-B lottery wasn’t too bad, and I did receive it. My spouse switched from L-2 to H-4.</p><p>Job market was doing better, and after an initial period of honeymoon, my wife was now looking to settle down in this country that both she and I had started to call our home. However, this wasn’t going to be possible.</p><blockquote>H-4 visa holders are not eligible to get a Social Security Number and cannot be employed. — Wikipedia</blockquote><p>It was a simple statement, yet so difficult to comprehend. This literally meant, she had no other option but to <strong><em>give up her career</em></strong>. Even though we repeated the statement over and over again to ourselves, it didn’t get better. US immigration system did not care about my spouse. She couldn’t get a personal credit card, a employer covered insurance policy, or share the burden of high cost of living in the Silicon Valley. <strong><em>She could no longer work.</em></strong></p><p><strong><em>That’s when I realized, America — the land of opportunities, isn’t really so.</em></strong></p><h4>2012 — The Greencard</h4><blockquote>A green card allows a person to live and work anywhere in America, and is a path to citizenship. An H-1B visa-holder is beholden to the employer who hired him or her, and can be deported unless the holder can find another H-1B sponsor.</blockquote><p>Commonly termed as <em>Permanent Residence</em> all over the world, Americans call it a <em>Greencard</em>, because the first Resident Alien Card had green-stripes on one side. This card allows one to work indefinitely in the US, switch jobs without renewing your H1-B, and start and own innovative new companies.</p><p>The Greencard through jobs category, while aimed at picking up the best talent from all over the world for jobs that “no American was qualified to do”, has no formal points based process to pick up the most qualified people. Most of the applicants are put into 2 categories: workers (EB-3), or professionals (EB-2, holding master’s degree or above).</p><p>Having landed a job with Google even before graduating, I chose not to do masters, a decision that’s a trend in Silicon Valley, where the smartest people drop out of schools to innovate and build the next best things. If you’re scratching your head for examples, such folks include Bill Gates, Sergey Brin, Steve Jobs, and Mark Zuckerberg.</p><p>For me, Greencard was never really an option. I landed in US with a bachelor’s degree, which put me in the lowest EB-3 category. I was born in India, which put me in a long waiting list of 10 years.</p><p><strong><em>If Bill Gates, Steve Jobs or Mark Zuckerberg were to be in my shoes</em></strong><em>, born in India and a desire to live and work in US, they’d be denied a working permit, i.e. H1-B, because they didn’t have even a bachelor’s degree. </em><strong><em>Sergey Brin would get an H1-B</em></strong><em>, but would have to wait 10 years to get a Greencard, like all the Indians in EB-3 category do, before being allowed to start up a company.</em></p><p><strong><em>If I were a Mexican worker,</em></strong> I would get a Greencard within 2-3 years. But, I can’t change where I was born. My American dream was to provide me equal opportunities <strong><em>regardless of social class or circumstances of birth</em></strong><em>. </em>That’s not really how it works though, does it?</p><p><strong><em>The American dream, I finally realized, is totally fucked up!</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*CsaPolNEK6uEM1oy.jpeg" /><figcaption>A misplaced trust in meritocracy and equality.</figcaption></figure><h4>2013 — The Reawakening</h4><p>So, I put my family and life before this dream, and decided to move to Australia. <strong>It was the same me, but a different system</strong>, which recognized what I had to offer to their country. And they loved me back, <strong><em>granting me a Permanent Residence based upon my skills and qualifications, within a year.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nfOazO-8CLUaOJax.jpeg" /><figcaption>Advance Australia.</figcaption></figure><p><strong><em>My dreams I felt, were misplaced.</em></strong></p><p>I wrote this post to remind everybody in my situation, choices that they have to make, whether conscious or unconscious.</p><p>In the next post, I’ll talk about why I chose to migrate to Australia over the rest of the world.</p><p>Update (May 18, 2016): Sorry that next blog post never happened. But, I doubt it’s necessary now, because this:</p><p><a href="http://www.afr.com/technology/cannonbrookes-blackbird-bain-back-new-migrants-graph-startup-20160517-goxglw">http://www.afr.com/technology/cannonbrookes-blackbird-bain-back-new-migrants-graph-startup-20160517-goxglw</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ea455a8f640" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>