<?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: Ali Raza</title>
    <description>The latest articles on DEV Community by Ali Raza (@nowaliraza).</description>
    <link>https://dev.to/nowaliraza</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%2F768738%2F16a3f059-8622-48b9-a9ed-55e9061edfd6.png</url>
      <title>DEV Community: Ali Raza</title>
      <link>https://dev.to/nowaliraza</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nowaliraza"/>
    <language>en</language>
    <item>
      <title>I used Netflix subscription to understand their frontend system &amp; API design.</title>
      <dc:creator>Ali Raza</dc:creator>
      <pubDate>Sun, 08 Jun 2025 18:12:20 +0000</pubDate>
      <link>https://dev.to/nowaliraza/i-used-netflix-subscription-to-understand-their-frontend-system-api-design-40j1</link>
      <guid>https://dev.to/nowaliraza/i-used-netflix-subscription-to-understand-their-frontend-system-api-design-40j1</guid>
      <description>&lt;p&gt;This was originally posted at &lt;a href="https://solutionsarchitect.substack.com/p/i-used-netflix-subscription-to-understand" rel="noopener noreferrer"&gt;my blog.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgiqljlkk6e3roh88dtao.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgiqljlkk6e3roh88dtao.png" alt="Title Image" width="600" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you browse Netflix, you will notice that it provides a seamless and faster experience.&lt;/p&gt;

&lt;p&gt;The homepage loads swiftly; movie suggestions appear almost instantly. Clicking on a title brings up the details without delay, and playback begins in a second.&lt;/p&gt;

&lt;p&gt;All these things work because the Netflix team carefully planned the frontend system, API schema, image compression and formats, and structure.&lt;/p&gt;

&lt;p&gt;We will discuss these practices and system design, taking notes on implementing them in other applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  API
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GraphQL&lt;/strong&gt;&lt;br&gt;
Netflix uses GraphQL APIs to fetch data from servers. The structure for each API is well defined.&lt;/p&gt;

&lt;p&gt;There are APIs such as&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Movie listing API&lt;/li&gt;
&lt;li&gt;Movie details API&lt;/li&gt;
&lt;li&gt;Token APIs&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The APIs’ latency is within the milliseconds range and likely loads from the cache.&lt;/p&gt;

&lt;p&gt;It demonstrates the scale of system design, the load those servers have, and how they deliver quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Netflix Frontend System Design: Strategies and learnings
&lt;/h2&gt;

&lt;p&gt;This section will examine how Netflix built its frontend system to provide an excellent experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pre-fetching&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In pre-fetching data is downloaded/fetched before the user performs an action or reaches that portion.&lt;/p&gt;

&lt;p&gt;The Netflix frontend mostly prefetches data. It doesn't always wait for user actions to fetch the required data. Instead, it anticipates and performs in the background.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Initial Page Load&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When the user reaches the profiles section, the website fetches data for the initial section of the homepage. The data usually includes&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Thumbnail URLs&lt;/li&gt;
&lt;li&gt;Title and relevant info&lt;/li&gt;
&lt;li&gt;categories, etc.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, when you visit your profile section, the Netflix website has required data available to show to the user when they visit the next homepage of their profile.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1pbj1xd8j10rngtpyxa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1pbj1xd8j10rngtpyxa.png" alt="initial page load" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hovering over a title&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As mentioned earlier, Netflix prefetches some data required for the initial view but loads additional data per the user's action.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fezjj4esb7p0c16n7lsif.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fezjj4esb7p0c16n7lsif.png" alt="hovering over a title" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, when you hover over an image, it will&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download a quick view video of the title&lt;/li&gt;
&lt;li&gt;Download extra information for the hover box and details modal&lt;/li&gt;
&lt;li&gt;Fetch th
e suggested movies’ IDs&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first two actions provide data for the hovered view, and if the user clicks on the modal, it will show the details for that movie/series.&lt;/p&gt;

&lt;p&gt;However, it only fetched the movie IDs of the suggested one, and fetched relevant info only when the user opened the details of the movie.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is a better choice because the user opening the details modal is optional, and the movie detail API's bandwidth and latency are reduced.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb40fxfllzafi1uswj3sl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb40fxfllzafi1uswj3sl.png" alt="opening a movie details box" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the details model is opened, as shown in the image above, it will load the movie trailer or image and related info, and download data for suggested titles as per the movie IDs fetched in the previous steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learning&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Design UI/UX and APIs to show minimum details first if there are too many items on the listing&lt;/p&gt;

&lt;p&gt;If the user hovers over or loads an item, load the additional data.&lt;/p&gt;

&lt;p&gt;For further peripheral items, such as suggested listings, fetch data on demand only.&lt;/p&gt;

&lt;p&gt;The API's latency should be double-digit milliseconds at max to load and show content quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lazy loading
&lt;/h2&gt;

&lt;p&gt;The Netflix app doesn't load all sections at once.&lt;/p&gt;

&lt;p&gt;Instead, when a user scrolls down, different titles against each category are shown as per the categories set by the system based on the user's history or preference.&lt;/p&gt;

&lt;p&gt;As expected, the data for the next categories is fetched as the user scrolls down, and roughly the next 5-6 category sections are already preloaded with that data.&lt;/p&gt;

&lt;p&gt;Here, Netflix provides a seamless UX and demonstrates effective API and data management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learning&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Loading all data simultaneously might slow the rendering and impact the experience.&lt;/li&gt;
&lt;li&gt;So, always fetch and show relevant data only on the frontend and load more as the user scrolls.&lt;/li&gt;
&lt;li&gt;The APIs should be designed to return data in chunks faster.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Images
&lt;/h2&gt;

&lt;p&gt;The images are heavily compressed as per the place.&lt;/p&gt;

&lt;p&gt;For thumbnails, the average size is 20-30 KB.&lt;/p&gt;

&lt;p&gt;The images shown during the sneak peek are almost 0 bits due to the blob structure being used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8sdmxrl2fk0xrgrij745.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8sdmxrl2fk0xrgrij745.png" alt="blob images" width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The reasons are quite logical.&lt;/p&gt;

&lt;p&gt;The thumbnail size is small, around 300 by 160, and mostly the title and a picture of the user's preference are shown.&lt;/p&gt;

&lt;p&gt;Here, showing high-quality images comprising hundreds of KBs doesn't make sense.&lt;/p&gt;

&lt;p&gt;It will slow down the loading because hundreds of titles are shown simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learning&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If you have an e-commerce store or some app where images are shown,&lt;/li&gt;
&lt;li&gt;Compress and create images as per different view sizes&lt;/li&gt;
&lt;li&gt;Always load minimal-size photos for the first view, such as on product listing pages.&lt;/li&gt;
&lt;li&gt;If the user hovers and the size of the viewport changes, only then will a higher quality image be loaded.&lt;/li&gt;
&lt;li&gt;By doing this, you will&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Load the website faster
&lt;/li&gt;
&lt;li&gt;Provide a better experience
&lt;/li&gt;
&lt;li&gt;Save the customer's internet data&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I hope you have learnt how to build performant frontend systems at scale to serve millions of users and maintain consistency.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Node.js is not single-threaded</title>
      <dc:creator>Ali Raza</dc:creator>
      <pubDate>Fri, 31 May 2024 22:32:49 +0000</pubDate>
      <link>https://dev.to/nowaliraza/nodejs-is-not-single-threaded-2i1l</link>
      <guid>https://dev.to/nowaliraza/nodejs-is-not-single-threaded-2i1l</guid>
      <description>&lt;p&gt;Node.js itself is not single-threaded.&lt;/p&gt;

&lt;p&gt;Node.js developers often confuse the main single-threaded event loop with Node.js entirely.&lt;/p&gt;

&lt;p&gt;When a Node.js app is running, it automatically creates 4 threads under the worker pool for blocking tasks.&lt;/p&gt;

&lt;p&gt;So at any given time, there are at least five threads.&lt;/p&gt;

&lt;p&gt;This worker pool is managed by Libuv.&lt;/p&gt;

&lt;p&gt;The blocking tasks are mainly I/O-bound and CPU-intensive.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;I/O bound&lt;br&gt;
a. DNS: dns.lookup(), dns.lookupService()&lt;br&gt;
b. File system except fs.FSWatcher()&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CPU-intensive tasks&lt;br&gt;
a. Some crypto methods such as crypto.pbkdf2(), crypto.scrypt(), crypto.randomBytes(), crypto.randomFill(), crypto.generateKeyPair()&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;b. All zlib APIs other than those using libuv thread pool synchronously.&lt;/p&gt;

&lt;p&gt;The main thread/event loop works for JavaScript execution as usual, but the worker pool takes care of blocking tasks for the main loop.&lt;/p&gt;

&lt;p&gt;So, Node.js shouldn't be confused.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

&lt;p&gt;I do a deep dive into foundational concepts &amp;amp; how things work under the hood. You can consider connecting with or following me, Ali Raza, here and on &lt;a href="https://www.linkedin.com/in/thealiraza/"&gt;LinkedIn&lt;/a&gt; to get along with the journey.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6q1hgko27x88u7jiaxsb.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6q1hgko27x88u7jiaxsb.gif" alt="Image description" width="720" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>backend</category>
      <category>programming</category>
    </item>
    <item>
      <title>Node.js itself is not single-threaded.</title>
      <dc:creator>Ali Raza</dc:creator>
      <pubDate>Thu, 18 Apr 2024 19:09:59 +0000</pubDate>
      <link>https://dev.to/nowaliraza/nodejs-itself-is-not-single-threaded-5aib</link>
      <guid>https://dev.to/nowaliraza/nodejs-itself-is-not-single-threaded-5aib</guid>
      <description>&lt;p&gt;Node.js itself is not single-threaded.&lt;/p&gt;

&lt;p&gt;Node.js developers often confuse the main single-threaded event loop with Node.js entirely.&lt;/p&gt;

&lt;p&gt;When a Node.js app is running, it automatically creates 4 threads under the worker pool for blocking tasks.&lt;/p&gt;

&lt;p&gt;So at any given time, there are at least five threads.&lt;/p&gt;

&lt;p&gt;This worker pool is managed by Libuv.&lt;/p&gt;

&lt;p&gt;The blocking tasks are mainly I/O-bound and CPU-intensive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. I/O bound&lt;/strong&gt;&lt;br&gt;
a. DNS: dns.lookup(), dns.lookupService()&lt;br&gt;
b. File system except fs.FSWatcher()&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. CPU-intensive tasks&lt;/strong&gt;&lt;br&gt;
a. Some crypto methods such as crypto.pbkdf2(), crypto.scrypt(), crypto.randomBytes(), crypto.randomFill(), crypto.generateKeyPair()&lt;/p&gt;

&lt;p&gt;b. All zlib APIs other than those using libuv thread pool synchronously.&lt;/p&gt;

&lt;p&gt;The main thread/event loop works for JavaScript execution as usual, but the worker pool takes care of blocking tasks for the main loop.&lt;/p&gt;

&lt;p&gt;So, Node.js shouldn't be confused.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

&lt;p&gt;I do a deep dive into foundational concepts &amp;amp; how things work under the hood. You can consider connecting with or following me, Ali Raza, here and on &lt;a href="https://www.linkedin.com/in/thealiraza"&gt;LinkedIn&lt;/a&gt; to get along with the journey.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg9vxk0mhis7bwscpuzxk.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg9vxk0mhis7bwscpuzxk.gif" alt="Image description" width="720" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>backend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Never limit your tech stack</title>
      <dc:creator>Ali Raza</dc:creator>
      <pubDate>Sun, 24 Sep 2023 13:51:03 +0000</pubDate>
      <link>https://dev.to/nowaliraza/never-limit-your-tech-stack-3bp2</link>
      <guid>https://dev.to/nowaliraza/never-limit-your-tech-stack-3bp2</guid>
      <description>&lt;p&gt;To grow by leaps and bounds, you shouldn't limit yourself to a specific tech stack.&lt;/p&gt;

&lt;p&gt;You need to choose one skill, master it, secure your job around it, and then start learning all relevant fields gradually.&lt;/p&gt;

&lt;p&gt;Let's say you are currently working as a JavaScript developer, mainly on frontend projects, in your daily job. In your free time, you should be learning Node.js and building backend projects, and if your project needs a backend engineer, you can fill this role.&lt;/p&gt;

&lt;p&gt;Similarly, if you have backend engineering experience, you can learn about data stacks, ML, and DevOps.&lt;/p&gt;

&lt;p&gt;As you gradually start mastering hard tech skills along with soft ones, it will be easier for you to reach higher positions such as CTO, VP of Engineering, etc. because you will be a person who can get things done in any stack.&lt;/p&gt;

&lt;p&gt;The people in higher tech positions are generalists rather than specialists in just one tech stack.&lt;/p&gt;

&lt;p&gt;On the other hand, there are benefits to being a specialist in just one field, but those can't outperform the other one. It's often a personal choice and can offer amazing opportunities such as offering consultancies.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

&lt;p&gt;If you want to excel in your career and learn building scalable apps and architectures, you can subscribe to my newsletter at &lt;a href="https://lnkd.in/d7Du5QmS"&gt;https://lnkd.in/d7Du5QmS&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>career</category>
      <category>learning</category>
    </item>
    <item>
      <title>Building predictable, reliable, resilient, and retriable APIs with Idempotency</title>
      <dc:creator>Ali Raza</dc:creator>
      <pubDate>Sun, 17 Sep 2023 19:05:48 +0000</pubDate>
      <link>https://dev.to/nowaliraza/building-predictable-reliable-resilient-and-retriable-apis-with-idempotency-5do3</link>
      <guid>https://dev.to/nowaliraza/building-predictable-reliable-resilient-and-retriable-apis-with-idempotency-5do3</guid>
      <description>&lt;p&gt;This post is originally from &lt;a href="https://zerotoarchitect.substack.com/" rel="noopener noreferrer"&gt;Zero To Architect&lt;/a&gt;, a free newsletter available on Substack from Ali Raza, a versatilist software architect who believes that anyone can be a software architect.&lt;/p&gt;

&lt;p&gt;Developers want their APIs to be reliable and resilient.&lt;/p&gt;

&lt;p&gt;But there is an area that is often overlooked: are your APIs predictable and retriable?&lt;/p&gt;

&lt;p&gt;Let’s explore some examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  Customers getting double charged: A classic example
&lt;/h2&gt;

&lt;p&gt;A customer is using your payment APIs, and as soon as the process is initiated, there is a network issue on the customer’s end, and he is unable to receive a response. As soon as the network is back, they click on the pay button again. What should happen now?&lt;/p&gt;

&lt;p&gt;If the payment process is restarted, the customer will be double-charged. Which will dent the credibility of the payment processor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Order and Inventory Management Systems
&lt;/h2&gt;

&lt;p&gt;Similarly, let’s say you have an e-commerce OMS app. The store owners process some orders but, for some reason, again perform the same actions. The system should not reprocess but instead, return the original response.&lt;/p&gt;

&lt;p&gt;These problems can be resolved by introducing idempotency in the APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is idempotency?
&lt;/h2&gt;

&lt;p&gt;Idempotency is a mathematical and computer science concept that refers to the quality of some operations or functions in which performing them several times has the same effect as performing them once.&lt;/p&gt;

&lt;p&gt;An idempotent operation can be repeated an infinite number of times and still provide the same outcome.&lt;/p&gt;

&lt;p&gt;Idempotent APIs enable API users to retry calls in the event of a network outage or other problems without having to worry about producing duplicate rows in a database or charging the client several times.&lt;/p&gt;

&lt;h2&gt;
  
  
  HTTP Methods ensuring idempotency
&lt;/h2&gt;

&lt;p&gt;HTTP methods such as PUT, DELETE, and GET are idempotent in nature.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GET:&lt;/strong&gt; Repeating a GET request will return the same resource representation without changing the resource on the server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HEAD:&lt;/strong&gt; The HEAD method, like GET, obtains metadata about a resource but not the resource itself. It can be used to check for the existence of a resource, get headers, or find the last change date without modifying the resource itself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;PUT:&lt;/strong&gt; If the resource at the specified URL already exists, a PUT request will replace it with the new representation sent in the request body. PUT will build the resource if it does not already exist. PUT is idempotent in the sense that repeating the same PUT request with the same data does not affect the resource in any way other than the initial request.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DELETE:&lt;/strong&gt; When you issue a DELETE request, the server deletes the resource if it exists, and it simply provides a successful answer if it does not. Multiple DELETE operations on the same resource will not have different outcomes beyond the first deletion, making it an idempotent operation.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How can a developer build idempotent APIs?
&lt;/h2&gt;

&lt;p&gt;A developer can add idempotency in various ways.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Idempotency Keys
&lt;/h2&gt;

&lt;p&gt;Idempotency keys are the building blocks of idempotent keys. A key, preferably a UUID, is used to identify a request. Whenever the API is called again with the same key, it will return the original response.&lt;/p&gt;

&lt;p&gt;The keys are either external or internal.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;External Idempotency Keys:&lt;/strong&gt; If the API is integrated into 3rd-party apps, then that system can pass the key to be identified as the idempotency key.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Internal Idempotency Keys:&lt;/strong&gt; If the system generates a key against each request and attaches that on the basis of an ID, then that key will be called an idempotent key.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Saving Idempotency Keys
&lt;/h2&gt;

&lt;p&gt;The idempotency keys are usually short-lived and can be reused with new requests after a specified time.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Redis:&lt;/strong&gt; Redis or other caching solutions can be used to save short-lived idempotency keys.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;TTL indexing:&lt;/strong&gt; Time-to-live indexes are often used to save a value in a database to be deleted later after a given time interval.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  2. Using HTTP Methods
&lt;/h2&gt;

&lt;p&gt;Using HTTP methods such as GET, PUT, and DELETE will ensure that the API resources are by default idempotent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let’s write some code
&lt;/h2&gt;

&lt;p&gt;Here’s an example of how to utilize the Express.js framework to create an idempotent API endpoint in Node.js, including the use of an idempotency key to ensure that repeated requests do not have unintended consequences.&lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4nzq12fqvn53bre0ot8m.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4nzq12fqvn53bre0ot8m.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;For upgrading a user’s email address, we establish an Express.js application and configure a POST request endpoint (/users/:userId/email).&lt;/li&gt;
&lt;li&gt;To uniquely identify each request, we develop and employ an Idempotency-Key header. If you use the same idempotency key in many requests, the server will recognize it as a duplicate and reply accordingly.&lt;/li&gt;
&lt;li&gt;The server determines whether the idempotency key has previously been processed. If it has, the server responds with a response indicating that it has already handled the request.&lt;/li&gt;
&lt;li&gt;To prevent duplicate processing of the same key, processed idempotency keys are placed in a Set.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;It is critical to consider the probability of failure in a distributed system and how to address it while developing APIs that are both resilient and predictable. Retry logic on clients and server idempotency are two strategies that can help achieve this goal and are reasonably easy to implement in any technological stack.&lt;/p&gt;

&lt;p&gt;Here are a few fundamental principles to remember while building clients and APIs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ensure that failures are dealt with consistently. Request that clients retry activities on remote services. Failure to do so may result in inconsistent data, which may cause problems in the future.&lt;/li&gt;
&lt;li&gt;Make certain that failures are handled in a safe manner. Allow clients to pass a unique value and retry requests as needed by using idempotency and idempotency keys.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>backend</category>
      <category>api</category>
      <category>programming</category>
      <category>fullstack</category>
    </item>
    <item>
      <title>Why You Should Learn Web 2.0 Before Getting into Web 3.0</title>
      <dc:creator>Ali Raza</dc:creator>
      <pubDate>Mon, 11 Jul 2022 18:07:31 +0000</pubDate>
      <link>https://dev.to/nowaliraza/why-you-should-learn-web-20-before-getting-into-web-30-2hc4</link>
      <guid>https://dev.to/nowaliraza/why-you-should-learn-web-20-before-getting-into-web-30-2hc4</guid>
      <description>&lt;p&gt;Web 3.0, a new buzzword, has taken the world by storm. From developers to technical cofounders and VCs, all are glorifying it. Startups are recruiting Web 3.0 devs for higher compensation. More developers are entering into next generation of the Web and a great number of those have taken it as their first tech stack. All are over the moon.&lt;/p&gt;

&lt;p&gt;The tech powering Web 3.0 including both Frontend and Backend is built on top of Web 2.0 stuff. Although one can learn Web 3.0 directly, it is important to mention that a solid foundation should be erected in Web 2.0 first.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Web2.0 tech stack is used to build Web 3.0?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Frontend&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;HTML, CSS, JS, React, and Next.js are the main building blocks of the Frontend of NFT marketplaces, Dapps, etc. These technologies belong to the earlier versions and there exists no Web3.0 Frontend excluding them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consuming Blockchain and Smart Contracts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ether.js and Web3.js connect customer-facing UI with smart contracts. Without an iota of JS knowledge, these two are out of the scope.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Building Smart Contracts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Solidity is the defacto programming language to create smart contracts. It’s a statically typed programming language following OOPs concepts. The same is true for Rust, which is also gaining momentum nowadays. Having experience with Java, TypeScript comes in handy here.&lt;/p&gt;

&lt;p&gt;The above discussion illustrates that having a strong knowledge of Web 2.0 tech is a prerequisite for getting into the neo web. If a novice gets into using web3.js without knowing in and out of JS, the person is destined to stick to issues. Similarly, working with Solidity or other stuff to create smart contracts requires OOP and Static typing knowledge.&lt;/p&gt;

&lt;p&gt;Now, the question arises as to how can someone aloof to programming can get into Web3.0. Below, I have shared a viable plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Roadmap for a novice to get into Web 3.0
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Learning the basics of web development&lt;/strong&gt;&lt;br&gt;
Start learning with HTML, CSS, JavaScript, and OOP. Having a strong background in these will enable you to not only create beautiful Frontends but also work with smart contracts.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/gXLjWRteuWI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/g7T23Xzys-A"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Getting hands dirty on Web 3.0 concepts&lt;/strong&gt;&lt;br&gt;
Smart contracts, blockchain, proofs-of-concept, Ethereum, tokens, and other foundational concepts should be mastered as well.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://www.coinbase.com/learn/crypto-basics/what-is-proof-of-work-or-proof-of-stake" rel="noopener noreferrer"&gt;
      coinbase.com
    &lt;/a&gt;
&lt;/div&gt;



&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://ethereum.org/en/developers/docs/smart-contracts/" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--FFlNGm2i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ethereum.org/heroes/developers-hub-hero.jpg" height="500" class="m-0" width="800"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://ethereum.org/en/developers/docs/smart-contracts/" rel="noopener noreferrer" class="c-link"&gt;
          Introduction to smart contracts | ethereum.org
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          An overview of smart contracts, focussing on their unique characteristics and limitations.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://res.cloudinary.com/practicaldev/image/fetch/s--RQvtN4Ec--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ethereum.org/favicon.png" width="281" height="281"&gt;
        ethereum.org
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://ethereum.org/en/developers/docs/dapps/" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--FFlNGm2i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ethereum.org/heroes/developers-hub-hero.jpg" height="500" class="m-0" width="800"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://ethereum.org/en/developers/docs/dapps/" rel="noopener noreferrer" class="c-link"&gt;
          Introduction to dapps | ethereum.org
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Ethereum is a global, decentralized platform for money and new kinds of applications. On Ethereum, you can write code that controls money, and build applications accessible anywhere in the world.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://res.cloudinary.com/practicaldev/image/fetch/s--RQvtN4Ec--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ethereum.org/favicon.png" width="281" height="281"&gt;
        ethereum.org
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;3. Build Frontends of dapps, marketplaces, and more.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React and Next.js are widely used technologies to develop modern and fast frontends. This is a lethal combination here as well. Learning this stack will also help build Web 2.0 web apps.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/mTz0GXj8NN0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Working with web3.js and ether.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;web3.js is a collection of libraries that allow you to interact with a local or remote Ethereum node using HTTP, IPC, or WebSocket. Similarly, the ethers.js library aims to be a complete and compact library for interacting with the Ethereum Blockchain and its ecosystem.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://docs.ethers.org/v5/getting-started/" rel="noopener noreferrer"&gt;
      docs.ethers.org
    &lt;/a&gt;
&lt;/div&gt;



&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://web3js.readthedocs.io/en/v1.7.4/getting-started.html" rel="noopener noreferrer"&gt;
      web3js.readthedocs.io
    &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;5. Building Smart Contracts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Solidity, a high-level and object-oriented programming language inspired by C++, Python, and JavaScript, is widely used to create smart contracts. Having experience with statically typed programming languages is beneficial here.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://docs.soliditylang.org/en/v0.8.15/index.html" rel="noopener noreferrer"&gt;
      docs.soliditylang.org
    &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;6. Be familiar with the ecosystem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Web3.0 developer should have first-hand experience with Remix IDE, Truffle, MetaMask, and the relevant ecosystem.&lt;/p&gt;

&lt;p&gt;To summarise, it can be said that it is pertinent to first learn Web 2.0 and then move into Web 3.0. It will help to have first-hand experience of how web development actually works and what are the differences between these versions of the web.&lt;/p&gt;

&lt;p&gt;Thanks for reading. Follow for more amazing content.&lt;/p&gt;

&lt;p&gt;Let’s connect on &lt;a href="https://www.linkedin.com/in/thealiraza/"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://twitter.com/nowaliraza"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>web3</category>
      <category>programming</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Learn AWS as a Frontend Developer</title>
      <dc:creator>Ali Raza</dc:creator>
      <pubDate>Sat, 25 Dec 2021 13:45:34 +0000</pubDate>
      <link>https://dev.to/nowaliraza/learn-aws-as-a-frontend-developer-2j7c</link>
      <guid>https://dev.to/nowaliraza/learn-aws-as-a-frontend-developer-2j7c</guid>
      <description>&lt;p&gt;Amazon Web Services — AWS, the leading cloud-computing platform, is historically being associated with backend technologies such as DevOps, API development, Databases, etc. This is true, given that AWS and other cloud platforms are mentioned randomly in the jobs for backend developers.&lt;/p&gt;

&lt;p&gt;However, you can learn relevant AWS technologies for your web apps. Most of those are discussed below.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;1. AWS Amplify&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpmyrnrhqhp8349nw8zy2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpmyrnrhqhp8349nw8zy2.png" alt="Source: GitHub.com" width="800" height="113"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AWS Amplify is a set of purpose-built tools and features that enables frontend web and mobile developers to quickly and easily build full-stack applications on AWS. Amplify provides two services: Amplify Hosting and Amplify Studio.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Hosting&lt;/strong&gt;&lt;br&gt;
a. AWS Amplify hosting provides a git-based workflow for hosting full-stack serverless web apps with continuous deployment.&lt;br&gt;
b. Amplify supports the common SPA frameworks, for example, React, Angular, Vue.js, Ionic, and Ember, as well as static site generators like Gatsby.&lt;br&gt;
c. Manage production and staging environments for your frontend and backend by connecting new branches.&lt;br&gt;
d. Set up rewrites and redirects to maintain SEO rankings and route traffic based on your client app requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Amplify Studio&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;a. The Studio is a visual development environment that simplifies the creation of scalable, full-stack web and mobile apps.&lt;br&gt;
b. Set up authentication for your app.&lt;br&gt;
c. Powerful and easy-to-understand authorization.&lt;br&gt;
d. Infrastructure-as-code configures all backend capabilities with AWS CloudFormation.&lt;br&gt;
e. Use Studio’s visual designer to build frontend UI components. Choose from dozens of designs in the pre-built UI component library.&lt;br&gt;
f. Import Figma prototypes built by designers into Studio as React code.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. AWS AppSync
&lt;/h2&gt;

&lt;p&gt;AWS AppSync is a service to create GraphQL based APIs for interaction between multiple data sources such as AWS DynamoDB, AWS Lambda, etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg1ghzvrjezf9ygyro3b6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg1ghzvrjezf9ygyro3b6.png" alt="Source: GitHub.com" width="800" height="240"&gt;&lt;/a&gt;&lt;br&gt;
source: AWS&lt;/p&gt;

&lt;p&gt;Some of its features are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Real-time, collaborative mobile, and web apps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AWS AppSync lets you build collaborative apps with shared data that is updated in real-time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Offline data sync support&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For mobile and web apps, AppSync provides local data access when devices go offline, and data synchronization with &lt;br&gt;
customizable conflict resolution, when they are back online.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Integrating data from multiple sources&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AWS AppSync allows access data in Amazon DynamoDB, triggers AWS Lambda functions, or runs Amazon OpenSearch queries, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Data collision detection and conflict resolution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AWS AppSync can automatically resolve conflicts on data that is shared between multiple users and devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Secure data access&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Amazon AppSync integrates with Amazon Cognito and AWS Identity and Access Management, so you can set fine-grained permissions on GraphQL operations and keep users and app data secure.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Amazon Device Farm
&lt;/h2&gt;

&lt;p&gt;AWS Device Farm provides an extensive range of desktop browsers and mobile devices to test web and mobile applications. It creates videos and logs to help identify issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a. Automated testing in parallel on multiple devices.&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk685u3ykaqtjhr51fj7v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk685u3ykaqtjhr51fj7v.png" alt="Source: GitHub.com" width="800" height="266"&gt;&lt;/a&gt;&lt;br&gt;
Source: AWS&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;b. Test your app on any device directly from your browser.&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7r314oxcns7qvxqft4h9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7r314oxcns7qvxqft4h9.png" alt="Source: GitHub.com" width="800" height="267"&gt;&lt;/a&gt;&lt;br&gt;
Source: AWS&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Amazon Location Service
&lt;/h2&gt;

&lt;p&gt;The location service provides maps, trackers, route calculators, and more services. All queries are anonymous and user data is not passed. Esri and HERE services are used for routes, tracking, and geofencing.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. AWS CodeCommit
&lt;/h2&gt;

&lt;p&gt;You might have been using GitHub, BitBucket, and GitLab for hosting your codebase, however, AWS CodeCommit is also another solution for your scalable private repos. It is highly available, secure, fully managed, and can store anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. AWS X-Ray
&lt;/h2&gt;

&lt;p&gt;AWS X-Ray helps developers analyze and debug production, distributed applications. With X-Ray, you can understand how your application and its underlying services are performing to identify and troubleshoot the root cause of performance issues and errors. X-Ray provides an end-to-end view of requests as they travel through your application, and shows a map of your application’s underlying components. It helps developers with:&lt;/p&gt;

&lt;p&gt;a. Review request behavior&lt;/p&gt;

&lt;p&gt;b. Discover application issues and improve application performance&lt;/p&gt;

&lt;p&gt;c. Designed for a variety of applications&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiiffft606zi141xs1kpd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiiffft606zi141xs1kpd.png" alt="Source: GitHub.com" width="800" height="267"&gt;&lt;/a&gt;&lt;br&gt;
Source: AWS&lt;/p&gt;

&lt;p&gt;The above-mentioned services are more suitable for frontend development and can be a good addition to your skillset.&lt;br&gt;
Let’s connect on &lt;a href="https://www.linkedin.com/in/thealiraza/"&gt;Linkedin&lt;/a&gt;, &lt;a href="https://twitter.com/nowaliraza"&gt;Twitter&lt;/a&gt;&lt;br&gt;
Thank you.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>javascript</category>
      <category>react</category>
      <category>serverless</category>
    </item>
    <item>
      <title>Hydrogen by Shopify | A much-needed framework to build Shopify React e-commerce stores</title>
      <dc:creator>Ali Raza</dc:creator>
      <pubDate>Thu, 09 Dec 2021 22:55:01 +0000</pubDate>
      <link>https://dev.to/nowaliraza/hydrogen-by-shopify-a-much-needed-framework-to-build-shopify-react-e-commerce-stores-4f21</link>
      <guid>https://dev.to/nowaliraza/hydrogen-by-shopify-a-much-needed-framework-to-build-shopify-react-e-commerce-stores-4f21</guid>
      <description>&lt;p&gt;Shopify created turbulence in the tech world by announcing Hydrogen, a React-based framework powered by Shopify’s Storefront API, to create fast, modern, and custom e-commerce storefronts at pace. The framework integrates React Server Components, uses smart caching techniques, is styled using Tailwind CSS, and is bundled using Vite.&lt;/p&gt;

&lt;p&gt;Hydrogen is packed with all the tools and solutions so that developer focuses more on building customized storefronts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hydrogen offers:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Built-in caching controls&lt;/li&gt;
&lt;li&gt;Server-side rendering&lt;/li&gt;
&lt;li&gt;React Server Components&lt;/li&gt;
&lt;li&gt;Shopify-specific commerce components, hooks, and utilities&lt;/li&gt;
&lt;li&gt;flexible page and subrequest cache policies&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As soon as I got my hands dirty, it was apparent that this is not simply another framework but a complete package to not only build the eCommerce stores but address related issues like site speed caching. Its claim to provide a faster developer experience is true to a great extent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Shopify and how online stores are already being developed?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shopify is an eCommerce platform to create an online store by following a few steps. Buy membership, select store theme and domain and you are ready to sell. Liquid, a template language powered by Shopify, is used to create storefronts. Integrating Liquid with React brings limitations, best practices can’t be ensured easily and it was a painful developer experience.&lt;/p&gt;

&lt;p&gt;Learn How to become a React developer in 2022&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Hydrogen brings?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hydrogen provides an amazing developer experience by using the best available libraries and practices. Working with Hydrogen is similar to building another React app. No extra connections with Shopify APIs as this is handled by useShop hook. Efficient caching policies are introduced and managed by React Query. Tailwind CSS styles the storefront. React Server Components are introduced to decrease bundle size. and More. Let's explore more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get started: Install Hydrogen React Starter Template
&lt;/h2&gt;

&lt;p&gt;Install Hydrogen template by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn create hydrogen-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feiiqgcclhlnpt81ad8my.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feiiqgcclhlnpt81ad8my.png" alt="Image description" width="196" height="553"&gt;&lt;/a&gt;&lt;br&gt;
Shopify Hydrogen folder structure&lt;/p&gt;

&lt;p&gt;The folder structure is quite similar to the one used widely.&lt;br&gt;
shopify.config.js file connects the storefront to Shopify Storefront API and comes with demo store credentials. The components with .server.jsx suffix are server components and the ones with .client.jsx are served by React app build.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default {
locale: 'en-us',
storeDomain: 'hydrogen-preview.myshopify.com',
storefrontToken: '3b580e70970c4528da70c98e097c2fa0',
graphqlApiVersion: 'unstable',
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How does Hydrogen work? Let's explore behind the scenes.
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Let's discuss Hydrogen’s architecture.&lt;/em&gt; Hydrogen comes with React 18 alpha version and is powered by the Vite plugin that offers server-side rendering (SSR) and hydration middleware, as well as server and client component code transformations. The SSR and hydration middleware is similar to existing Vite SSR implementations.&lt;/p&gt;

&lt;p&gt;For dynamic routing and navigation within the app, React Router is used.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Custom but specific hooks, such as useShopQuery, are introduced for caching and integration with Shopify.&lt;br&gt;
The useShopQuery hook is designed to be used only in server components. This is because only server components can make calls to the Storefront API. The useQuery hook allows you to execute an asynchronous operation like fetch in a way that supports Suspense. You can use this hook to call any third-party APIs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;GraphQL&lt;/p&gt;

&lt;p&gt;To fetch data dynamically, GraphQL is used.&lt;/p&gt;

&lt;p&gt;How does Hydrogen work? &lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo6fe79apm9qkai7lq4hw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo6fe79apm9qkai7lq4hw.png" alt="Image description" width="800" height="372"&gt;&lt;/a&gt;&lt;br&gt;
source: Hydrogen&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Streaming Server-side Rendering&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SSR fetches the data on the server and returns it in the response at the cost of a slow time-to-first-byte (TTFB) because the server is blocked on the data. Here, Streaming SSR plays an important role. Hydrogen adopts the new React 18 alpha streaming SSR API powered by Suspense that unlocks critical performance benefits with hydration and fast TTFB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;React Server Components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Server Components allow developers to build apps that span the server and client, combining the rich interactivity of client-side apps with the improved performance of traditional server rendering. &lt;a href="https://github.com/josephsavona/rfcs/blob/server-components/text/0000-server-components.md"&gt;RSC&lt;/a&gt;&lt;br&gt;
Server components have no impact on the app’s bundle’s size.&lt;br&gt;
RSCs can be used to fetch data from API and can’t handle state management.&lt;/p&gt;
&lt;h2&gt;
  
  
  Efficient Data Fetching, and Caching
&lt;/h2&gt;

&lt;p&gt;Hydrogen provides two mechanisms for cache within applications:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sub-request caching:&lt;/strong&gt; While rendering a page in your Hydrogen app, it’s common to make one or more sub-requests to Shopify or other third-party data sources within server components. You should use sub-request caching to keep pages loading quickly for end-users. The following example shows how to implement useShopQuery for Shopify Storefront API queries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const {data} = useShopQuery({
  query: QUERY,
  cache: {
    // Cache the data for one second.
    maxAge: 1,
    // Serve stale data for up to nine seconds while getting a fresh response in the background.
    staleWhileRevalidate: 9,
  },
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Full-page caching:&lt;/strong&gt; In addition to sub-request caching, it’s helpful to cache the entire page response at the network edge and in the browser. This is the most useful for pages without dynamic or personalized data, like marketing pages or blog content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default function MyProducts({response}) {
  response.cache({
    // Cache the page for one hour.
    maxAge: 60 * 60,
    // Serve the stale page for up to 23 hours while getting a fresh response in the background.
    staleWhileRevalidate: 23 * 60 * 60,
  });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Hydrogen Components and Hooks: Development apace
&lt;/h2&gt;

&lt;p&gt;Hydrogen contains a set of Shopify-specific commerce components and hooks that help accelerate your development process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Primitive components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Primitive components are the building blocks for different component types, including products, variants, and the cart. Some of the primitive components and hooks are useMoney, ExternalVideo, Image, RawHTML, ShopPayButton, and UnitPrice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Global Components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ShopifyProvider is a global Hydrogen component that wraps your entire app. It is a shared component and renders on both the server and the client. Global hooks comprise useQuery, useShop, useServerState, and useShopQuery.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Product and variant components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Products are what a merchant sells. If a product has options, like size or color, then merchants can add a variant for each combination of options. Examples: ProductDescription, ProductPrice, ProductTitle, SelectedVariantBuyNowButton, etc. Only two hooks were made for this section: useProduct and useProductOptions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Cart components and Localization components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Localization, with the help of LocalizationProvider, can help merchants expand their business to a global audience by creating shopping experiences in local languages and currencies. useAvailableCountries and useCountry bring localized data.&lt;/p&gt;

&lt;p&gt;Hydrogen comes with a lot of cart components and hooks. A few of those are AddToCartButton, BuyNowButton, CartEstimatedCost, useCart, useCartCheckoutUrl, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Utilities&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hydrogen contains a set of utilities that help accelerate your development process.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;isClient: Indicates if the code is executed on the client.&lt;/li&gt;
&lt;li&gt;isServer: Indicates if the code is executed on the server.&lt;/li&gt;
&lt;li&gt;flattenConnection: Transforms a connection object into a flat array.&lt;/li&gt;
&lt;li&gt;parseMetafieldValue: Parses a metafield’s value from a string to a sensible type corresponding to the metafield’s type.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Deploying Hydrogen Storefronts
&lt;/h2&gt;

&lt;p&gt;Shopify has announced Oxygen, a specialized hosting solution for Hydrogen e-commerce stores.&lt;/p&gt;

&lt;h2&gt;
  
  
  Review
&lt;/h2&gt;

&lt;p&gt;Hydrogen is promising. It is aiming to revolutionize the e-commerce experience. But, the impact promised is based upon tech currently released under alpha release or not released at all but only promised. The production-level testing can be done after Oxygen is built and some big e-commerce storefronts are actually built upon it.&lt;/p&gt;

&lt;p&gt;Let’s hope for the best.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

&lt;p&gt;Follow me at LinkedIn: &lt;a href="https://www.linkedin.com/in/thealiraza"&gt;https://www.linkedin.com/in/thealiraza&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>shopify</category>
      <category>framework</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How to become a React developer in 2022? Here is the complete Roadmap.</title>
      <dc:creator>Ali Raza</dc:creator>
      <pubDate>Tue, 07 Dec 2021 21:14:26 +0000</pubDate>
      <link>https://dev.to/nowaliraza/how-to-become-a-react-developer-in-2022-here-is-the-complete-roadmap-4fgc</link>
      <guid>https://dev.to/nowaliraza/how-to-become-a-react-developer-in-2022-here-is-the-complete-roadmap-4fgc</guid>
      <description>&lt;p&gt;React is the leading technology for building outstanding, fast, scalable, and most importantly reusable frontends. As per the 2021 Developer Survey conducted by StackOverFlow, React is the most used web framework. More companies are looking for React developers in 2022 than ever.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is React.js?&lt;/strong&gt;&lt;br&gt;
React.js is a JavaScript UI library, created by Facebook, for building scalable UI components. It can be used for building single-page applications, mobile apps, PWAs. The most important factor behind its popularity is the lower learning slope.&lt;/p&gt;

&lt;p&gt;In this article, we will learn step by step that how can one become a React developer.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Most of the non-reactive code written in React is JavaScript.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;## Pre-requisites&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;a. JavaScript&lt;/strong&gt;&lt;br&gt;
As React is a JavaScript library, it is important to have a background in JS and an understanding of some important concepts. React nowadays comprise React Hooks and functional components, learning ES6 is recommended.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript concepts, you should know:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Variables in JS&lt;/li&gt;
&lt;li&gt;Arrow Functions&lt;/li&gt;
&lt;li&gt;Data Types and their methods&lt;/li&gt;
&lt;li&gt;Dom Manipulation and events&lt;/li&gt;
&lt;li&gt;Higher-Order and Callback Functions&lt;/li&gt;
&lt;li&gt;Promises&lt;/li&gt;
&lt;li&gt;Asynchronous JS&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;b. HTML / CSS&lt;/strong&gt;&lt;br&gt;
The representational components in React are developed using HTML and styled via CSS or a third-party tool. Suppose you are creating a button component. That component will have a label, styling, and some attributes. More than often, the HTML button element will be used for creating that component and that will be styled using CSS or any other styling library.&lt;/p&gt;
&lt;h2&gt;
  
  
  Core React Concepts to master
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Virtual Dom and Diffing algorithm&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Virtual Dom and Diffing algorithm are behind the scene of React.js. Manipulating real dom is slow, so React utilized the concept of virtual dom. Virtual dom is an abstraction of real dom. Every time a component or element is rendered, the virtual dom object gets updated. It then compares the recently updated virtual dom with a copy of the pre-updated virtual dom and figures out which dom object to update. The process to compare two virtual doms is called diffing. In the next step real dom is updated with the virtual dom and the updated virtual dom becomes pre-updated virtual dom for the next dom change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. JSX: React Template Language&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JSX can be called the syntax of React. It stands for JavaScript XML and helps to write HTML code in JavaScript and render your custom component on UI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const blog = 'programinja'
You can add variable "blog" in "p" element by using power of JSX.
&amp;lt;p&amp;gt;Blog: {blog}&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Components: building blocks of React apps&lt;/strong&gt;&lt;br&gt;
The React app comprises React components. From a simple button to a complex dashboard chart, each and everything in React apps is a component. The below code snippet is a simple React component and will render a link on UI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react'
const SimpleComponent = () =&amp;gt; {
  return (
        &amp;lt;a href='https://www.google.com'&amp;gt;Google!&amp;lt;/a&amp;gt;
  )
}
export default SimpleComponent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The component is not reusable as its label and URL are fixed. To make a component re-usable props come in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Props&lt;/strong&gt;&lt;br&gt;
Props are property objects, used to pass read-only data between React components. Props can be passed as a variable or object and in a uni-directional flow.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/// simpleComponent.js
import React from 'react'
const SimpleComponent = ({ label, url }) =&amp;gt; {
  return (
        &amp;lt;a href={label}&amp;gt;{url}&amp;lt;/a&amp;gt;
  )
}
export default SimpleComponent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Link component is now reusable and can be rendered with different labels and URLs as shown in the below snippet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/// index.js
import SimpleComponent from './simpleComponent'
const App = () =&amp;gt; {
  return (
      &amp;lt;SimpleComponent label='Google!' url='https://www.google.com' /&amp;gt;
    )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. State Management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In layman’s language, a state is a Javascript object, which stores mutable data that can be used and updated by the component. Any change in state re-renders the component. Historically state is associated with class-based components, however, with the useState / useReducer hook, it can be managed in functional components.&lt;/p&gt;

&lt;p&gt;The state can be managed at the component level by calling useState hook and at the global level through state management solutions such as Redux, Context API, Recoil, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. React Hooks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React 16.8 introduced hooks in 2018. React hooks help manage state and lifecycle methods in functional components and have made class-based components redundant. Hooks can only be used in functional components and at the top level.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic Hooks&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;useState&lt;/li&gt;
&lt;li&gt;useEffect&lt;/li&gt;
&lt;li&gt;useContext&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Advanced Hooks&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;useReducer&lt;/li&gt;
&lt;li&gt;useCallback&lt;/li&gt;
&lt;li&gt;useMemo&lt;/li&gt;
&lt;li&gt;useRef&lt;/li&gt;
&lt;li&gt;useImperativeHandle&lt;/li&gt;
&lt;li&gt;useLayoutEffect&lt;/li&gt;
&lt;li&gt;useDebugValue
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useState } from 'react'
const App = () =&amp;gt; {
const [sum, setSum] = useState(1) /// The initial value of sum is 1.
return (
  &amp;lt;&amp;gt;
    &amp;lt;button onClick={() =&amp;gt; setSum(sum + 1)} &amp;gt;+&amp;lt;/button
    &amp;lt;span&amp;gt;{sum}&amp;lt;/span&amp;gt;
    &amp;lt;button disabled={sum === 1} onClick={() =&amp;gt; setSum(sum - 1)}&amp;gt;-    &amp;lt;/button&amp;gt;
  &amp;lt;/&amp;gt;
  )
}
export default App
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above component, the state is managed via useState Hooks at the local level.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Creating your own custom hooks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Custom hooks can be created to share reusable functional logic across multiple components. For example, a custom hook to detect the browser window width or fetch data from APIs can be created and used across the app. A custom hook starts with use.&lt;/p&gt;

&lt;p&gt;In the below example, a custom hook is created, which returns the width and height of the browser window. It can be used for mobile responsiveness, etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useLayoutEffect, useState } from 'react'
const useWindowSize = () =&amp;gt; {
const [size, setSize] = useState([0, 0])
useLayoutEffect(() =&amp;gt; {
const updateSize = () =&amp;gt; {
setSize([window.innerWidth, window.innerHeight])
}
window.addEventListener('resize', updateSize)
updateSize()
return () =&amp;gt; window.removeEventListener('resize', updateSize)
}, [])
return size
}
export default useWindowSize
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can use useWindowSize hook to detect widows width and render desktop or mobile components against respective screen sizes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const NavBar = () =&amp;gt; {
  const [width] = useWindowSize()
  return (
    width &amp;gt; 786 ? &amp;lt;Desktop /&amp;gt; : &amp;lt;Mobile /&amp;gt;
  )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have mastered these concepts, you can call yourself a beginner React developer. But, there are some higher-level concepts to be learned to beat the crowd.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advanced React Topics
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Higher-Order Components&lt;/li&gt;
&lt;li&gt;Code-splitting&lt;/li&gt;
&lt;li&gt;Refs&lt;/li&gt;
&lt;li&gt;Context API&lt;/li&gt;
&lt;li&gt;Server-side Rendering&lt;/li&gt;
&lt;li&gt;React Suspense&lt;/li&gt;
&lt;li&gt;React Server Components&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After picking up these concepts you can call yourself a React developer.&lt;/p&gt;

&lt;p&gt;So now you have learnt basic and advanced level React.&lt;/p&gt;

&lt;p&gt;But, as React is itself a library, so we need to use other libraries and node packages, such as React Router for routing, Redux for state management, etc, to leverage more functionalities.&lt;/p&gt;

&lt;h2&gt;
  
  
  React Ecosystem
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. React Router / React Router Dom&lt;/strong&gt;&lt;br&gt;
React Router is a routing library for navigating between React components by modifying URLs. When a user lands on a URL, React Router will detect if a component is set to render against that router and render on UI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. State Management via third-party libraries&lt;/strong&gt;&lt;br&gt;
Although React provides state management at component and global level via useState hook and Context API. However, if an app is much complex and you want more control, a third-party tool like Redux, Recoil, Mobx can be used. Personally, I suggest using Context API with useReducer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Forms&lt;/strong&gt;&lt;br&gt;
Creating dynamic and complex forms with validations and other stuff requires using a library. Formic and React Hooks Forms are widely used for creating forms. These libraries handle all aspects of a form seamlessly. Yup is widely used for adding validations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. React Testing&lt;/strong&gt;&lt;br&gt;
React testing is a concept to test your components if a component behaves as expected. For example, you have created an input field and expect it to behave in a certain way. The test will be written to cater to those use-cases. Automated testing help stabilize the components and reduce manual testing and captures bugs immediately. It is important for a developer to write test cases for your components. Jest, Cypress and React Testing Library are widely used for testing React apps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Styling / UI libraries&lt;/strong&gt;&lt;br&gt;
Instead of creating UI components, such as Modals, Buttons, Menu, Dropdowns, etc, any UI library can be used. Common examples are Material-UI, Antd, Bootstrap. Besides, there are also multiple styling libraries to create your own styling such as Styled-components, Tailwind CSS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Handling APIs&lt;/strong&gt;&lt;br&gt;
Multiple promises-based libraries are providing awesome solutions to work with Rest and GraphQL APIs. Axios, Superagent and are the popular ones for Rest APIs. Apollo and Relay dominate GraphQL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Relevant tools you should learn
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;NPM&lt;/li&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;li&gt;Webpack&lt;/li&gt;
&lt;li&gt;Heroku / Netlify&lt;/li&gt;
&lt;li&gt;Firebase / AWS Amplify&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Projects to build
&lt;/h2&gt;

&lt;p&gt;E-commerce stores&lt;br&gt;
To-do app&lt;br&gt;
A basic SAAS app&lt;/p&gt;

&lt;p&gt;Congratulations. After learning these concepts, you are now a ninja React developer. Start applying and continue learning.&lt;br&gt;
Thanks for reading.&lt;/p&gt;

&lt;p&gt;Follow me at LinkedIn: &lt;a href="https://www.linkedin.com/in/thealiraza"&gt;https://www.linkedin.com/in/thealiraza&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
