{"componentChunkName":"component---src-templates-blog-list-template-js","path":"/engineering/23","result":{"data":{"allMarkdownRemark":{"edges":[{"node":{"excerpt":"Introduction Redis's usage as both a temporary data store and even as a permanent data store is increasing today, as memory has started…","fields":{"slug":"/engineering/three-ways-to-do-crud-operations-on-redis/"},"html":"<h2 id=\"introduction\" style=\"position:relative;\"><a href=\"#introduction\" aria-label=\"introduction permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Introduction</h2>\n<p>Redis's usage as both a temporary data store and even as a permanent data store is increasing today, as memory has started becoming much cheaper. Redis' quick memory-based CRUD operations allow database interactions to happen significantly faster than interactions with other databases that use drive-based storage. This blog is about three different methods to interact with your Redis data.</p>\n<p>This blog will require having access to a Redis instance. Guides can be found to set up a local Redis instance for Windows <a href=\"https://redislabs.com/blog/redis-on-windows-10/\">here</a> and for UNIX based machines like Mac or other Linux distros, it can be found <a href=\"https://redis.io/topics/quickstart\">here</a>. Alternatively, you can use a remote instance, but be aware that some of the commands in this blog may delete or modify the data.</p>\n<h2 id=\"redis-insight\" style=\"position:relative;\"><a href=\"#redis-insight\" aria-label=\"redis insight permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Redis Insight</h2>\n<p>For users that do not like working with command-line interfaces, the first tool introduced in this blog is a GUI interface called RedisInsight. This can be found <a href=\"https://redislabs.com/redis-enterprise/redis-insight/\">here</a>. After filling in their download form and installing, running the application will start a server on the localhost, which you can access with a browser.</p>\n<p>After installing and running the application, you will add the connection information for your Redis instance. If running a local instance of Redis, the connection information in the image will typically suffice. If connecting to a remote instance, you might need to fill in some additional details for TLS, such as connection certificates.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 80.46153846153847%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAYAAAAWGF8bAAAACXBIWXMAAAsTAAALEwEAmpwYAAABhklEQVQ4y6VU226CQBTk/7+gj/2GPtrXGhIrAmpSLwgSE6NWRBFElst0zyIENKWYnmSynOXs7OwsHOnl9Q2K0sdHtwtZltHlY6/3icVi0QijgHHLDQP9vgJJlrsIggCO4+BwOAi4rivmWsP3EYYhTNOCNBioEJFlqEZ2lzdFUTsejyGpqoqIJVzZsSRljMHzPFHYBkmSiHW6rpPCgUhostiJxjRNa3kTqJZiOBzmR2ZxCu90Lo9A5OSlz715mlCpKGyz+E9C8jDmCoNzUCqMokgobLNB4TnFaDT63cN/KBwgSTNstg784FKS03dVXMxzHiq5wmKyepS2ah9umdbv9i4u4bUkJx8LkEfF8/V65Z7Htc3uCHOFdFzG4lrRPZKkklPNDTRfu+VLyLD73vNv8SRUNN3ozYg6spxQ0zRImqa3/md3+yPfMMYlAjZuiv0pw5aPjpcTznnHkTqdd6zXa5iWheVyyWE/wLZtWPzdZDrjrcrkbWuJr5mFCQeN07mJ1WrF26CCHy+V0P4EYqRsAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Connect\"\n        title=\"Connect\"\n        src=\"/static/e39b9b677a5c9b82b15bbc694fc376d2/e5715/connect.png\"\n        srcset=\"/static/e39b9b677a5c9b82b15bbc694fc376d2/a6d36/connect.png 650w,\n/static/e39b9b677a5c9b82b15bbc694fc376d2/e5715/connect.png 768w,\n/static/e39b9b677a5c9b82b15bbc694fc376d2/1d553/connect.png 1159w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>When connected to your Redis instance, the dashboard UI appears. Clicking the Browser sidebar tab will display all existing keys in your database.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 64%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAAsTAAALEwEAmpwYAAABg0lEQVQ4y62S3UrEMBCF8zii7l8VxBsR9EbfUPGq+7++i+C1i6i4iu5227TZpmmTHKdZlYKuuOLQj9DJ5EzOEHZ0dILD41Ps7R9gc7MGz9tFq+nBa+04Wi3vC41GE/V6w9Vt12uob1BtbQ9b21tgk/ENniYTBEGAMOJ4nYV4fpkh4jHmIYcQiy8kQiBJxOd/GIXgMUdE59lrwGEsQB9tSnCeQGYKYiGhCovCYCW5XlLNsVkooLSFVBpRQt2oIxep62ythTHmW7TWUCqvoJBKBRaTSLmpqehuFuGepyQqkVPrghr9HkOODNiUZpaRxTJBV0IZKi+Q5WZNrIPxWLgb5oUmK9bZzMhCWVTO8Pe83zCYc0iZkah1tsuoCq4rzF6mc2dZm6VdZ1kVfxcsyOrH3G4fnjCNBNJSpDKftQTdM6AZLtIM1+NHXI0neJjG9BYLLGSOlNYqZe4nGP452Nn5BXzfR6fbQ7vbR7vTg9/p0rqkPxihPxxhMLxEbzCE317m/RW8AWsht8xL0ZiyAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Browser\"\n        title=\"Browser\"\n        src=\"/static/e4e72b247e376fc38654a8e9ea97b8cc/e5715/browser.png\"\n        srcset=\"/static/e4e72b247e376fc38654a8e9ea97b8cc/a6d36/browser.png 650w,\n/static/e4e72b247e376fc38654a8e9ea97b8cc/e5715/browser.png 768w,\n/static/e4e72b247e376fc38654a8e9ea97b8cc/1df5b/browser.png 1999w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>From here, CRUD operations are relatively straightforward. Key-value pair creation can be done by using the ADD KEY button. This will prompt for the type of key-value pair to be added (Hash, String, JSON, etc.) and the data that will be stored with the key.</p>\n<p>If a specific key is required to be queried, fill in the field next to the blue filter icon with search criteria, then click the icon. It will prompt the type of data stored with the key, and the results will be displayed.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 64%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAAsTAAALEwEAmpwYAAABeklEQVQ4y62S20rDQBCG93GkNdFGoXgjQr3RN1S8Ss/1XQSvLYKlqbRpmmzOm9PvZGMlF6204pKP3cwO//wzLOt07nBze4/21TUaDQWadonWuQatdSFptbSdqOqZzFNUBeoJ5SptNE+bYMb0DQvDgGVZsG2O1drG53INh7vY0L/vBzvxPP/nbDs2uMvhOBxsZXHkBUAf/CAC5x6iWMizSAukOfaSZBX1GFvbPkRWIBIZ1o4L2wvA/VBWLooCeZ7vJMsyCJHUEAgjAeaSQHmZkc257eGDh3DIXUKlUyp0ODl1lIOZNLOYWiwD25UkKeIkP5JCwrjrS4dJWrks24yphTKpnOHhfDu0NhxRFJNoQYKVy7rgscJsaW5ky6W77RIi/btgSq1KEZrb+2wB0/ERliK1+RwlKJ8BzTAIY7xO53iZGpiZLr3FFEGUIKS9Thn7DYZ/Xuzh8Qm6rqPXH6DbH6LbG0Dv9WmvGI4mGI4nGI2fMRiNoXeruL6HL5SRt9nF32tXAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Filter\"\n        title=\"Filter\"\n        src=\"/static/53a06909b443c049fd05525a7800f50e/e5715/filter.png\"\n        srcset=\"/static/53a06909b443c049fd05525a7800f50e/a6d36/filter.png 650w,\n/static/53a06909b443c049fd05525a7800f50e/e5715/filter.png 768w,\n/static/53a06909b443c049fd05525a7800f50e/1df5b/filter.png 1999w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Finally, keys can be deleted by clicking the trash can icon on the right side.</p>\n<h2 id=\"redis-cli\" style=\"position:relative;\"><a href=\"#redis-cli\" aria-label=\"redis cli permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Redis CLI</h2>\n<p>The Redis command-line interface is a more common approach for developers to interact with data from a Redis store. If you followed the steps at the beginning of the blog, the CLI should already be installed. To do a ping test to the server, type the following command in the terminal:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"console\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">chris@LR-ENG-17:~$ redis-cli -h localhost -p 6379 ping</span>\n<span class=\"grvsc-line\">PONG</span></code></pre>\n<p>And to connect, run the previous command without pinging:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"console\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">chris@LR-ENG-17:~$ redis-cli -h localhost -p 6379</span>\n<span class=\"grvsc-line\">localhost:6379&gt;</span></code></pre>\n<p>The basic command to get a key-value pair is to call get with the key:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"console\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">localhost:6379&gt; get key:1</span>\n<span class=\"grvsc-line\">&quot;value1&quot;</span></code></pre>\n<p>Setting a value can be done with the set command:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"console\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">localhost:6379&gt; set key:1 value1new</span>\n<span class=\"grvsc-line\">OK</span>\n<span class=\"grvsc-line\">localhost:6379&gt; get key:1</span>\n<span class=\"grvsc-line\">&quot;value1new&quot;</span></code></pre>\n<p>Creating a value can also be done in the same way:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"console\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">localhost:6379&gt; get key:3</span>\n<span class=\"grvsc-line\">(nil)</span>\n<span class=\"grvsc-line\">localhost:6379&gt; set key:3 value3new</span>\n<span class=\"grvsc-line\">OK</span>\n<span class=\"grvsc-line\">localhost:6379&gt; get key:3</span>\n<span class=\"grvsc-line\">&quot;value3new&quot;</span></code></pre>\n<p>And deletion can be done with the del command:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"console\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">localhost:6379&gt; del key:3</span>\n<span class=\"grvsc-line\">(integer) 1</span>\n<span class=\"grvsc-line\">localhost:6379&gt; get key:3</span>\n<span class=\"grvsc-line\">(nil)</span>\n<span class=\"grvsc-line\">localhost:6379&gt;</span></code></pre>\n<p>This is only the simple basics of the Redis CLI. You can do more advanced operations through the CLI, such as the flushall command, which wipes your database. It’s a powerful tool, so be careful when experimenting with it. An extensive list of commands can be found <a href=\"https://redis.io/commands\">here</a>.</p>\n<h2 id=\"with-your-chosen-programming-language\" style=\"position:relative;\"><a href=\"#with-your-chosen-programming-language\" aria-label=\"with your chosen programming language permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>With Your Chosen Programming Language</h2>\n<p>With Redis’ widespread usage, almost all major industry programming languages have either community or official supported releases of libraries that can be used to interact with your database. In this section, I will be using Node.JS, and one of the support Redis libraries called <a href=\"https://github.com/NodeRedis/node-redis\">node-redis</a>.</p>\n<p>Initialization of the package in the code can be done by calling the following command after initializing Node in your directory:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"console\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">npm install redis</span></code></pre>\n<p>When the process is finished, the <code>redis</code> module should be imported within your code, where you can set up the Redis connection and any options that need to be included:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">redis</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">require</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;redis&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">redisOption</span><span class=\"mtk1\"> = {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">host:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;127.0.0.1&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">port:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;6379&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">client</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">redis</span><span class=\"mtk1\">.</span><span class=\"mtk11\">createClient</span><span class=\"mtk1\">()</span></span></code></pre>\n<p>For an extensive list of options supported by the library for connection, check this <a href=\"https://github.com/NodeRedis/node-redis#API\">link</a>.</p>\n<p>After connecting, calling the <code>on</code> method on the client will allow the connection to open and run commands.</p>\n<p>The commands used by the library are a 1 to 1 mapping of the commands used by the Redis CLI, so they follow the same method calls. To update or create an entry in Redis, the most basic method is to use the set command:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">client</span><span class=\"mtk1\">.</span><span class=\"mtk11\">set</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;key:3&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;value3new&quot;</span><span class=\"mtk1\">)</span></span></code></pre>\n<p>Getting a value can be done with the get method:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">client</span><span class=\"mtk1\">.</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;key:3&quot;</span><span class=\"mtk1\">)</span></span></code></pre>\n<p>Deleting a value can be done with the del method:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">client</span><span class=\"mtk1\">.</span><span class=\"mtk11\">del</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;key:3&quot;</span><span class=\"mtk1\">)</span></span></code></pre>\n<p>The methods used by the client also support callbacks. For example, if the operations should be console logged, we can include a callback to <code>redis.print</code> after each method:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"11\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">client</span><span class=\"mtk1\">.</span><span class=\"mtk11\">set</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;key:3&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;value3new&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">redis</span><span class=\"mtk1\">.</span><span class=\"mtk12\">print</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">client</span><span class=\"mtk1\">.</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;key:3&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">redis</span><span class=\"mtk1\">.</span><span class=\"mtk12\">print</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">client</span><span class=\"mtk1\">.</span><span class=\"mtk11\">del</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;key:3&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">redis</span><span class=\"mtk1\">.</span><span class=\"mtk12\">print</span><span class=\"mtk1\">)</span></span></code></pre>\n<p>The output of this in the console would be:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"console\" data-index=\"12\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">Reply: OK</span>\n<span class=\"grvsc-line\">Reply: value3new</span>\n<span class=\"grvsc-line\">Reply: 1</span></code></pre>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>This blog has only touched the surface of the different operations Redis can do. There are many more resources online that can help you go further into your understanding of Redis. Whether using Redis as a temporary store, like a cache, or using it as a primary, permanent store, the operations' speed is something to be acknowledged and considered when building your next big app.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n</style>","frontmatter":{"date":"October 21, 2020","updated_date":null,"description":"Start working with Redis in three different ways.","title":"Three Ways to do CRUD Operations On Redis","tags":["Redis","NodeJs","CLI","GUI"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/4eda1ce5a0f541d97fdf27cd88bf2a49/ee604/index.png","srcSet":"/static/4eda1ce5a0f541d97fdf27cd88bf2a49/69585/index.png 200w,\n/static/4eda1ce5a0f541d97fdf27cd88bf2a49/497c6/index.png 400w,\n/static/4eda1ce5a0f541d97fdf27cd88bf2a49/ee604/index.png 800w,\n/static/4eda1ce5a0f541d97fdf27cd88bf2a49/f3583/index.png 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Chris Yee","github":null,"avatar":null}}}},{"node":{"excerpt":"Have you ever wondered how our universe is stitched together? Or how matter behaves at the atomic and subatomic levels? Do you know-how is a…","fields":{"slug":"/engineering/traversing-the-realms-of-quantum-network/"},"html":"<p>Have you ever wondered how our universe is stitched together? Or how matter behaves at the atomic and subatomic levels? Do you know-how is a quantum computer different from a supercomputer, or what are the functions that it can perform which a typical computer can't? </p>\n<p>Or, have you ever thought of the amplification of photon particles in a laser beam? Our universe is full of occurrences that are hard to explain. However, the answer to all these questions lies in understanding the fundamentals of nature. For that, let us take a look at Quantum mechanics, which explains the functioning of particles together at the smallest level. Quantum mechanics is a branch of physics which is mainly concerned with the behaviour and nature of matter and energy and atomic and subatomic levels. </p>\n<p>With huge advancements in this field, the concept of quantum computers and quantum internet has now come to life. Typical computers are based on binary digits, that is, 0 and 1. Quantum computers, on the other hand, are based on qubits. A qubit or quantum bit is the basic unit for quantum information. They are based on particle's physical properties, such as the spin of an electron, and hence differ in various ways. We know that electron spin can either up or down, but things change when it comes to quantum mechanics. It follows the concept of superposition, according to which an electron can exist in a state in which it has a spin in both directions simultaneously. This may sound strange according to what we observe generally, yet this is how Quantum mechanics work. </p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 31.538461538461537%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAGABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAIF/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/2gAMAwEAAhADEAAAAd2RKC//xAAWEAEBAQAAAAAAAAAAAAAAAAABABH/2gAIAQEAAQUClxv/xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAwEBPwFn/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAFhABAQEAAAAAAAAAAAAAAAAAAQAQ/9oACAEBAAY/AoM//8QAGBAAAwEBAAAAAAAAAAAAAAAAAAEhQRH/2gAIAQEAAT8h5Y4OSJXRaf/aAAwDAQACAAMAAAAQC8//xAAWEQADAAAAAAAAAAAAAAAAAAABEBH/2gAIAQMBAT8QKL//xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAgEBPxAn/8QAGRABAQEBAQEAAAAAAAAAAAAAARExACFh/9oACAEBAAE/EBz4aSb0DDdZPk4oonre/9k='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Quantum \"\n        title=\"Quantum \"\n        src=\"/static/2128303175bf529662552060eff9ccfd/212bf/Phio-Network-by-Quantum-Xchange-1.jpg\"\n        srcset=\"/static/2128303175bf529662552060eff9ccfd/6aca1/Phio-Network-by-Quantum-Xchange-1.jpg 650w,\n/static/2128303175bf529662552060eff9ccfd/212bf/Phio-Network-by-Quantum-Xchange-1.jpg 768w,\n/static/2128303175bf529662552060eff9ccfd/38a9e/Phio-Network-by-Quantum-Xchange-1.jpg 1470w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>The peculiar behaviour that particles display can be useful in various ways. Qubits can store much more information than conventional bits. This can be explained as two bits with one of the four possible values, 00, 01, 10, or 11. Qubits, on the other hand, can be both 0 and 1 at once. This implies they can have all the four values all at once.\nThus, the amount of information you store using qubits increases tremendously. </p>\n<p>Quantum computers have the scope of performing operations even faster than the fastest supercomputers. Quantum computing also promises higher security and encryption. If we see the current encryption methods, all of them have some loopholes due to which information can be compromised sooner or later. Through quantum computing, the information will travel through qubits. The users will know in case someone tries to abstract the information. Thus, quantum computers promise you a very secure future!</p>\n<p>But then, how is all this information transmitted? It is Quantum networks that facilitate the transmission of information through qubits. It is an essential part of quantum computing and quantum communication systems. For quantum communication to be possible, qubits have to move from one quantum processor to the other over long distances. Thus, an\nintra-connection of local quantum networks with quantum internet is required. To understand the quantum network even better, let us take a look at its elements. The classical network and quantum network have a lot in common. </p>\n<p>They are:</p>\n<ul>\n<li>we require quantum processors with at least one qubit. A quantum processor is a small quantum computer capable of performing quantum logic gates on a given number of qubits. These quantum processors, along with one qubit, are known as end nodes, on which the application is run. Some applications might also require more than one qubit to function. </li>\n<li>Transfer of qubits requires communication lines, for which standard telecom fibers can be used.</li>\n<li>optical switches are required to optimize the communication infrastructure as they deliver qubits to the required processors. Fourthly, we require quantum repeaters so that qubits or information can travel through long distances. </li>\n</ul>\n<p>According to the current scenario, IBM has 18 quantum computers, and Google AI Quantum is also advancing towards quantum computing. The current quantum computing period is referred to as the Intermediate-Scale Quantum (NISQ) era by quantum computing scientists. Quantum supremacy is not too far as Quantum computers of over 50 qubits have already been created. </p>\n<p>Google has also demonstrated quantum supremacy with its quantum computer, the Sycamore Processor. It took 200 seconds to perform a computation, which would have required 10,000 years if solved using a traditional computer. Amazon and Microsoft are also a part of bringing global access to quantum computing. This is the future of quantum networking, and according to Deffner, \"We cannot rely on old concepts anymore, but we need something new.\"</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"October 21, 2020","updated_date":null,"description":"Basic structure and knowledge of Quantum Networking and how it can change the field of technology.","title":"Traversing the realms of Quantum Network","tags":["Engineering","Quantum","Networking"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/95ed780fc93f29b754a49f9162413173/ee604/quantum_comp_FB.png","srcSet":"/static/95ed780fc93f29b754a49f9162413173/69585/quantum_comp_FB.png 200w,\n/static/95ed780fc93f29b754a49f9162413173/497c6/quantum_comp_FB.png 400w,\n/static/95ed780fc93f29b754a49f9162413173/ee604/quantum_comp_FB.png 800w,\n/static/95ed780fc93f29b754a49f9162413173/d40e6/quantum_comp_FB.png 941w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Devansh Markan","github":"markandevansh99","avatar":null}}}},{"node":{"excerpt":"What is Bot? According to Wikipedia, It is a software application that runs automated tasks (scripts) over the Internet. In other terms, It…","fields":{"slug":"/engineering/how-to-make-telegram-bot/"},"html":"<h2 id=\"what-is-bot\" style=\"position:relative;\"><a href=\"#what-is-bot\" aria-label=\"what is bot permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is Bot?</h2>\n<p>According to Wikipedia, It is a software application that runs automated tasks (scripts) over the Internet. In other terms, It is a program written to mimic human behaviour in order to perform some tasks. Bots take input and do simple and repetitive tasks, which is much faster than humans. </p>\n<p>There are two types of bots:</p>\n<ul>\n<li>Good Bots: Bots that are  beneficial to organizations as well as individuals such as ChatBots, Social Media bots, etc</li>\n<li>Bad Bots: These are the bots that are used to perform malicious activities such as Scraping and Spamming.</li>\n</ul>\n<p>In this, We will make Telegram Chatbot, which would send a copy of the input that the user has sent.</p>\n<h2 id=\"making-our-telegram-chatbot\" style=\"position:relative;\"><a href=\"#making-our-telegram-chatbot\" aria-label=\"making our telegram chatbot permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Making our Telegram Chatbot</h2>\n<p>We will be using <strong>Python language</strong> to make the bot and will be using <strong>Telegram package</strong> for our bot.\nYou can know more about the telegram package from <a href=\"https://python-telegram-bot.readthedocs.io/en/stable/telegram.html\">here</a></p>\n<p>Firstly, we will generate our telegram token. Below are the steps to follow to generate your own token.</p>\n<ol>\n<li>Search BotFather on Telegram.</li>\n<li>Type <strong>/start</strong> to get started.</li>\n<li>Type <strong>/newbot</strong> to get a bot.</li>\n<li>Enter your Bot name and unique Username, which should end with the bot.</li>\n<li>Then, you would get your Bot token.</li>\n</ol>\n<p>After generating our token, we will make a python program to create a Telegram bot that will send the Text, Emojis, and Stickers similar to the user's input.</p>\n<ul>\n<li>Importing libraries required.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"python\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> logging</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">from</span><span class=\"mtk1\"> telegram.ext </span><span class=\"mtk15\">import</span><span class=\"mtk1\"> Updater, Filters, CommandHandler, MessageHandler</span></span></code></pre>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"python\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">logging.basicConfig(</span><span class=\"mtk12\">format</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&#39;</span><span class=\"mtk4\">%(asctime)s</span><span class=\"mtk8\"> - </span><span class=\"mtk4\">%(name)s</span><span class=\"mtk8\"> - </span><span class=\"mtk4\">%(levelname)s</span><span class=\"mtk8\"> - </span><span class=\"mtk4\">%(message)s</span><span class=\"mtk8\">&#39;</span><span class=\"mtk1\">,     </span><span class=\"mtk3\">#take time,level,name</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">level</span><span class=\"mtk1\">=logging.INFO)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">logger = logging.getLogger(</span><span class=\"mtk12\">__name__</span><span class=\"mtk1\">)</span></span></code></pre>\n<p>This script does a basic configuration for the logging system. It takes time, level, and name.</p>\n<ul>\n<li>Now, we will make a variable Token, which will take your Telegram token.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"python\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">TOKEN = </span><span class=\"mtk8\">&quot;ENTER YOUR TOKEN&quot;</span><span class=\"mtk1\">  </span></span></code></pre>\n<ul>\n<li>After writing the token, we will make some functions that our bot will perform.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"python\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">def</span><span class=\"mtk1\"> </span><span class=\"mtk11\">start</span><span class=\"mtk1\">(</span><span class=\"mtk12\">bot</span><span class=\"mtk1\">,</span><span class=\"mtk12\">update</span><span class=\"mtk1\">):</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    name  = update.message.from_user.first_name  </span><span class=\"mtk3\">#first name of the user messaging</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    reply = </span><span class=\"mtk8\">&quot;Hi!! </span><span class=\"mtk4\">{}</span><span class=\"mtk8\">&quot;</span><span class=\"mtk1\">.format(name)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    bot.send_message(</span><span class=\"mtk12\">chat_id</span><span class=\"mtk1\"> = update.message.chat_id, </span><span class=\"mtk12\">text</span><span class=\"mtk1\"> = reply)      </span><span class=\"mtk3\">#sending message</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">def</span><span class=\"mtk1\"> </span><span class=\"mtk11\">help</span><span class=\"mtk1\">(</span><span class=\"mtk12\">bot</span><span class=\"mtk1\">,</span><span class=\"mtk12\">update</span><span class=\"mtk1\">):</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    reply = </span><span class=\"mtk8\">&quot;How can I help You&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    bot.send_message(</span><span class=\"mtk12\">chat_id</span><span class=\"mtk1\"> = update.message.chat_id, </span><span class=\"mtk12\">text</span><span class=\"mtk1\"> = reply)  </span><span class=\"mtk3\">#sending message</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">def</span><span class=\"mtk1\"> </span><span class=\"mtk11\">echo_text</span><span class=\"mtk1\">(</span><span class=\"mtk12\">bot</span><span class=\"mtk1\">,</span><span class=\"mtk12\">update</span><span class=\"mtk1\">):</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    reply = update.message.text</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    bot.send_message(</span><span class=\"mtk12\">chat_id</span><span class=\"mtk1\"> = update.message.chat_id, </span><span class=\"mtk12\">text</span><span class=\"mtk1\"> = reply)</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">def</span><span class=\"mtk1\"> </span><span class=\"mtk11\">sticker</span><span class=\"mtk1\">(</span><span class=\"mtk12\">bot</span><span class=\"mtk1\">,</span><span class=\"mtk12\">update</span><span class=\"mtk1\">):</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    reply = update.message.sticker.file_id</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    bot.send_sticker(</span><span class=\"mtk12\">chat_id</span><span class=\"mtk1\"> = update.message.chat_id, </span><span class=\"mtk12\">sticker</span><span class=\"mtk1\"> = reply)</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">def</span><span class=\"mtk1\"> </span><span class=\"mtk11\">error</span><span class=\"mtk1\">(</span><span class=\"mtk12\">bot</span><span class=\"mtk1\">,</span><span class=\"mtk12\">update</span><span class=\"mtk1\">):</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    logger.error(</span><span class=\"mtk8\">&quot;Shit!! Update </span><span class=\"mtk4\">{}</span><span class=\"mtk8\"> caused error </span><span class=\"mtk4\">{}</span><span class=\"mtk8\">&quot;</span><span class=\"mtk1\">.format(update,update.error))</span></span></code></pre>\n<p><strong>start</strong> function would be taking the user's input and would be sending, Hi, with the user's name.</p>\n<p><strong>help</strong> function will prompt the message of how can I help you.</p>\n<p><strong>echo_text</strong> and <strong>sticker</strong> function will send the same message or the stickers which the user has sent.</p>\n<p><strong>error</strong> function would be printing the error message on the command prompt.</p>\n<ul>\n<li>Finally, we will make the main function, which would be executed first on running the program. It will take the updates and handle the updates.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"python\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">def</span><span class=\"mtk1\"> </span><span class=\"mtk11\">main</span><span class=\"mtk1\">():</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    updater = Updater(TOKEN)  </span><span class=\"mtk3\">#take the updates</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    dp = updater.dispatcher   </span><span class=\"mtk3\">#handle the updates</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    dp.add_handler(CommandHandler(</span><span class=\"mtk8\">&quot;start&quot;</span><span class=\"mtk1\">, start))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    dp.add_handler(CommandHandler(</span><span class=\"mtk8\">&quot;help&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk11\">help</span><span class=\"mtk1\">))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    dp.add_handler(MessageHandler(Filters.text, echo_text))   </span><span class=\"mtk3\">#if the user sends text</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    dp.add_handler(MessageHandler(Filters.sticker, sticker))  </span><span class=\"mtk3\">#if the user sends sticker</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    dp.add_error_handler(error)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    updater.start_polling()</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    logger.info(</span><span class=\"mtk8\">&quot;Started...&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    updater.idle()</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">if</span><span class=\"mtk1\"> </span><span class=\"mtk12\">__name__</span><span class=\"mtk1\">==</span><span class=\"mtk8\">&quot;__main__&quot;</span><span class=\"mtk1\">:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    main()</span></span></code></pre>\n<blockquote>\n<p>Save the program and execute it to check the working of the telegram bot on telegram.</p>\n</blockquote>\n<p>You can get the source code to make the Telegram bot from this Github Repository <a href=\"https://github.com/LoginRadius/engineering-blog-samples/tree/master/Telegram-Bot\">Bot :robot:</a>. You can also make some changes to the code to make the bot do cool stuff such as Getting News, Articles, or Movies recommendations.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n</style>","frontmatter":{"date":"October 20, 2020","updated_date":null,"description":"What is a bot and How to make our own Telegram bot.","title":"How to make a telegram bot","tags":["Telegram Bot","Python"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.4814814814814814,"src":"/static/cb66cf473b4bec0ee68677e0cd9ab0ed/ee604/bot.png","srcSet":"/static/cb66cf473b4bec0ee68677e0cd9ab0ed/69585/bot.png 200w,\n/static/cb66cf473b4bec0ee68677e0cd9ab0ed/497c6/bot.png 400w,\n/static/cb66cf473b4bec0ee68677e0cd9ab0ed/ee604/bot.png 800w,\n/static/cb66cf473b4bec0ee68677e0cd9ab0ed/f3583/bot.png 1200w,\n/static/cb66cf473b4bec0ee68677e0cd9ab0ed/e4d72/bot.png 1280w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Rajan Puri","github":"rjn01","avatar":null}}}},{"node":{"excerpt":"Apple's smartphone OS running on iPhone, iPad, iPod Touch hardware is iOS. For these computers, Apple offers tools and services for…","fields":{"slug":"/engineering/getting-started-with-ios-app-development/"},"html":"<p>Apple's smartphone OS running on iPhone, iPad, iPod Touch hardware is iOS. For these computers, Apple offers tools and services for developing iOS apps and accessories.</p>\n<p>You can use React Native (JavaScript) or Xamarin (C# &#x26; F#) as an iOS developer to programme in native languages like Swift or Objective-C or build native cross-platform applications.</p>\n<p>In this article, we'll explore how to build iOS apps. We're going to look at how you can learn to develop an iOS application and play with existing apps.</p>\n<p>As with learning something new, learning to build iOS is difficult. Although, It is enjoyable, exciting, and satisfying!</p>\n<p>Here's what we'll get into:</p>\n<ol>\n<li>Setup your MAC for ios app development</li>\n<li>Setup, your editor for ios application</li>\n<li>Create your first ios app</li>\n<li>Run the ios application</li>\n</ol>\n<p>You will have a step-by-step plan to learn how to create an ios app when you have completed reading this guide. You know precisely what you should do, what steps you should take, and how you should take them. Yeah, and you don't need any coding experience to get started.</p>\n<p>So let's get started...</p>\n<h2 id=\"1-setup-your-mac-for-ios-app-development\" style=\"position:relative;\"><a href=\"#1-setup-your-mac-for-ios-app-development\" aria-label=\"1 setup your mac for ios app development permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. Setup your MAC for ios app development</h2>\n<p>Apple prefers a closed ecosystem over an open system. iOS can only be run on Apple's own devices, including the iPhone and iPad.</p>\n<p>We can run Mac on window machines using VMWare or Hackintosh, but these are not recommended for iOS coding purposes.\nSo basically, as an iOS developer, you will need a Mac for the development/debugging/testing of an iOS app.</p>\n<h2 id=\"2-setup-your-editor-for-ios-application\" style=\"position:relative;\"><a href=\"#2-setup-your-editor-for-ios-application\" aria-label=\"2 setup your editor for ios application permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. Setup, your editor for ios application</h2>\n<p>To start developing iOS apps, Xcode is the only tool you need to download. Xcode is an integrated development environment (IDE) provided by Apple. It includes the iOS SDK (Software Development Kit), a source code editor(UI), debugging tools, and much more.</p>\n<p>Many helping tools and needed simulators with a particular iOS version can be installed and added to Xcode.\nYou will need to have an Apple ID to download Xcode, deploy your app to a real iPhone/iPad for testing, and download any other software from AppStore.</p>\n<p>Apple ID is used to authenticate a user in Apple devices. You may create it by visiting the apple <a href=\"https://appleid.apple.com/account#!&#x26;page=create\">official site</a>.</p>\n<p>To install Xcode, go to the Mac App Store. App Store can be found in the dock. Login there with your Apple ID. In the Mac App Store, search \"Xcode\" and click the \"Get\" button to download it.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 19.846153846153847%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAEABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAME/8QAFQEBAQAAAAAAAAAAAAAAAAAAAgP/2gAMAwEAAhADEAAAAckxCQof/8QAGRAAAwADAAAAAAAAAAAAAAAAAQIRABIT/9oACAEBAAEFAuawos1Gf//EABYRAQEBAAAAAAAAAAAAAAAAAAABQf/aAAgBAwEBPwHFf//EABYRAQEBAAAAAAAAAAAAAAAAAAABIf/aAAgBAgEBPwFJj//EABgQAAIDAAAAAAAAAAAAAAAAAAABECEx/9oACAEBAAY/AsFUf//EABsQAAICAwEAAAAAAAAAAAAAAAABEWEhMVFx/9oACAEBAAE/IYWay9ZINndi4H//2gAMAwEAAgADAAAAEHv/AP/EABYRAQEBAAAAAAAAAAAAAAAAAAEAEf/aAAgBAwEBPxCJ1v/EABgRAAIDAAAAAAAAAAAAAAAAAAABESHh/9oACAECAQE/ENEQo//EABwQAQABBAMAAAAAAAAAAAAAAAEAESFBUTFh4f/aAAgBAQABPxASUBZ9plI3aum4kvmnLuf/2Q=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Imag1\"\n        title=\"Imag1\"\n        src=\"/static/e1e98ff4ce98a31de803a400ecfe65f9/212bf/Imag1.jpg\"\n        srcset=\"/static/e1e98ff4ce98a31de803a400ecfe65f9/6aca1/Imag1.jpg 650w,\n/static/e1e98ff4ce98a31de803a400ecfe65f9/212bf/Imag1.jpg 768w,\n/static/e1e98ff4ce98a31de803a400ecfe65f9/f30f2/Imag1.jpg 984w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h2 id=\"3-create-your-first-ios-app\" style=\"position:relative;\"><a href=\"#3-create-your-first-ios-app\" aria-label=\"3 create your first ios app permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. Create your first ios app</h2>\n<p>Now click and launch Xcode. Choose create a new Xcode project option to make a new project. Then choose the Single View App option as a type of the project and click Next. It will come with one view controller and a storyboard that you can customize further.</p>\n<p>Let's name your project as HelloWorld as per the convention 😉. Choose Team None for now. Select Swift as Language, click Next, and you are ready with your empty app doing nothing yet.</p>\n<blockquote>\n<p>Note: For creating a native <a href=\"https://www.loginradius.com/blog/engineering/secure-enclave-ios-app/\">iOS app</a>, you have to use one from Objective-c or Swift. Swift is a new and easy language provided by Apple, got so much popularity in less time.</p>\n</blockquote>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 95.6923076923077%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAATABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAIDBf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAHmaSSAtggH/8QAGRABAAIDAAAAAAAAAAAAAAAAAQAQAhIx/9oACAEBAAEFAjuetBGiNf/EABQRAQAAAAAAAAAAAAAAAAAAACD/2gAIAQMBAT8BH//EABQRAQAAAAAAAAAAAAAAAAAAACD/2gAIAQIBAT8BH//EABYQAAMAAAAAAAAAAAAAAAAAAAAiMP/aAAgBAQAGPwIWH//EABoQAAIDAQEAAAAAAAAAAAAAAAERABAxIUH/2gAIAQEAAT8hDhtezoFKFOGmAsMUzMV//9oADAMBAAIAAwAAABAczwD/xAAWEQEBAQAAAAAAAAAAAAAAAAARICH/2gAIAQMBAT8QNY//xAAXEQADAQAAAAAAAAAAAAAAAAABEBEh/9oACAECAQE/ELkRX//EAB4QAQACAQUBAQAAAAAAAAAAAAEAESEQMUFhcVGR/9oACAEBAAE/EAaOUw+Q0jWCtq96ZCjyPS1e2phyfsF73fhhq4t+un//2Q=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Image2\"\n        title=\"Image2\"\n        src=\"/static/67bca733e2f3247c73539c605ddb3802/212bf/Image2.jpg\"\n        srcset=\"/static/67bca733e2f3247c73539c605ddb3802/6aca1/Image2.jpg 650w,\n/static/67bca733e2f3247c73539c605ddb3802/212bf/Image2.jpg 768w,\n/static/67bca733e2f3247c73539c605ddb3802/1abae/Image2.jpg 986w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Not to worry, you will soon modify your created app saying Hello to the World. 😍\nIn Xcode, you can navigate to a file or folder from the code editor's left panel. The right panel of the code editor, called Utility Area, will help you dealing with views or any component in the storyboard.</p>\n<p>On the top toolbar, you can see the Run and Stop buttons. At the bottom of the code area, you can see the debug/console area with breakpoint and other runtime tools.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 52.76923076923077%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAALABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAIFBP/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAGdRloaBSz/xAAcEAABAwUAAAAAAAAAAAAAAAACAAEDEBIUIjH/2gAIAQEAAQUCJ9rYsVF2n//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABkQAAEFAAAAAAAAAAAAAAAAACEAERIgcf/aAAgBAQAGPwIJxPa//8QAHBAAAQQDAQAAAAAAAAAAAAAAAAExQVEQIXFh/9oACAEBAAE/IdSAvj/T0UN4WOH/2gAMAwEAAgADAAAAEOjf/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPxA//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPxA//8QAHBAAAgICAwAAAAAAAAAAAAAAAREAITFxQWGR/9oACAEBAAE/EHCAglgmLXp7tmVClbjuD4RCFWif/9k='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Image6\"\n        title=\"Image6\"\n        src=\"/static/993fe93501d6c8b5f48d46331b300464/212bf/Image6.jpg\"\n        srcset=\"/static/993fe93501d6c8b5f48d46331b300464/6aca1/Image6.jpg 650w,\n/static/993fe93501d6c8b5f48d46331b300464/212bf/Image6.jpg 768w,\n/static/993fe93501d6c8b5f48d46331b300464/5db06/Image6.jpg 2796w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Now find and open Main.storyboard in the project directory by clicking on it. The storyboard is a file to design your view to show and layout all the components such as buttons, labels, lists, tab and navigation bars, and many more. Here you will see a blank view. Select the view by clicking on it. </p>\n<p>From Xcode 10 or above, for objects like a label to add, click on View menu in menu bar>click Show Library and drag the label to focused view. Or in older Xcode, you may find Object Library in the bottom right part of Xcode. Now double click on the label you have dropped on the view and change it's text to Hello World!</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 59.84615384615384%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAMABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAQFAf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAGdSlsouYH/xAAaEAACAgMAAAAAAAAAAAAAAAABAwACBBAh/9oACAEBAAEFAiYFUOH3QfYJn//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABkQAAMAAwAAAAAAAAAAAAAAABAREwAhIv/aAAgBAQAGPwLKLoz0h//EABoQAAMBAQEBAAAAAAAAAAAAAAABESFhUfD/2gAIAQEAAT8h8xk0RPb0+aNxjpNeaU//2gAMAwEAAgADAAAAEE//AP/EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EABsQAQADAQADAAAAAAAAAAAAAAEAETEhUXGR/9oACAEBAAE/EOFF9xlrUVWVzMih5VQjA/ewC9e1Wm/MVRwyf//Z'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Image3\"\n        title=\"Image3\"\n        src=\"/static/f7a810ef4c5c9ad51762701303ba10c1/212bf/Image3.jpg\"\n        srcset=\"/static/f7a810ef4c5c9ad51762701303ba10c1/6aca1/Image3.jpg 650w,\n/static/f7a810ef4c5c9ad51762701303ba10c1/212bf/Image3.jpg 768w,\n/static/f7a810ef4c5c9ad51762701303ba10c1/f29e8/Image3.jpg 2792w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Feeling excited? 😃</p>\n<p><strong>Here you go with your first-ever app on screen</strong></p>\n<h2 id=\"4-run-the-ios-application\" style=\"position:relative;\"><a href=\"#4-run-the-ios-application\" aria-label=\"4 run the ios application permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4. Run the ios application</h2>\n<p>Select the device destination or simulator from the Xcode screen's top left near the Run/Stop button. And press Command ⌘ + R to run the app or click the run button. It will initiate the iOS simulator and run your first app.</p>\n<p>For running the app on a real device, connect the device via cable to Mac. The device will automatically be shown in the list of device destinations. Now select the device and press Command ⌘ + R.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 59.23076923076923%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAMABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAIDAQX/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/aAAwDAQACEAMQAAAB50tRLCh//8QAGBAAAgMAAAAAAAAAAAAAAAAAABEBAhD/2gAIAQEAAQUCZIy2/wD/xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAUEAEAAAAAAAAAAAAAAAAAAAAg/9oACAEBAAY/Al//xAAZEAEAAgMAAAAAAAAAAAAAAAABEBEAUaH/2gAIAQEAAT8hTbzE7gKqf//aAAwDAQACAAMAAAAQXD//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/ED//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/ED//xAAaEAEAAwEBAQAAAAAAAAAAAAABABEhMUFR/9oACAEBAAE/EN0tJiA9QdGPPsBUi5DhP//Z'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Image4\"\n        title=\"Image4\"\n        src=\"/static/1d105f5d8e41e6c28009a4869dfbede0/212bf/Image4.jpg\"\n        srcset=\"/static/1d105f5d8e41e6c28009a4869dfbede0/6aca1/Image4.jpg 650w,\n/static/1d105f5d8e41e6c28009a4869dfbede0/212bf/Image4.jpg 768w,\n/static/1d105f5d8e41e6c28009a4869dfbede0/a525f/Image4.jpg 2768w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Share your first app with your parents and friends, and feel proud. 👏 </p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 66.61538461538463%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAB0klEQVQ4y5WT20oCQRjHZyNql8DOR8l0rTwgHXXscNFJs+xMWHSA8N4LH8GLwnfoEbYWMtBC0QvxSlSoV/AZZNtydpoxV8Iu1j74M/9hZn/fzHzfAtAUBoORsdkdYH7BaSbTKhHmOA4Hg0EcDodxKBTCh0cnrsDZOQgEztuAVqytbzB07OjkHJFIRM7n8zidTqO3t3elXC7jp6cYIsng8vIquLy81gb69/aZurXG43EZ/4RSFy6VSshisUGHYwbc3AS1gT7frgq0C4JQA8qyrHx+ftWAuVwOmfhJODVtBRcXV9pA77ZPBU49iuIHhSCEFBrUZ7NZpNcb4LhhorU39Hi2VaBZFEWJQiqVikJFfSaTQQODw3BwaAQcn5z+D6ie8DcwlUohXXcv1Ol6wP7BoTZwa8v7Gyg1X/nl5RWxXBfs6GTBzq5fG7i56WkAhYcHSS0KFfWx2DNi2tphLbnH20JRvI2imBOJhNTcNslkEpG11oEul1sFTt7e3kmFQoEWQqEqFos4Go1WyQnddIPTBbWBRiPPzMzOA/fSipFMv+q/nsKyrEI91ezcwiJpbmDizdrARSds+NEx/X1fXz82mXjSzHyV+uGRUYHcnCGiSf98/w1cdxYUD3304AAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"HelloWorld\"\n        title=\"HelloWorld\"\n        src=\"/static/02681684b072d8209378da6681010b07/e5715/hello_word.png\"\n        srcset=\"/static/02681684b072d8209378da6681010b07/a6d36/hello_word.png 650w,\n/static/02681684b072d8209378da6681010b07/e5715/hello_word.png 768w,\n/static/02681684b072d8209378da6681010b07/d61c2/hello_word.png 1800w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<blockquote>\n<p>Note: If you want to debug or run any existing app/demo instead of developing your own. For example, You might have some projects downloaded from Github on your local system. Now follow the instructions from project's Github to explore the project.\nOpen the project in Xcode and run in a simulator or real device by following step 4 described above.</p>\n</blockquote>\n<p>That's it. </p>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>It's incredibly entertaining and satisfying to create your app idea. It's not just the result that counts-what makes it worth it is the gradual progress of improving, learning, and refining. And in the process, you will cultivate a special, employable skill of iOS development.</p>\n<p>I hope you liked this tutorial. Kindly share the blog and comment for any query or suggestion. </p>\n<p>To learn more about iOS applications, you can check out this article on “How to obtain iOS application logs without Mac” to learn about ios app logs in mac.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"October 19, 2020","updated_date":null,"description":"I will guide you through the best approach to learning how to develop iOS apps in this post, so you can build and publish your own iOS apps from scratch.","title":"iOS App Development: How To Make Your First App","tags":["ios","swift","xcode","mac"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5267175572519085,"src":"/static/2795b51e70abc821c5dddcb342f6bc82/14b42/CoverImage.jpg","srcSet":"/static/2795b51e70abc821c5dddcb342f6bc82/f836f/CoverImage.jpg 200w,\n/static/2795b51e70abc821c5dddcb342f6bc82/2244e/CoverImage.jpg 400w,\n/static/2795b51e70abc821c5dddcb342f6bc82/14b42/CoverImage.jpg 800w,\n/static/2795b51e70abc821c5dddcb342f6bc82/16310/CoverImage.jpg 1024w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Tanvi Jain","github":"tanvijn","avatar":null}}}},{"node":{"excerpt":"We'll talk about Apache Beam in this guide and discuss its fundamental concepts. We will begin by showing the features and advantages of…","fields":{"slug":"/engineering/apache-beam/"},"html":"<p>We'll talk about Apache Beam in this guide and discuss its fundamental concepts. We will begin by showing the features and advantages of using Apache Beam, and then we will cover basic concepts and terminologies.</p>\n<p>Ever since the concept of big data got introduced to the programming world, a lot of different technologies, frameworks have emerged. The processing of data can be categorized into two different paradigms. One is Batch Processing, and the other is Stream Processing. </p>\n<p>Different technologies came into existence for different paradigms, solving various big data world problems, for, e.g., Apache Spark, Apache Flink, Apache Storm, etc. </p>\n<p>As a developer or a business, it's always challenging to maintain different tech stacks and technologies. Hence, Apache Beam to the rescue!</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 49.84615384615385%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAAsTAAALEwEAmpwYAAACHklEQVQoz2WSW2/TQBCF/VeReOYnIPHEMxL0pVJBkaCiSCBVqSiI0obSplUhbZM0F5qEksS5NY4vseO1vfbHOqagiJFWe5kzc3b3HC12Z4jrE8J+jWjcJhw2SYAkSUjimDTSvZSSWO3TcxknyxnSvJ9hjHcE+w/Q4sAjGDQJVbPotktk9FH4ZZM0HNNgYU2zolj+Icmypl7j+v0XWnuX9PKb6M8fobES0b+l6xJPhpTXcuiFwgrqvCsJUrRep5IrU3nVoLrZovL6Ek0sbBoXH7gq7VIsPuG6U+H8/Ai9VsQ6/kxUvVg2kbNb/FIR7BkPt4Y825/ysdKi16sj5z/xzRae2USzzTGlozd8/7pFu12nPxtyXN/jpLWP4Y1xwwRbqJuHAcbGU+Zrj7k6LbN1afLisE9v6jAY+1Tb4ZJYsy2T8WjAwvNWnlU92+bsIMdxYRPPzz5ehpJBp4lo7qgvaTDs99jJ53m7vceNnmG0KIoUuSCKQiVGpurCc9G7LSajXwT+/C+JUOnclUnvpkLn9CW1coF8YRdh1RRBE0PvpqLc6XlnhQQhFpizKYEQGcHCZTLWcWyTSEHmc5OjTxsc7K5zcbiO+Haf+ek9+qX/VF6NO6ogCLDMmWqsLCZ8jOkto5GOaVkkUihRfiCdhrJkT/nQmyBdHakEkN6I2DeyISziwFnOaRGhkxoRGQl8Z4zn2oSewoULktAniQKFn/MbmpDqVNye7XEAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Timeline of Big Data Frameworks\"\n        title=\"Timeline of Big Data Frameworks\"\n        src=\"/static/1e7f65aaa920379cd8b429236ecf5cb7/e5715/timeline-bigdata-frameworks.png\"\n        srcset=\"/static/1e7f65aaa920379cd8b429236ecf5cb7/a6d36/timeline-bigdata-frameworks.png 650w,\n/static/1e7f65aaa920379cd8b429236ecf5cb7/e5715/timeline-bigdata-frameworks.png 768w,\n/static/1e7f65aaa920379cd8b429236ecf5cb7/07a9c/timeline-bigdata-frameworks.png 1440w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h2 id=\"what-is-apache-beam\" style=\"position:relative;\"><a href=\"#what-is-apache-beam\" aria-label=\"what is apache beam permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is Apache Beam?</h2>\n<p>Apache Beam is an open source, centralised model for describing parallel-processing pipelines for both batch and streaming data. The programming model of the Apache Beam simplifies large-scale data processing dynamics. </p>\n<p>The Apache Beam model offers helpful abstractions that insulate you from distributed processing information at low levels, such as managing individual staff, exchanging databases, and other activities. These low-level information are handled entirely by Dataflow. </p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 76.46153846153847%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEHElEQVQ4y02UC0xTVxjHv0IpYKaQyEOyMWhLawx0Mpgxm2yyKO/yKM4lsoTNMEbcSwLUIkUID43bkBCJzrBBykBgmDhlXQimKE8FlrmFxwUKLVVMnDQUS3m0vbf322lBspP88v9yT/LL951zcoHRy4BdkIFVmw64kQWIZ+BeyxEgi0PwJngSeASvbTzXS4WALRLAzkjArijAhnBYuyCEhYJQAAcRoiHTbY1K9UD8nIv4LcnT7rmn+N6iYF5A9H6vgJMf+vglv7s7MJzv+fr+N3n+eFHsjn2HuPgohov6WC7eedvjRbHArT/nDQBGJyNkyIl4bnM2fcQylTrm0Mmm2ScfNeOQpI4dCJ9c7TnwiPAQSc0ORdRhRViz5YJwerVUMGYqEYxslAlnsVpUgRdFWx0S4Y+sXoYbM+n4ciINWX0GMoaTE9YHkgH7gwg0qg+4cNbWfkk/VorHzUo+mpRh+FwhQDIuEmE7XhJvCQnBtC7jMD7LjFrVnZcaJ/LicT6Sb78NIXQXSKxDH8TYCLSaK7H/ASH4BfCt11MSN1XZaVgjjsLL4sNMhYi/WS7cEQIznwz4LA9wEGDhBYbNGejITUR/RNylW8FQnQVDnfUa+TZvwahxxGC88hZgLbmcSwJgKkVgLQ8jQtcZyjiMUeVBI8LG+kosso4VB8usOMzTL9FqNhLRMrLMMqLDyDqYZQLtoO13T5CXgM2pbsy1BHe2SsTBKhG4Fo/HA5vN5ma322HNYo5jHUSBDqR73sf1x2o0/LuMBr0OtVotmkwm1rlL0/RDEuBkaWkJRkdHt2RUqwambmo4RsrAdW5azOYklmVdQjvVjfTSItoZFu02G9qsNmRoMgfrEv7pfKt3vq51uyo96ybfl8Ap8o97JewFqukeTHQPw+jy/K6Zudk4al6bNm20yaaeLn42SU3KJ2emz80+0Z3WLuozSMq0Bl10dcQp+CHpS8jfEwvyoAQo/J/Qj2rRCMd/6zv4uKsvpruxU3C3sF6slteE93yviqkXfuqTCfDar/k1MaqsUsnPKYXiX5S1op/OVB29Iv0msmDvMaE8KDGg0P/4jrCWJE619TJU+33854Y6f0DR9HxQ2WwfKFHhcFnLrbbEcw0dqSXYIT1vu5WqNNcczD5bFJSwVhwixaLAeCQjN5KErXFbNZUk16ZaNfNUW+/i39d/z+tXNFGDJaqnwyXNppHymw0diYrvOqVKU0dysaEzVblQE5mdV+B3XFsUEK8nMjOR1ZHc6dCLpC9JH9Kh79jV255/lbXvbsyp2Jt79EToJ++lBCaFvOOfKToiUBz6OECdWbnnsiTLs3BfvI8iONmHyHyJzHurw9bebTQuqLb7sNg6BM051bC9vF/9ZbaTU3/sK7gRnQsF5MycXRUR5ETmFP4HPQyC2KrLXHkAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Beam-Model\"\n        title=\"Beam-Model\"\n        src=\"/static/bcda8196d6c879a95ccdd397242e01fb/e5715/beam_architecture.png\"\n        srcset=\"/static/bcda8196d6c879a95ccdd397242e01fb/a6d36/beam_architecture.png 650w,\n/static/bcda8196d6c879a95ccdd397242e01fb/e5715/beam_architecture.png 768w,\n/static/bcda8196d6c879a95ccdd397242e01fb/1cfc2/beam_architecture.png 900w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h2 id=\"features-of-apache-beam\" style=\"position:relative;\"><a href=\"#features-of-apache-beam\" aria-label=\"features of apache beam permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Features of Apache Beam</h2>\n<p>The unique features of Apache  beam are as follows:</p>\n<ol>\n<li>Unified - Use a single programming model for both batch and streaming use cases.</li>\n<li>Portable - Execute pipelines in multiple execution environments. Here, execution environments mean different runners. Ex. Spark Runner, Dataflow Runner, etc</li>\n<li>Extensible - Write custom SDKs, IO connectors, and transformation libraries.</li>\n</ol>\n<h2 id=\"apache-beam-sdks-and-runners\" style=\"position:relative;\"><a href=\"#apache-beam-sdks-and-runners\" aria-label=\"apache beam sdks and runners permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Apache Beam SDKs and Runners</h2>\n<p>As of today, there are 3 Apache beam programming SDKs</p>\n<ol>\n<li>Java</li>\n<li>Python</li>\n<li>Golang</li>\n</ol>\n<p>Beam Runners translate the beam pipeline to the API compatible backend processing of your choice. Beam currently supports runners that work with the following backends.</p>\n<ol>\n<li>Apache Spark</li>\n<li>Apache Flink</li>\n<li>Apache Samza</li>\n<li>Google Cloud Dataflow</li>\n<li>Hazelcast Jet</li>\n<li>Twister2</li>\n</ol>\n<p>Direct Runner to run on the host machine, which is used for testing purposes.</p>\n<h2 id=\"basic-concepts-in-apache-beam\" style=\"position:relative;\"><a href=\"#basic-concepts-in-apache-beam\" aria-label=\"basic concepts in apache beam permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Basic Concepts in Apache Beam</h2>\n<p>Apache Beam has three main abstractions. They are</p>\n<ol>\n<li>Pipeline</li>\n<li>PCollection</li>\n<li>PTransform</li>\n</ol>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 13.999999999999998%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAADCAYAAACTWi8uAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA/klEQVQI1wHzAAz/APXx65U1ZahDOWmr/0Fvr/osX6b/Y4e5ef///z8mWaBRNGWq/zdnq/ktYKf/dJO/bv///zsfVJ5bPWut/0BurvkvYaf/SXSwPvbz7Z3k5ebHAOPg28VLd7VKOmqu/0t2tP8zZKr/cJC8k///73coV5paOGir/0NxsP8xY6n/g57Cjf//73EfUphjPmyu/0l0sv82Zqr/Y4e6TNrX09PS0tP/AHlsWRhcc5MrJU6HZyNSlFUwYqlUDEeaFpWsywAuY60YK16mUyZapE0tX6ZUADWTD5OqygAxZa0cK16lVChcpU0vYadTCEacDf/v1wvf4eMUMeqAEPko5kUAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Beam-Pipeline\"\n        title=\"Beam-Pipeline\"\n        src=\"/static/439968fcb84e700e21b6475c5aa49214/e5715/pipeline-design.png\"\n        srcset=\"/static/439968fcb84e700e21b6475c5aa49214/a6d36/pipeline-design.png 650w,\n/static/439968fcb84e700e21b6475c5aa49214/e5715/pipeline-design.png 768w,\n/static/439968fcb84e700e21b6475c5aa49214/1132d/pipeline-design.png 1158w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h3 id=\"pipeline\" style=\"position:relative;\"><a href=\"#pipeline\" aria-label=\"pipeline permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Pipeline:</h3>\n<p>A pipeline is the first abstraction to be created. It holds the complete data processing job from start to finish, including reading data, manipulating data, and writing data to a sink. Every pipeline takes in options/parameters that indicate where and how to run. </p>\n<h3 id=\"pcollection\" style=\"position:relative;\"><a href=\"#pcollection\" aria-label=\"pcollection permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>PCollection:</h3>\n<p>A pcollection is an abstraction of distributed data. A pcollection can be bounded, i.e., finite data, or unbounded, i.e., infinite data. The initial pcollection is created by reading data from the source. From then on, pcollections are the source and sink of every step in the pipeline.</p>\n<h3 id=\"transform\" style=\"position:relative;\"><a href=\"#transform\" aria-label=\"transform permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Transform:</h3>\n<p>A transform is a data processing operation. A transform is applied on one or more pcollections. Complex transforms have other transform nested within them. Every transform has a generic <code>apply</code> method where the logic of the transform sits in.</p>\n<h2 id=\"example-of-pipeline\" style=\"position:relative;\"><a href=\"#example-of-pipeline\" aria-label=\"example of pipeline permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example of Pipeline</h2>\n<p>Here, let's write a pipeline to output all the jsons where the name starts with a vowel.</p>\n<p>Let's take a sample input. Name the file as <code>input.json</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;abhi&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk7\">12</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;virat&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk7\">23</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;dhoni&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk7\">45</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;rahul&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk7\">156</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Edmund&quot;</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Ojha&quot;</span><span class=\"mtk1\">}</span></span></code></pre>\n<p>The input should be a newline delimited JSON.</p>\n<p>Include the following dependencies in your <code>pom.xml</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">&lt;dependency&gt;</span>\n<span class=\"grvsc-line\">    &lt;groupId&gt;org.apache.beam&lt;/groupId&gt;</span>\n<span class=\"grvsc-line\">    &lt;artifactId&gt;beam-sdks-java-core&lt;/artifactId&gt;</span>\n<span class=\"grvsc-line\">    &lt;version&gt;2.24.0&lt;/version&gt;</span>\n<span class=\"grvsc-line\">&lt;/dependency&gt;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">&lt;dependency&gt;</span>\n<span class=\"grvsc-line\">    &lt;groupId&gt;org.apache.beam&lt;/groupId&gt;</span>\n<span class=\"grvsc-line\">    &lt;artifactId&gt;beam-runners-direct-java&lt;/artifactId&gt;</span>\n<span class=\"grvsc-line\">    &lt;version&gt;2.24.0&lt;/version&gt;</span>\n<span class=\"grvsc-line\">&lt;/dependency&gt;</span></code></pre>\n<p>Let's code the beam pipeline. Follow the steps</p>\n<ol>\n<li>\n<p>Create a pipeline.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">Pipeline</span><span class=\"mtk1\"> </span><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">Pipeline</span><span class=\"mtk1\">.</span><span class=\"mtk11\">create</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// OR </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Pipeline pipeLine = Pipeline.create(options);</span></span></code></pre>\n<p>Create a pipeline which binds all the pcollections and transforms. Optionally you can pass the PipelineOptions <code>options</code> if needed.</p>\n</li>\n<li>\n<p>Read the input file</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">PCollection</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">&gt; </span><span class=\"mtk12\">inputCollection</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Read My File&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">TextIO</span><span class=\"mtk1\">.</span><span class=\"mtk11\">read</span><span class=\"mtk1\">().</span><span class=\"mtk11\">from</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;input.json&quot;</span><span class=\"mtk1\">));</span></span></code></pre>\n<p>Use the <code>TextIO</code> transform to read the input files. Every line is a different json record.</p>\n</li>\n<li>\n<p>Apply a transform to filter out the names starting from a vowel</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">PCollection</span><span class=\"mtk1\"> </span><span class=\"mtk12\">filteredCollection</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">inputCollection</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Filter names starting with vowels&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Filter</span><span class=\"mtk1\">.</span><span class=\"mtk11\">by</span><span class=\"mtk1\">(</span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">SerializableFunction</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">, </span><span class=\"mtk10\">Boolean</span><span class=\"mtk1\">&gt;() {</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Boolean</span><span class=\"mtk1\"> </span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">input</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk10\">ObjectMapper</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jacksonObjMapper</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">ObjectMapper</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">try</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk10\">JsonNode</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jsonNode</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">jacksonObjMapper</span><span class=\"mtk1\">.</span><span class=\"mtk11\">readTree</span><span class=\"mtk1\">(input);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">jsonNode</span><span class=\"mtk1\">.</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;name&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">textValue</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">vowels</span><span class=\"mtk1\">.</span><span class=\"mtk11\">contains</span><span class=\"mtk1\">(</span><span class=\"mtk12\">name</span><span class=\"mtk1\">.</span><span class=\"mtk11\">substring</span><span class=\"mtk1\">(</span><span class=\"mtk7\">0</span><span class=\"mtk1\">,</span><span class=\"mtk7\">1</span><span class=\"mtk1\">).</span><span class=\"mtk11\">toLowerCase</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            } </span><span class=\"mtk15\">catch</span><span class=\"mtk1\"> (</span><span class=\"mtk10\">JsonProcessingException</span><span class=\"mtk1\"> </span><span class=\"mtk12\">e</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk11\">printStackTrace</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk4\">false</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }))</span></span></code></pre>\n<p>The filter transform takes a SerializableFunction Object where the <code>apply</code> method is overridden. Every json-string record is converted to a JSON. The first character of the <code>name</code> is checked if it's a vowel. The transform is applied to each input JSON record. Based on the boolean value returned, the record is retained or discarded.</p>\n</li>\n<li>\n<p>Write the results to a file</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">inputCollection</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;write to file&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">TextIO</span><span class=\"mtk1\">.</span><span class=\"mtk11\">write</span><span class=\"mtk1\">().</span><span class=\"mtk11\">to</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;result&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">withSuffix</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.txt&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">withoutSharding</span><span class=\"mtk1\">());</span></span></code></pre>\n<p>The results of the <code>Filter</code> transform are stored in a text file using the write method of the <code>TextIO</code> transform. As PCollections are distributed across machines, the results are written to multiple files/shards. To avoid this, we use <code>withoutSharding</code> where all the output is written to a single file.</p>\n</li>\n</ol>\n<p>Output:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Edmund&quot;</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Ojha&quot;</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;abhi&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk7\">12</span><span class=\"mtk1\">}</span></span></code></pre>\n<hr>\n<p>Complete Code:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">Pipeline</span><span class=\"mtk1\"> </span><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">Pipeline</span><span class=\"mtk1\">.</span><span class=\"mtk11\">create</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Set</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">&gt; </span><span class=\"mtk12\">vowels</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">HashSet</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">&gt;(</span><span class=\"mtk12\">Arrays</span><span class=\"mtk1\">.</span><span class=\"mtk11\">asList</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;a&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&quot;e&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&quot;i&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&quot;o&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&quot;u&quot;</span><span class=\"mtk1\">));</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Read My File&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">TextIO</span><span class=\"mtk1\">.</span><span class=\"mtk11\">read</span><span class=\"mtk1\">().</span><span class=\"mtk11\">from</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;input.json&quot;</span><span class=\"mtk1\">))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        .</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Filter names starting with vowels&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Filter</span><span class=\"mtk1\">.</span><span class=\"mtk11\">by</span><span class=\"mtk1\">(</span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">SerializableFunction</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">, </span><span class=\"mtk10\">Boolean</span><span class=\"mtk1\">&gt;() {</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Boolean</span><span class=\"mtk1\"> </span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">input</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk10\">ObjectMapper</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jacksonObjMapper</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">ObjectMapper</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk15\">try</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk10\">JsonNode</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jsonNode</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">jacksonObjMapper</span><span class=\"mtk1\">.</span><span class=\"mtk11\">readTree</span><span class=\"mtk1\">(input);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">jsonNode</span><span class=\"mtk1\">.</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;name&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">textValue</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">vowels</span><span class=\"mtk1\">.</span><span class=\"mtk11\">contains</span><span class=\"mtk1\">(</span><span class=\"mtk12\">name</span><span class=\"mtk1\">.</span><span class=\"mtk11\">substring</span><span class=\"mtk1\">(</span><span class=\"mtk7\">0</span><span class=\"mtk1\">,</span><span class=\"mtk7\">1</span><span class=\"mtk1\">).</span><span class=\"mtk11\">toLowerCase</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                } </span><span class=\"mtk15\">catch</span><span class=\"mtk1\"> (</span><span class=\"mtk10\">JsonProcessingException</span><span class=\"mtk1\"> </span><span class=\"mtk12\">e</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk11\">printStackTrace</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk4\">false</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        .</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;write to file&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">TextIO</span><span class=\"mtk1\">.</span><span class=\"mtk11\">write</span><span class=\"mtk1\">().</span><span class=\"mtk11\">to</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;result&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">withSuffix</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.txt&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">withoutSharding</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\">.</span><span class=\"mtk11\">run</span><span class=\"mtk1\">().</span><span class=\"mtk11\">waitUntilFinish</span><span class=\"mtk1\">();</span></span></code></pre>\n<p>For more advanced concepts, refer to the official site - beam.apache.org</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n</style>","frontmatter":{"date":"October 16, 2020","updated_date":null,"description":"Apache Beam simplifies large-scale data processing dynamics. Let’s read more about the features, basic concepts, and the fundamentals of Apache beam.","title":"Apache Beam: A Basic Guide","tags":["Engineering","Big Data","Streaming","Apache Beam","Java"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/17c96c6367455f79bdb854c4608ebaba/ee604/main.png","srcSet":"/static/17c96c6367455f79bdb854c4608ebaba/69585/main.png 200w,\n/static/17c96c6367455f79bdb854c4608ebaba/497c6/main.png 400w,\n/static/17c96c6367455f79bdb854c4608ebaba/ee604/main.png 800w,\n/static/17c96c6367455f79bdb854c4608ebaba/f3583/main.png 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Abhilash K R","github":"Better-Boy","avatar":null}}}},{"node":{"excerpt":"In this article, we'll talk about the basic concept of virtual environment in python -  what it is and how to use it and also how to build…","fields":{"slug":"/engineering/python-virtual-environments/"},"html":"<p>In this article, we'll talk about the basic concept of virtual environment in python -  what it is and how to use it and also how to build and manage separate environments for your Python projects using virtual environments. </p>\n<h2 id=\"what-is-a-virtual-environment\" style=\"position:relative;\"><a href=\"#what-is-a-virtual-environment\" aria-label=\"what is a virtual environment permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is a virtual environment?</h2>\n<p>A virtual environment is simply a tool that separates the dependencies of different projects by creating a separate isolated environment for each project.</p>\n<p>These are simply the directories so that unlimited virtual environments can be created. This is one of the popular tools used by most of the Python developers.</p>\n<h2 id=\"why-do-we-need-a-virtual-environment\" style=\"position:relative;\"><a href=\"#why-do-we-need-a-virtual-environment\" aria-label=\"why do we need a virtual environment permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why do we need a virtual environment?</h2>\n<p><a href=\"/python-basics-in-minutes/\">Python has various modules</a> and packages for different applications. During our project, it may require a third-party library, which we install. Another project also uses the same directory for retrieval and storage but doesn't require any other third-party packages.</p>\n<p>So, the virtual environment can come into play and make a separate isolated environment for both projects, and each project can store and retrieve packages from their specific environment.</p>\n<p>Also, let us consider another case where we are creating a web application <a href=\"https://www.djangoproject.com/start/\">using Django</a>. Suppose you are working on two projects project1 and project2. </p>\n<p>If project1 uses Django-2.2 and project2 uses Django-3.2, they would be stored in the same directory with the same name, and the error may occur. Then, in such cases, virtual environments can be really helpful for you to maintain the dependencies of both the projects.</p>\n<h2 id=\"how-does-a-virtual-environment-work\" style=\"position:relative;\"><a href=\"#how-does-a-virtual-environment-work\" aria-label=\"how does a virtual environment work permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How does a virtual environment work?</h2>\n<p>To create a virtual environment, we need a <a href=\"https://pypi.org/project/virtualenv/\">module named</a> virtualenv. It creates a folder with all the necessary executables to run Python projects. Make sure <strong>pip</strong> is installed on your computer. If not, then use the following command:</p>\n<p><span class=\"gatsby-resp-image-wrapper\" style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 331px; \">\n      <span class=\"gatsby-resp-image-background-image\" style=\"padding-bottom: 9.969788519637461%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAYAAABYBvyLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAYklEQVQI1x2MWQoAIBBCO1VBC61UtND9T2M4H4PzVFRzTlhrce9FCAE5Z9Dz3uO9B2MMSinovYsyozfGEI9aa0VKCXtvKIJzToAjZBb5n3OgtZYyx3jMObjWEm6tSR5jlI0PV0RHC9U/CxwAAAAASUVORK5CYII='); background-size: cover; display: block;\"></span>\n  <img class=\"gatsby-resp-image-image\" alt=\"Pip\" title=\"Pip\" src=\"/static/45276ff2f7856aff2fc418e38b5bb086/62452/pip.png\" srcset=\"/static/45276ff2f7856aff2fc418e38b5bb086/62452/pip.png 331w\" sizes=\"(max-width: 331px) 100vw, 331px\" style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\" loading=\"lazy\">\n    </span><br></p>\n<h3 id=\"install-virtualenv\" style=\"position:relative;\"><a href=\"#install-virtualenv\" aria-label=\"install virtualenv permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Install virtualenv:</h3>\n<p>Open the terminal and paste the following command to install a virtualenv:</p>\n<p><span class=\"gatsby-resp-image-wrapper\" style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 239px; \">\n      <span class=\"gatsby-resp-image-background-image\" style=\"padding-bottom: 11.297071129707113%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAYAAABYBvyLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAaElEQVQI1zWMOQpEIRBE/7FUNHFFUQTFwNz7X6GGapioumt5X+8dWmu01uC9h1IKKSXknFFKEa21wjknGT3m1BCCZLxjjLj34iOQo3MO1lowxgh8zinlMYaotVag7P8he2/52eHmvYcfyuJJjX1xfG8AAAAASUVORK5CYII='); background-size: cover; display: block;\"></span>\n  <img class=\"gatsby-resp-image-image\" alt=\"Install\" title=\"Install\" src=\"/static/5af461d00e70d9d16783fde12bb3c2a1/4a279/install.png\" srcset=\"/static/5af461d00e70d9d16783fde12bb3c2a1/4a279/install.png 239w\" sizes=\"(max-width: 239px) 100vw, 239px\" style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\" loading=\"lazy\">\n    </span><br></p>\n<h3 id=\"check-your-version-of-virtualenv\" style=\"position:relative;\"><a href=\"#check-your-version-of-virtualenv\" aria-label=\"check your version of virtualenv permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Check your version of virtualenv:</h3>\n<p>If you want to confirm whether it is installed or not, paste the command below in your terminal:</p>\n<p><span class=\"gatsby-resp-image-wrapper\" style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 218px; \">\n      <span class=\"gatsby-resp-image-background-image\" style=\"padding-bottom: 10.550458715596331%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAYAAABYBvyLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAaUlEQVQI1zWNSQpEIRBD/510oeDGAcUBRV14/5OkSUEvHoFUkvrWWlBKofeOGKNoCAG1VrTWkHMWpae1hjEGzjnxmCmlCCkl8b69N6y14PAYQ47U956Mzzlx75UyHzPrvQd75J8h5xz8AMv8SUjXRbReAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"></span>\n  <img class=\"gatsby-resp-image-image\" alt=\"Check\" title=\"Check\" src=\"/static/b0b9c719b641e238a80752140d3670b0/5c416/check.png\" srcset=\"/static/b0b9c719b641e238a80752140d3670b0/5c416/check.png 218w\" sizes=\"(max-width: 218px) 100vw, 218px\" style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\" loading=\"lazy\">\n    </span><br></p>\n<h3 id=\"create-a-virtual-environment\" style=\"position:relative;\"><a href=\"#create-a-virtual-environment\" aria-label=\"create a virtual environment permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Create a virtual environment:</h3>\n<p>After successful installation of virtualenv, now you can create a virtual environment with your desired name using following command:</p>\n<p><span class=\"gatsby-resp-image-wrapper\" style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 173px; \">\n      <span class=\"gatsby-resp-image-background-image\" style=\"padding-bottom: 15.606936416184972%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAADCAYAAACTWi8uAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAo0lEQVQI1z2OzQqEMAyEfaXa1n9txQVvK57UoqLorWBh3x9mNzns4SNkJhkmssYgTVMIIaCUQpZl0FqjqirWiDzPkSQJpJTsxXH8hzSCfmmP/PPBMLw5YNs2zPOM4ziwLAumaYL3Hvu+Y11X3PeN8zxxXRc/j+PItyEE9p1ziLruhbIsuUFd1zC/xhROTdu2Rd/37JNHOk1rLQcWRYGmaRjSiS9Bs2uaEQAvvgAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"></span>\n  <img class=\"gatsby-resp-image-image\" alt=\"Check\" title=\"Check\" src=\"/static/a7f6533ac0491384606c3829a615961c/991de/name.png\" srcset=\"/static/a7f6533ac0491384606c3829a615961c/991de/name.png 173w\" sizes=\"(max-width: 173px) 100vw, 173px\" style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\" loading=\"lazy\">\n    </span><br></p>\n<p>Here, I created <code>venv</code> as the name of my virtual environment. You can name it whatever you desire. The folder with the name <code>venv</code> is created that contains all the necessary executables to <a href=\"/speed-up-python-code/\">run the Python project</a>. This is the folder where all your python packages will run.</p>\n<p>To specify the Python interpreter of your choice, you can do it easily by specifying Python{version-name}.\nEg: To create python2.7 virtual environment, we use following command:</p>\n<p><span class=\"gatsby-resp-image-wrapper\" style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 267px; \">\n      <span class=\"gatsby-resp-image-background-image\" style=\"padding-bottom: 9.737827715355804%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAYAAABYBvyLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAZElEQVQI1z1ORwoAIAzzV4qKgrhw4tX//yPSHjwU0gwSYYxBKQUpJbTWkHNGCAFaa1hr4b1HjPF7CNPVWuGcg5Tya/QLAvdeJs45GGOwgUSl1A9T0VqL9d475pycodK9N/M05AGDMEhAYlM7dwAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"></span>\n  <img class=\"gatsby-resp-image-image\" alt=\"Version\" title=\"Version\" src=\"/static/087c713522e4864919d656de11b83948/19e8f/version.png\" srcset=\"/static/087c713522e4864919d656de11b83948/19e8f/version.png 267w\" sizes=\"(max-width: 267px) 100vw, 267px\" style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\" loading=\"lazy\">\n    </span><br></p>\n<p>After successfully creating the virtual environment, you need to activate it to enter into that particular isolated environment. Always remember to activate the required virtual environment before working on the project. To activate it, we move to the location where the name of your desired virtual environment is located and follow the command below:</p>\n<p><span class=\"gatsby-resp-image-wrapper\" style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 257px; \">\n      <span class=\"gatsby-resp-image-background-image\" style=\"padding-bottom: 10.505836575875485%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAYAAABYBvyLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAaElEQVQI1zWNOQ5EIQxD/6UoQOyiYoeC+9/EI0eaIkry7MTfOQchBLz3sNbCnBO9dxhjsPeWGmNI0UO91gresZO31nDvFfbxmdYapRTEGGGtlQClFFJK8N4LZ8B/d84h5yyMM/3U6PsBTEVIfCCX9AcAAAAASUVORK5CYII='); background-size: cover; display: block;\"></span>\n  <img class=\"gatsby-resp-image-image\" alt=\"Activate\" title=\"Activate\" src=\"/static/31d62d4aadcaa0cb12d7b74df382c6ed/96e35/activate.png\" srcset=\"/static/31d62d4aadcaa0cb12d7b74df382c6ed/96e35/activate.png 257w\" sizes=\"(max-width: 257px) 100vw, 257px\" style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\" loading=\"lazy\">\n    </span><br></p>\n<p><strong>Note:</strong> Instead of <code>venv</code>, you write the name of your virtual environment you created.<br></p>\n<h4 id=\"in-windows\" style=\"position:relative;\"><a href=\"#in-windows\" aria-label=\"in windows permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>In Windows,</h4>\n<p><span class=\"gatsby-resp-image-wrapper\" style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 230px; \">\n      <span class=\"gatsby-resp-image-background-image\" style=\"padding-bottom: 12.173913043478262%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAYAAABYBvyLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAZklEQVQI12WLRwoFIRQE50wmEK8gYgBzuP8p+uODP5tZFBRN9XPOgTEGc06stVBrhbUWrTWUUhBCwN6biDHCOUdtzhnee6SUMMZA752+j5QSnHOCMfa6EIK4m9Yat7t+N6XUp/v/f+VRSBk6ycwKAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"></span>\n  <img class=\"gatsby-resp-image-image\" alt=\"Windows\" title=\"Windows\" src=\"/static/854d4c8e0a7a976f6073e8a8c04f31cd/81c8e/windows.png\" srcset=\"/static/854d4c8e0a7a976f6073e8a8c04f31cd/81c8e/windows.png 230w\" sizes=\"(max-width: 230px) 100vw, 230px\" style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\" loading=\"lazy\">\n    </span><br></p>\n<p>After activating the virtual environment, you can see your name on the virtual environment on the terminal's left side. It confirms the activation of your virtual environment and is currently active. </p>\n<p><span class=\"gatsby-resp-image-wrapper\" style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 385px; \">\n      <span class=\"gatsby-resp-image-background-image\" style=\"padding-bottom: 7.2727272727272725%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAABCAYAAADeko4lAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAT0lEQVQI1x3IQQqAIBQA0S4TKu2KSisKxIyv1qr7X2WSVm+YRkQoJXOGiN173NNixeCKwt0Km/Tfk+/q18zRsOTqutJvieF4qsLoX8KV+ABY6iJCz00hnQAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"></span>\n  <img class=\"gatsby-resp-image-image\" alt=\"Activated\" title=\"Activated\" src=\"/static/09e527bc0e7a499269e4c7d7c6dcb030/409e6/activated.png\" srcset=\"/static/09e527bc0e7a499269e4c7d7c6dcb030/409e6/activated.png 385w\" sizes=\"(max-width: 385px) 100vw, 385px\" style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\" loading=\"lazy\">\n    </span><br></p>\n<p>Finally, you successfully created and activated your virtual environment. Now, you can install the dependencies and requirements your project asks for without interfering with other projects.</p>\n<p>Once you completed your work, then you can return to the system default environment by just using the <strong>deactivate</strong> command as shown below:</p>\n<span class=\"gatsby-resp-image-wrapper\" style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 123px; \">\n      <span class=\"gatsby-resp-image-background-image\" style=\"padding-bottom: 21.13821138211382%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA1UlEQVQY001QywqDQAz0h6qur4OiLujBCmqRiigq6kWQPg76BaX0t6dNaKGHIcnMJpOsImWIPC+gqip0XUcQBHBdF0II2LbNnOM4kFLC931EUQTLslgnnvI4jrk2TRPKebjg9XzgcFARhiH2fce2bej7HtM0YVmWj2GOtm1RVRWKokDTNBjHkSPplNd1jXVdoUTHE+6362cTAc/zMAwDuq7j5nmeuSnLMt4iTVPmyaAsSzahQUmSME+1YpkGhGHA+ELTND7/Fwl0DmkUCfQNpP/e/Pe9AdslkRuE0PJOAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"></span>\n  <img class=\"gatsby-resp-image-image\" alt=\"Deactivate\" title=\"Deactivate\" src=\"/static/7b1f3953b29c3d15d6fe5cd668f5024d/439d7/deactivate.png\" srcset=\"/static/7b1f3953b29c3d15d6fe5cd668f5024d/439d7/deactivate.png 123w\" sizes=\"(max-width: 123px) 100vw, 123px\" style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\" loading=\"lazy\">\n    </span>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"October 16, 2020","updated_date":null,"description":"We'll cover the basics of virtual environments in this guide and how to use them. We will then take a closer look at how virtual environments actually work.","title":"Python Virtual Environment: What is it and how it works?","tags":["Python"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":2.127659574468085,"src":"/static/a922fe6c69816a3fd3c995d0f175a96c/14b42/python.jpg","srcSet":"/static/a922fe6c69816a3fd3c995d0f175a96c/f836f/python.jpg 200w,\n/static/a922fe6c69816a3fd3c995d0f175a96c/2244e/python.jpg 400w,\n/static/a922fe6c69816a3fd3c995d0f175a96c/14b42/python.jpg 800w,\n/static/a922fe6c69816a3fd3c995d0f175a96c/35d76/python.jpg 1171w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Ashish Maharjan","github":"AshishMhrzn10","avatar":null}}}}]},"markdownRemark":{"excerpt":"Google has prepared a roadmap to restrict third-party cookies in Chrome. Since 04 January 2024, Chrome has rolled out third-party cookie…","fields":{"slug":"/engineering/identity-impact-of-google-chrome-thirdparty-cookie-restrictions/"},"html":"<p>Google has prepared a roadmap to restrict third-party cookies in Chrome. Since 04 January 2024, Chrome has rolled out third-party cookie restrictions for 1% of stable clients and 20% of Canary, Dev, and Beta clients.</p>\n<p><strong>What does it mean for user authentication?</strong></p>\n<p>On one hand, Google believes third-party cookies are widely used for cross-site tracking, greatly affecting user privacy. Hence, Google wants to phase out (or restrict) supporting third-party cookies in Chrome by early Q2 2025 (subject to regulatory processes).</p>\n<p>On the other hand, Google introduced Privacy Sandbox to support the use cases (other than cross-site tracking and advertising) previously implemented using third-party cookies.</p>\n<p>In this article, we’ll discuss:</p>\n<ul>\n<li>How is user authentication (identity) affected?</li>\n<li>What is Google offering as part of Privacy Sandbox to support various identity use cases when third-party cookies are phased out?</li>\n</ul>\n<h2 id=\"how-is-user-authentication-affected\" style=\"position:relative;\"><a href=\"#how-is-user-authentication-affected\" aria-label=\"how is user authentication affected permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How is User Authentication Affected?</h2>\n<p>Third-party cookie restrictions affect user authentication in three ways, as follows.</p>\n<h3 id=\"external-identity-providers\" style=\"position:relative;\"><a href=\"#external-identity-providers\" aria-label=\"external identity providers permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>External Identity Providers</h3>\n<p>If your website or app uses an external Identity Provider (IdP) — like LoginRadius, the IdP sets a third-party cookie when the user authenticates on your app.</p>\n<h3 id=\"web-sso\" style=\"position:relative;\"><a href=\"#web-sso\" aria-label=\"web sso permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Web SSO</h3>\n<p>If you have multiple apps across domains within your organization and authentication is handled using an IdP (internal or external) with web SSO, you already use third-party cookies to facilitate seamless access for each user using a single set of credentials.</p>\n<p>If you have implemented web SSO with one primary domain and multiple sub-domains of the primary domain, third-party cookie restrictions may not apply. For now, Google doesn’t consider the cookies set by sub-domains as third-party cookies, although this stance may change in the future.</p>\n<p>For example, you have apps at <code>example.com</code>, <code>travel.example.com</code>, <code>stay.example.com</code>, and web SSO is handled by <code>auth.example.com</code>. In this case, third-party cookie restrictions don’t apply.</p>\n<h3 id=\"federated-sso\" style=\"position:relative;\"><a href=\"#federated-sso\" aria-label=\"federated sso permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Federated SSO</h3>\n<p>Federated SSO is similar to, albeit different from, web SSO. It can handle multiple IdPs and applications—aka., Service Providers (SPs)—spanning multiple organizations. It can also implement authentication scenarios that are usually implemented through web SSO.</p>\n<p>Usually, authentication is handled on a separate pop-up or page when the user wants to authenticate rather than on the application or website a user visits. </p>\n<p>For example, you already use federated SSO if you facilitate authentication for a set of apps through multiple social identity providers as well as traditional usernames and passwords.</p>\n<blockquote>\n<p><strong>Note</strong>: It is also possible to store tokens locally, not within cookies. In this case, third-party cookie restrictions won’t affect token-based authentication. However, the restrictions still affect authentication where tokens are stored within third-party cookies (a common and secure method).</p>\n</blockquote>\n<h2 id=\"chromes-alternatives-for-third-party-cookies\" style=\"position:relative;\"><a href=\"#chromes-alternatives-for-third-party-cookies\" aria-label=\"chromes alternatives for third party cookies permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Chrome’s Alternatives for Third-Party Cookies</h2>\n<p>Google has been developing alternative features and capabilities for Chrome to replace third-party cookies as part of its Privacy Sandbox for Web initiative.</p>\n<p>Specific to authentication, Google recommends the following:</p>\n<ol>\n<li>Cookies Having Independent Partitioned State (CHIPS)</li>\n<li>Storage Access API</li>\n<li>Related Website Sets</li>\n<li>Federated Credential Management (FedCM) API</li>\n</ol>\n<h3 id=\"cookies-having-independent-partitioned-state-chips\" style=\"position:relative;\"><a href=\"#cookies-having-independent-partitioned-state-chips\" aria-label=\"cookies having independent partitioned state chips permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Cookies Having Independent Partitioned State (CHIPS)</h3>\n<p><a href=\"https://developers.google.com/privacy-sandbox/3pcd/chips\">CHIPS</a> are a restricted way of setting third-party cookies on a top-level site without making them accessible on other top-level sites. Thus, they limit cross-site tracking and enable specific cross-site functionalities, such as maps, chat, and payment embeds.</p>\n<p>For example, a user visits <code>a.com</code> with a map embed from <code>map-example.com</code>, which can set a partitioned cookie that is only accessible on a.com. </p>\n<p>If the user visits <code>b.com</code> with a map embed from <code>map-example.com</code>, it cannot access the partitioned cookie set on <code>a.com</code>. It has to create a separate partitioned cookie specific to <code>b.com</code>, thus blocking cross-site tracking yet allowing limited cross-site functionality.</p>\n<p>You should specifically opt for partitioned cookies (CHIPS), which are set with partitioned and secure cookie attributes.</p>\n<p>If you’re using an external identity provider for your application, CHIPS is a good option to supplant third-party cookie restrictions. </p>\n<p>However, CHIPS may not be ideal if you have a web SSO or federated SSO implementation. It creates separate partitioned cookies for each application with a separate domain, which can increase complexity and create compatibility issues.</p>\n<h3 id=\"storage-access-api\" style=\"position:relative;\"><a href=\"#storage-access-api\" aria-label=\"storage access api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Storage Access API</h3>\n<p>With <a href=\"https://developers.google.com/privacy-sandbox/3pcd/storage-access-api\">Storage Access API</a>, you can access the local storage in a third-party context through iframes, similar to when users visit it as a top-level site in a first-party context. That is, it gives access to unpartitioned cookies and storage.</p>\n<p>Storage Access API requires explicit user approval to grant access, similar to locations, camera, and microphone permissions. If the user denies access, unpartitioned cookies and storage won’t be accessible in a third-party context.</p>\n<p>It is most suitable when loading cross-site resources and interactions, such as:</p>\n<p>Verifying user sessions when allowing interactions on an embedded social post or providing personalization for an embedded video.\nEmbedded documents requiring user verification status to be accessible.</p>\n<p>As it requires explicit user approval, it is advisable to use Storage Access API when you can’t implement an identity use case with the other options.</p>\n<h3 id=\"related-website-sets\" style=\"position:relative;\"><a href=\"#related-website-sets\" aria-label=\"related website sets permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Related Website Sets</h3>\n<p>With <a href=\"https://developers.google.com/privacy-sandbox/3pcd/related-website-sets\">Related Website Sets</a>, you can declare a <code>primary</code> website and <code>associatedSites</code> for limited purposes to grant third-party cookie access and local storage for a limited number of sites.</p>\n<p>Chrome automatically recognizes related website sets declared, accepted, and maintained in this open-source GitHub repository: <a href=\"https://github.com/GoogleChrome/related-website-sets\">Related Website Sets</a></p>\n<p>It provides access through Storage Access API directly without prompting for user approval, but only after the user interacts with the relevant iframe.</p>\n<p>It is important to declare a limited number of domains in related website sets that are meaningful and used for specific purposes. Google may block or suspend any exploitative use of this feature.</p>\n<p>The top-level site can also request approval for specific cross-site resources and scripts to Storage Access API using <code>resuestStorageAccessFor()</code> API.</p>\n<p>If you’re using an external identity provider for your web application, you can declare the domain of the identity provider in the related set to ensure limited third-party cookies and storage access to the identity provider, thus ensuring seamless user authentication.</p>\n<p>Related Website Sets can also work to supplement third-party cookie restrictions in web SSO and federated SSO if the number of web applications (or domains) is limited.</p>\n<h3 id=\"federated-credential-management-fedcm-api\" style=\"position:relative;\"><a href=\"#federated-credential-management-fedcm-api\" aria-label=\"federated credential management fedcm api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Federated Credential Management (FedCM) API</h3>\n<p>FedCM API enables federated SSO without third-party cookies.</p>\n<p>With FedCM API, a user follows these steps for authentication:</p>\n<ol>\n<li>The User navigates to a Service Provider (SP) — aka., Relying Party (RP)</li>\n<li>As the user requests to authenticate, the SP requests the browser through FedCM API to initiate authentication.</li>\n<li>The browser displays a list of available identity providers (supported by the RP), such as social IdPs like Google, Apple, LinkedIn, and Facebook, or other OAuth IdPs like LoginRadius.</li>\n<li>Once the user selects an IdP, the browser communicates with the IdP. Upon valid authentication, the IdP generates a secure token.\nThe browser delivers this secure token to the RP to facilitate user authorization.</li>\n</ol>\n<p>You can access a user demo of FedCM here: <a href=\"https://fedcm-rp-demo.glitch.me/\">FedCM</a>. </p>\n<p>For more information about implementing federated SSO with FedCM API, go through the <a href=\"https://developers.google.com/privacy-sandbox/3pcd/fedcm-developer-guide\">FedCM developer guide</a>.</p>\n<h2 id=\"how-is-loginradius-preparing-for-the-third-party-cookie-phase-out\" style=\"position:relative;\"><a href=\"#how-is-loginradius-preparing-for-the-third-party-cookie-phase-out\" aria-label=\"how is loginradius preparing for the third party cookie phase out permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How is LoginRadius Preparing for the Third-party Cookie Phase-out?</h2>\n<p>Firstly, we’re committed to solving our customers' user identity pain points — and preparing for the third-party cookies phase-out is no different.</p>\n<p>We’ll implement the most relevant and widely useful solutions to facilitate a smooth transition for our customers.</p>\n<p>Please subscribe to our blog for more information. We’ll update you on how we help with the third-party cookie phase-out.</p>\n<h2 id=\"in-conclusion\" style=\"position:relative;\"><a href=\"#in-conclusion\" aria-label=\"in conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>In Conclusion</h2>\n<p>The proposed changes to phase out third-party cookies and suggested alternatives are evolving as Google has been actively collaborating and discussing changes with the border community.</p>\n<p>Moreover, browsers like Firefox, Safari, and Edge may approach restricting third-party cookies differently than Google does.</p>\n<p>From LoginRadius, we’ll keep you updated on what we’re doing as a leading Customer Identity and Access Management (CIAM) vendor to prepare for the third-party cookie phase-out.</p>\n<h2 id=\"glossary\" style=\"position:relative;\"><a href=\"#glossary\" aria-label=\"glossary permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Glossary</h2>\n<p><strong>Top-level site</strong>: It is the primary site a user has visited.</p>\n<p><strong>First-party cookie</strong>: A cookie set by the top-level site.</p>\n<p><strong>Third-party cookie</strong>: A cookie set by a domain other than the top-level site. For example, let’s assume that a user has visited <code>a.com</code>, which might use an embed from <code>loginradius.com</code> to facilitate authentication. If <code>loginradius.com</code> sets a cookie when the user visits <code>a.com</code>, it is called a third-party cookie as the user hasn’t directly visited <code>loginradius.com</code>.</p>\n<h2 id=\"references\" style=\"position:relative;\"><a href=\"#references\" aria-label=\"references permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>References</h2>\n<ul>\n<li><a href=\"https://developers.google.com/privacy-sandbox/3pcd/prepare/prepare-for-phaseout\">Changes to Chrome's treatment of third-party cookies</a></li>\n<li><a href=\"https://developers.google.com/privacy-sandbox/3pcd/guides/identity\">Check the impact of the third-party cookie changes on your sign-in workflows</a></li>\n</ul>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"July 08, 2024","updated_date":null,"description":"Google Chrome has planned to phase out third-party cookies, which will affect different website functionalities depending on third-party cookies. This blog focuses on how this phase-out affects identity and user authentication and discusses alternatives for overcoming challenges.","title":"How Chrome’s Third-Party Cookie Restrictions Affect User Authentication?","tags":["Identity","Cookies","Chrome"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/eb7396060c0adc430dbed2d04b63d431/ee604/third-party-cookies-phaseout-chrome.png","srcSet":"/static/eb7396060c0adc430dbed2d04b63d431/69585/third-party-cookies-phaseout-chrome.png 200w,\n/static/eb7396060c0adc430dbed2d04b63d431/497c6/third-party-cookies-phaseout-chrome.png 400w,\n/static/eb7396060c0adc430dbed2d04b63d431/ee604/third-party-cookies-phaseout-chrome.png 800w,\n/static/eb7396060c0adc430dbed2d04b63d431/f3583/third-party-cookies-phaseout-chrome.png 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Raghunath Reddy","github":"raghunath-r-a","avatar":null}}}},"pageContext":{"limit":6,"skip":132,"currentPage":23,"type":"//engineering//","numPages":52,"pinned":"17fa0d7b-34c8-51c4-b047-df5e2bbaeedb"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}