<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Zairig Imad</title>
    <description>The latest articles on DEV Community by Zairig Imad (@zairigimad).</description>
    <link>https://dev.to/zairigimad</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F38852%2F8c11f53c-0c59-497a-8162-d9aa6c147ba4.jpeg</url>
      <title>DEV Community: Zairig Imad</title>
      <link>https://dev.to/zairigimad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zairigimad"/>
    <language>en</language>
    <item>
      <title>Mercure (Simple Real-Time Updates)</title>
      <dc:creator>Zairig Imad</dc:creator>
      <pubDate>Sun, 31 Mar 2019 23:06:41 +0000</pubDate>
      <link>https://dev.to/zairigimad/mercure-simple-real-time-updates-mmo</link>
      <guid>https://dev.to/zairigimad/mercure-simple-real-time-updates-mmo</guid>
      <description>&lt;p&gt;In the past few weeks, I discovered &lt;a href="https://github.com/dunglas/mercure" rel="noopener noreferrer"&gt;Mercure&lt;/a&gt;, the first time I tested it for a POC and realized that this is the beginning of a new era in real-time application development.&lt;/p&gt;

&lt;p&gt;I just attended Symfony Live Paris and Kévin Dunglas the creator of Mercure made a very interesting Talk about Mercure and API-Platform, I told myself it will be cool to share the tool with dev.to family, especially that Mercure is officially supported by Symfony &lt;a href="https://symfony.com/doc/current/components/mercure.html" rel="noopener noreferrer"&gt;Mercure Component&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Mercure?
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;is a protocol allowing to push data updates to web browsers and other HTTP clients in a convenient, fast, reliable and battery-efficient way. It is especially useful to publish real-time updates of resources served through web APIs, to a reactive web and mobile apps.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fdunglas%2Fmercure%2Fraw%2Fmaster%2Fspec%2Fsubscriptions.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fdunglas%2Fmercure%2Fraw%2Fmaster%2Fspec%2Fsubscriptions.png" alt="Mercure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What's the Difference Between Mercure and WebSocket?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API" rel="noopener noreferrer"&gt;WebSocket&lt;/a&gt;  is a low-level protocol, Mercure is a high level one. Mercure provides convenient built-in features such as authorization, re-connection, and state reconciliation; while with WebSocket, you need to implement them yourself. Also, unlike Mercure (which is built on top of HTTP and Server-Sent Events), WebSocket  &lt;a href="https://www.infoq.com/articles/websocket-and-http2-coexist" rel="noopener noreferrer"&gt;is not designed to leverage HTTP/2&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;HTTP/2 connections are multiplexed and bidirectional by default (it was not the case of HTTP/1). When using Mercure over a h2 connection (recommended), your app can receive data through Server-Sent Events, and send data to the server with regular  &lt;code&gt;POST&lt;/code&gt;  (or  &lt;code&gt;PUT&lt;/code&gt;/&lt;code&gt;PATCH&lt;/code&gt;/&lt;code&gt;DELETE&lt;/code&gt;) requests, with no overhead.&lt;/p&gt;

&lt;p&gt;Basically, in most cases Mercure can be used as a modern and easier to use replacement for WebSocket&lt;/p&gt;

&lt;h3&gt;
  
  
  What's the Difference Between Mercure and WebSub?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.w3.org/TR/websub/" rel="noopener noreferrer"&gt;WebSub&lt;/a&gt;  is a server-to-server only protocol, while Mercure is also a server-to-client and client-to-client protocol.&lt;/p&gt;

&lt;p&gt;Mercure has been heavily inspired by WebSub, and we tried to make the protocol as close as possible from the WebSub one.&lt;/p&gt;

&lt;p&gt;Mercure uses Server-Sent Events to dispatch the updates, while WebSub uses &lt;code&gt;POST&lt;/code&gt;  requests. Also, Mercure has an advanced authorization mechanism and allows to subscribe to several topics with only one connection using URI templates.&lt;/p&gt;

&lt;p&gt;I invite you to try the &lt;a href="https://demo.mercure.rocks/" rel="noopener noreferrer"&gt;Demo&lt;/a&gt; Application and the Full Documentation in The Github Repository&lt;br&gt;
&lt;a href="https://github.com/dunglas/mercure" rel="noopener noreferrer"&gt;https://github.com/dunglas/mercure&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sockets</category>
      <category>php</category>
      <category>symfony</category>
      <category>go</category>
    </item>
    <item>
      <title>What are some great practice algorithms Books, from easy to hard (for web developers)? </title>
      <dc:creator>Zairig Imad</dc:creator>
      <pubDate>Wed, 21 Feb 2018 10:51:45 +0000</pubDate>
      <link>https://dev.to/zairigimad/what-are-some-great-practice-algorithms-books-from-easy-to-hard-for-web-developers--406o</link>
      <guid>https://dev.to/zairigimad/what-are-some-great-practice-algorithms-books-from-easy-to-hard-for-web-developers--406o</guid>
      <description></description>
      <category>discuss</category>
    </item>
    <item>
      <title>Explain AWS Like I'm Five</title>
      <dc:creator>Zairig Imad</dc:creator>
      <pubDate>Thu, 08 Feb 2018 15:56:02 +0000</pubDate>
      <link>https://dev.to/zairigimad/explain-aws-like-im-five--17o9</link>
      <guid>https://dev.to/zairigimad/explain-aws-like-im-five--17o9</guid>
      <description></description>
      <category>aws</category>
      <category>explainlikeimfive</category>
    </item>
  </channel>
</rss>
