<?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 Duy Do on Medium]]></title>
        <description><![CDATA[Stories by Duy Do on Medium]]></description>
        <link>https://medium.com/@duy.do?source=rss-99a1788ba271------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oWsUYhviyFctKKbbIxifMA.jpeg</url>
            <title>Stories by Duy Do on Medium</title>
            <link>https://medium.com/@duy.do?source=rss-99a1788ba271------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 09:13:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@duy.do/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[How Elasticsearch cluster works]]></title>
            <link>https://medium.com/@duy.do/how-elasticsearch-cluster-works-97d537071b87?source=rss-99a1788ba271------2</link>
            <guid isPermaLink="false">https://medium.com/p/97d537071b87</guid>
            <category><![CDATA[search-engines]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[Duy Do]]></dc:creator>
            <pubDate>Sun, 30 Oct 2016 00:50:42 GMT</pubDate>
            <atom:updated>2016-10-30T00:50:42.049Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This post was original published at </em><a href="http://duydo.me/how-elasticsearch-cluster-works/"><em>http://duydo.me/how-elasticsearch-cluster-works/</em></a></p><p>This post is part of a series covering the architecture of Elasticsearch based on my experience while working with it. In this post, we’ll be discussing how the cluster works, try to find answers for following questions:</p><ul><li>How a node in cluster talks to others?</li><li>What happens when a node joins or leaves the cluster?</li><li>What happens when a node stops or has encountered a problem?</li></ul><h3>A Cluster of Nodes</h3><p>When we start an instance of Elasticsearch, we are starting a <em>node</em> and we have a <em>cluster</em> with single node. We start another instance of Elasticsearch has same cluster.name with the first instance and we have a cluster with two nodes. We can start more instances of Elasticsearch to form a cluster with number of nodes we want.</p><p>Every node in the cluster knows about the other nodes within the cluster, they talk to others directly using the native Elasticsearch language over <a href="https://en.wikipedia.org/wiki/Transmission_Control_Protocol">TCP</a>. This is known as a <a href="http://en.wikipedia.org/wiki/Network_topology#Mesh">full connected mesh topology</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/0*VLbz40P89Ibd711O.png" /><figcaption><em>Figure 1. Full connected mesh topology (source </em><a href="https://upload.wikimedia.org/wikipedia/commons/3/3c/NetworkTopology-FullyConnected.png"><em>https://upload.wikimedia.org/wikipedia/commons/3/3c/NetworkTopology-FullyConnected.png</em></a><em>)</em></figcaption></figure><p>Besides that, the nodes are able to talk to external world using <a href="http://www.json.org/">JSON</a> “language” over <a href="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol">HTTP</a>.</p><p>So, we can say:</p><blockquote><em>Elasticsearch is </em><a href="https://en.wikipedia.org/wiki/Peer-to-peer"><em>peer-to-peer</em></a><em> based system, nodes communicate with others directly.</em></blockquote><p>Each node in the cluster plays one or more roles; it can be a <em>master</em> node, <em>data</em> node, <em>client</em> node, or <em>tribe</em> node. Ech role has it own purpose.</p><p><strong>The master node</strong> is responsible for creating, deleting indices, adding the nodes or remove the nodes from the cluster. Each time a cluster state is changed, the master node broadcasts the changes to other nodes in the cluster. There is only one master node in the cluster at a time.</p><p><strong>The data node</strong> is responsible for holding the data in the shards and performing data related operations such as create, read, update, delete, search, and aggregations. We can have many data nodes in the cluster. If one of the data nodes stops, the cluster still operates and re-organizes the data on other nodes.</p><p><strong>The client node</strong> is responsible for routing the cluster-related requests to the master node and the data-related requests to the data nodes, it acts as a “smart <a href="https://en.wikipedia.org/wiki/Router_(computing)">router</a>”. The client node does not hold any data, it also cannot become the master node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*XRMj0T8OU_EdhLwg3JrdVw.png" /><figcaption><em>Figure 2. The client node routes the data-related request to every data nodes in the cluster.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*U8ZM-nkOQqFQTFlHWsMq7w.png" /><figcaption><em>Figure 3. The client node routes the cluster-related request to the master node in the cluster.</em></figcaption></figure><p><strong>The tribe node</strong> is special type of client node that is able to talk to multiple clusters to perform search and other operations.</p><p><strong>The ingest node</strong> is responsible for pre-processing documents before the actual indexing takes into account.</p><p>Now we know role of each node, next we look at what happens behind the sence when a node joins or leaves the cluster.</p><h3>Add a Node to the Cluster</h3><p>When we start a node, the node is starting to ping all the nodes in the cluster for finding the master node. Once the master is found, it will ask the master to join by sending a join request; the master accepts it as a new node of the cluster and then notify all the nodes in the cluster about presense of the new node, and finally the new node connects to all other nodes.</p><p>If the joined node is a data node, the master will reallocate the data evenly across the nodes.</p><h3>Remove a Node from the Cluster</h3><p>If we stop a node or a node in the cluster is unresponsive in specific amout of time, the master node will remove it from the cluster and reallocate the data if the removed node is a data node.</p><p>You might be curious about how the master node knows if other nodes in the cluster are still alive. The master has a fault detection machanism, it pings all the other nodes in the cluster and verify that they are alive or not.</p><p>And about the master, what happens if it stops or has encountered a problem? Same the master node, each node in the cluster also have a fault detection machanism, it pings to master to verify if its still alive. If the master is not alive, other master-eligible nodes will be elected new master to replace the down one within seconds.</p><p>In the next post in this series, we will look at how Elasticsearc index data in a distributed maner.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97d537071b87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interview at Elastic]]></title>
            <link>https://medium.com/@duy.do/interview-at-elastic-e1081af8a0f6?source=rss-99a1788ba271------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1081af8a0f6</guid>
            <category><![CDATA[elastic]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Duy Do]]></dc:creator>
            <pubDate>Mon, 24 Oct 2016 03:41:54 GMT</pubDate>
            <atom:updated>2016-10-24T03:41:54.797Z</atom:updated>
            <content:encoded><![CDATA[<p>Some months ago, I had an interview with <a href="https://elastic.co/">Elastic</a> for Java Software/Support Engineer position. The interview was an interesting experience I’ve ever had, Elastic is a brilliant company with great people and amazing culture.</p><p>The interview process is extremely thorough, all conversations were over the video call. It took two months, ten interviews with different engineers, two VPs of Engineers, and the last one is co-founder, Shay Banon.</p><p>The first conversation I had with the technical recruiter, she is very prompt and friendly. She tried to understand my background, my interests, my familiar with Elasticsearch and its ecosytems. The next five conversations I had with five engineers, they are extremely knowledgeable and enjoyable. The last three conversations with VPs and Shay were extremely interesting. We talked about development philosophies, the product vision, the culture, the people at Elastic and the country where you come from; Shay is excited to know many interesting things about your country. They care deeply about building a world class team and delivering outstanding products. I was very impressed the way they organize a distributed team with more than 300 employees in over 30 countries around the world.</p><p>The technical questions were not too difficult, I believe that you can answer most of those questions if you have solid background about software engineering, distributed systems and of course, about Elasticsearch stack. You don’t need to master all Elastic’s products to work as a support engineer, the people in your team will help you with the products you are not familliar with.</p><p>My interview was very smooth, I went in the final round with Shay, and got very positive feedback from him. I was holding in my hand a wonderful oppurtunity to work with the talented people at Elastic.</p><p>In meantime, there was an event happened to me. An investor from US came to me and asked me to do a startup with my friends to build an influencer marketing platform, this was also a wonderful oppurtunity, wasn’t it? This made me think a lot, I had to make a choice: Elastic or my own business. After carefull consideration, I chose to do my own business. I know a startup is not going to be easy and has a bundle of risks but it will be fun. Honestly, that was a tough decision I’ve ever made. I really love Elasticsearch and had a dream that one day I could work with Shay and his amazing team.</p><p>Although I don’t work for Elastic, I will still continue to contribute to Elasticsearch. The Elasticsearch community is amazing.</p><p>By the way, I want to send my big thanks to Mark Walkom, who referred me to Elastic team :-)</p><p>P.S: The original post was published on my personal blog <a href="http://duydo.me/interview-at-elastic/">http://duydo.me/interview-at-elastic/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1081af8a0f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>