{"componentChunkName":"component---src-templates-posts-article-template-tsx","path":"/articles/musezade-and-microservices","result":{"pageContext":{"article":{"postDate":"May. 30, 2020","pathPrefix":"articles","path":"articles/musezade-and-microservices","readingTime":{"text":"3 minute read","minutes":2.892,"words":723,"time":173519.99999999997},"id":"b35d1184-d0cf-5af4-b62e-dc34da73fd00","title":"Introduction to microservices ","node_locale":"en","excerpt":"It's hard to describe microservice in a single sentence. In this article, we will let you know why and what are aspects of microservices that we love most about. ","slug":"musezade-and-microservices","shortUrl":"re-hk2","canonical":null,"featured":true,"publicationDate":"Apr. 30, 2020","updatedAt":"Apr. 7, 2021","hero":{"CardPreview":{"aspectRatio":1.7647058823529411,"src":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=1200&h=680&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=300&h=170&q=100 300w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=600&h=340&q=100 600w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=355&q=100 626w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=1200&h=680&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=300&h=170&q=100&fm=webp 300w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=600&h=340&q=100&fm=webp 600w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=355&q=100&fm=webp 626w","sizes":"(max-width: 1200px) 100vw, 1200px"},"Article__Featured":{"aspectRatio":1.4545454545454546,"src":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=1200&h=825&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=300&h=206&q=100 300w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=600&h=413&q=100 600w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=430&q=100 626w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=1200&h=825&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=300&h=206&q=100&fm=webp 300w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=600&h=413&q=100&fm=webp 600w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=430&q=100&fm=webp 626w","sizes":"(max-width: 1200px) 100vw, 1200px"},"Article__Hero":{"aspectRatio":1.4545454545454546,"src":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=3200&h=2200&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=430&q=100 626w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=3200&h=2200&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=430&q=100&fm=webp 626w","sizes":"(max-width: 3200px) 100vw, 3200px"}},"author":{"id":"e309bf41-add3-5ab7-a88c-872d394e436e","name":"Bishal Roka ","title":"Chief Marketing Officer","slug":"Bishal-Roka","biography":{"childRichTextHtml":{"html":"<p>Bishal Roka </p>"}},"avatar":{"small":{"aspectRatio":1,"src":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=64&h=64&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=16&h=16&q=100 16w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=32&h=32&q=100 32w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=64&h=64&q=100 64w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=96&h=96&q=100 96w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=128&h=128&q=100 128w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=192&h=192&q=100 192w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=1112&h=1112&q=100 1112w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=64&h=64&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=16&h=16&q=100&fm=webp 16w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=32&h=32&q=100&fm=webp 32w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=64&h=64&q=100&fm=webp 64w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=96&h=96&q=100&fm=webp 96w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=128&h=128&q=100&fm=webp 128w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=192&h=192&q=100&fm=webp 192w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=1112&h=1112&q=100&fm=webp 1112w","sizes":"(max-width: 64px) 100vw, 64px"},"large":{"aspectRatio":1,"src":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=400&h=400&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=100&h=100&q=100 100w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=200&h=200&q=100 200w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=400&h=400&q=100 400w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=600&h=600&q=100 600w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=800&h=800&q=100 800w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=1112&h=1112&q=100 1112w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=400&h=400&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=100&h=100&q=100&fm=webp 100w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=200&h=200&q=100&fm=webp 200w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=400&h=400&q=100&fm=webp 400w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=600&h=600&q=100&fm=webp 600w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=800&h=800&q=100&fm=webp 800w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=1112&h=1112&q=100&fm=webp 1112w","sizes":"(max-width: 400px) 100vw, 400px"}}},"body":"<p></p><blockquote><p><b>It&#39;s hard to describe microservice</b> in a single sentence. In this article, we will let you know why and what are aspects of microservices that we love most about. </p></blockquote><p><b>Microservices</b> are independently deployable modules. Let&#39;s take Muse Zade&#39;s favourite domain ecommerce as an example and divide it into modules as follows:</p><blockquote><p><b>Ordering items</b></p><p><b>Items Search</b></p><p><b>User/Product Registration</b></p></blockquote><p>Normally, all of these modules would be implemented together in one application. In this case, <b>a change in one of the modules</b> can only be brought into production by bringing a <b>new version of the entire application</b> with all its modules into production. However, when the modules are implemented as microservices, the ordering process cannot only be <b>changed independently of the other modules</b>, but it can even be brought into production independently. This speeds up deployment and reduces the number of necessary tests since only a single module needs to be deployed. Due to this greater level of decoupling, a large project can turn into a number of smaller projects. Each project is in charge of an individual microservice.</p><p>To achieve this at the technical level, <b>every microservice has to be an independent process</b>. A better solution for decoupling microservices is to provide an independent virtual machine or Docker container for each microservice.</p><p>In that case, a deployment will replace the Docker container of an individual microservice with a new Docker container, which starts the new version and its direct requests. The other microservices will not be affected if such an approach is used.</p><h3>\n<i><b>Size of a microservice </b></i><a href=https://www.educative.io/courses/introduction-microservice-principles-concepts/N7Y2ZzKNl1p#size-of-a-microservice target=\"_blank\" rel=\"noopener\"></a></h3><p>First, the common confusion about microservices is that people think it&#39;s only is a smaller chunks of existing modules, which might not be true.  Some microservices keep an entire team busy, while others comprise only a few hundred lines of code. The above definition of microservices does not say anything about the size of a microservice. Of course, the term <i>microservice</i> suggests that especially small services are meant. However, in practice, <b>microservices can vary hugely in size</b>.</p><h3>\n<i><b>Scaling the product</b></i></h3><p>Muse Zade works with teams of other companies, but within our own tech stacks within the same projects, which has been possible only because of microservices architecture. Below are some of the features of microservices in product management across unrelated teams:  </p><ul><li><p>Each <b>teams </b>responsible for an individual microservice <b>can make most technology decisions on their own</b></p></li><li><p>When the microservices are delivered as Docker containers, <b>each Docker container only has to offer an interface</b> for the other containers.</p></li><li><p>The <b>internal structure of the containers does not matter</b> as long as the interface is present and functions correctly. Therefore, it is irrelevant which programming language a microservice is written in. Consequently, the responsible team can make such decisions on their own. Of course, the selection of programming languages can be restricted in order to avoid increased complexity. However, even if the choice of the programming language in a project has been restricted, a team can still independently use an updated library with a bug fix for their microservice.</p></li><li><p>When a new feature only requires changes in one microservice, it <b>can not only be developed independently, but it can also be brought into production on its own</b>.\n</p></li></ul><h3><i><b>Working with Legacy Codes</b></i></h3><p>Microservices help when working with legacy systems since the existing code does not necessarily have to be changed. Instead, <b>new microservices can replace parts of the old system</b>. <b>No pre-existing codebase has to be used</b>. In addition, developers can employ a completely different technology stack. This immensely facilitates work compared to having to modify the legacy code itself.\n\n<i><b>Challenges you might face</b></i></p><h4>1. Deployment must be automated</h4><p>Microservice architectures can only work when the deployment is automated! Microservices substantially increase the number of deployable units compared to a deployment monolith. This is only feasible when the deployment processes are automated.</p><h4>2. Difficult to replace</h4><p>It is difficult to replace a microservice, on which numerous other microservices depend since changes might affect the other microservices. Thus, to achieve replaceability, <b>the dependencies between microservices have to be managed appropriately</b>.</p><h4>3. More tests and increased latency</h4><p>Due to the split into microservices, there are more interfaces to test, and <b>testing has to be independent for both sides of the interface</b>.</p><p>Hence, the <b>challenges</b> are mostly associated with <b>operation</b>. Appropriate technological decisions should strengthen the intended benefits, and at the same time they should minimize disadvantages like the complexity in operation.</p><p>Of course, integration and communication between microservices is more complex than the calls between modules within a deployment monolith. The added technological complexity represents an additional important challenge for microservice architectures.</p><p>\n\n\n</p>","backgroundImage":{"fluid":{"aspectRatio":3,"src":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1140&h=380&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=285&h=95&q=100 285w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=570&h=190&q=100 570w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1140&h=380&q=100 1140w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1710&h=570&q=100 1710w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1920&h=640&q=100 1920w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1140&h=380&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=285&h=95&q=100&fm=webp 285w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=570&h=190&q=100&fm=webp 570w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1140&h=380&q=100&fm=webp 1140w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1710&h=570&q=100&fm=webp 1710w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1920&h=640&q=100&fm=webp 1920w","sizes":"(max-width: 1140px) 100vw, 1140px"},"seo":{"width":1200,"height":630,"src":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1200&h=630&q=100&fit=fill","srcSet":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1200&h=630&q=100&fit=fill 1x,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1800&h=945&q=100&fit=fill 1.5x","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1200&h=630&q=100&fm=webp&fit=fill","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1200&h=630&q=100&fm=webp&fit=fill 1x,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1800&h=945&q=100&fm=webp&fit=fill 1.5x"}},"backgroundColor":"#3F404A"},"slug":"articles/musezade-and-microservices","id":"b35d1184-d0cf-5af4-b62e-dc34da73fd00","title":"Introduction to microservices ","next":[{"postDate":"May. 30, 2020","pathPrefix":"articles","path":"articles/clarifying-brand-message ","readingTime":{"text":"0 minute read","minutes":0.004,"words":1,"time":240},"id":"4bc1aca4-43a5-5b04-8146-6fc2a0c9668b","title":"test","node_locale":"en","excerpt":"We all know every business spends a huge amount of capital on marketing. But most of them fail why? ","slug":"clarifying-brand-message ","shortUrl":"brand-message ","canonical":null,"featured":false,"publicationDate":"Apr. 28, 2020","updatedAt":"Feb. 26, 2022","hero":{"CardPreview":{"aspectRatio":1.7647058823529411,"src":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=1200&h=680&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=300&h=170&q=100 300w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=600&h=340&q=100 600w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=355&q=100 626w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=1200&h=680&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=300&h=170&q=100&fm=webp 300w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=600&h=340&q=100&fm=webp 600w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=355&q=100&fm=webp 626w","sizes":"(max-width: 1200px) 100vw, 1200px"},"Article__Featured":{"aspectRatio":1.4545454545454546,"src":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=1200&h=825&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=300&h=206&q=100 300w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=600&h=413&q=100 600w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=430&q=100 626w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=1200&h=825&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=300&h=206&q=100&fm=webp 300w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=600&h=413&q=100&fm=webp 600w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=430&q=100&fm=webp 626w","sizes":"(max-width: 1200px) 100vw, 1200px"},"Article__Hero":{"aspectRatio":1.4545454545454546,"src":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=3200&h=2200&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=430&q=100 626w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=3200&h=2200&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=430&q=100&fm=webp 626w","sizes":"(max-width: 3200px) 100vw, 3200px"}},"author":{"id":"e309bf41-add3-5ab7-a88c-872d394e436e","name":"Bishal Roka ","title":"Chief Marketing Officer","slug":"Bishal-Roka","biography":{"childRichTextHtml":{"html":"<p>Bishal Roka </p>"}},"avatar":{"small":{"aspectRatio":1,"src":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=64&h=64&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=16&h=16&q=100 16w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=32&h=32&q=100 32w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=64&h=64&q=100 64w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=96&h=96&q=100 96w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=128&h=128&q=100 128w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=192&h=192&q=100 192w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=1112&h=1112&q=100 1112w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=64&h=64&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=16&h=16&q=100&fm=webp 16w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=32&h=32&q=100&fm=webp 32w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=64&h=64&q=100&fm=webp 64w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=96&h=96&q=100&fm=webp 96w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=128&h=128&q=100&fm=webp 128w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=192&h=192&q=100&fm=webp 192w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=1112&h=1112&q=100&fm=webp 1112w","sizes":"(max-width: 64px) 100vw, 64px"},"large":{"aspectRatio":1,"src":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=400&h=400&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=100&h=100&q=100 100w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=200&h=200&q=100 200w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=400&h=400&q=100 400w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=600&h=600&q=100 600w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=800&h=800&q=100 800w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=1112&h=1112&q=100 1112w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=400&h=400&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=100&h=100&q=100&fm=webp 100w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=200&h=200&q=100&fm=webp 200w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=400&h=400&q=100&fm=webp 400w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=600&h=600&q=100&fm=webp 600w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=800&h=800&q=100&fm=webp 800w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=1112&h=1112&q=100&fm=webp 1112w","sizes":"(max-width: 400px) 100vw, 400px"}}},"body":"<p>test</p>","backgroundImage":{"fluid":{"aspectRatio":3,"src":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1140&h=380&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=285&h=95&q=100 285w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=570&h=190&q=100 570w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1140&h=380&q=100 1140w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1710&h=570&q=100 1710w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1920&h=640&q=100 1920w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1140&h=380&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=285&h=95&q=100&fm=webp 285w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=570&h=190&q=100&fm=webp 570w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1140&h=380&q=100&fm=webp 1140w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1710&h=570&q=100&fm=webp 1710w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1920&h=640&q=100&fm=webp 1920w","sizes":"(max-width: 1140px) 100vw, 1140px"},"seo":{"width":1200,"height":630,"src":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1200&h=630&q=100&fit=fill","srcSet":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1200&h=630&q=100&fit=fill 1x,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1800&h=945&q=100&fit=fill 1.5x","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1200&h=630&q=100&fm=webp&fit=fill","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1200&h=630&q=100&fm=webp&fit=fill 1x,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1800&h=945&q=100&fm=webp&fit=fill 1.5x"}},"backgroundColor":"#3F404A"},{"postDate":"Apr. 24, 2020","pathPrefix":"articles","path":"articles/react-performance","readingTime":{"text":"7 minute read","minutes":6.684,"words":1671,"time":401040},"id":"c759d75f-54ad-522e-b250-5db6f1d1092d","title":"Performance in React","node_locale":"en","excerpt":"Once a React application grows, maintenance becomes daunting. To prepare for this eventuality, we need to focus on optimization, type safety, testing, and project structure.","slug":"react-performance","shortUrl":"re-perform","canonical":null,"featured":null,"publicationDate":"Apr. 28, 2020","updatedAt":"May. 26, 2020","hero":{"CardPreview":{"aspectRatio":1.7647058823529411,"src":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=1200&h=680&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=300&h=170&q=100 300w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=600&h=340&q=100 600w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=355&q=100 626w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=1200&h=680&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=300&h=170&q=100&fm=webp 300w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=600&h=340&q=100&fm=webp 600w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=355&q=100&fm=webp 626w","sizes":"(max-width: 1200px) 100vw, 1200px"},"Article__Featured":{"aspectRatio":1.4545454545454546,"src":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=1200&h=825&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=300&h=206&q=100 300w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=600&h=413&q=100 600w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=430&q=100 626w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=1200&h=825&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=300&h=206&q=100&fm=webp 300w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=600&h=413&q=100&fm=webp 600w,\n//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=430&q=100&fm=webp 626w","sizes":"(max-width: 1200px) 100vw, 1200px"},"Article__Hero":{"aspectRatio":1.4545454545454546,"src":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=3200&h=2200&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=430&q=100 626w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=3200&h=2200&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/7wXLUWI4bu7aHXigI9O6tR/b97dfd196b69963422795f31bf5b67a0/elegant-golden-pattern-background-design_1017-13782.jpg?w=626&h=430&q=100&fm=webp 626w","sizes":"(max-width: 3200px) 100vw, 3200px"}},"author":{"id":"e309bf41-add3-5ab7-a88c-872d394e436e","name":"Bishal Roka ","title":"Chief Marketing Officer","slug":"Bishal-Roka","biography":{"childRichTextHtml":{"html":"<p>Bishal Roka </p>"}},"avatar":{"small":{"aspectRatio":1,"src":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=64&h=64&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=16&h=16&q=100 16w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=32&h=32&q=100 32w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=64&h=64&q=100 64w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=96&h=96&q=100 96w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=128&h=128&q=100 128w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=192&h=192&q=100 192w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=1112&h=1112&q=100 1112w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=64&h=64&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=16&h=16&q=100&fm=webp 16w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=32&h=32&q=100&fm=webp 32w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=64&h=64&q=100&fm=webp 64w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=96&h=96&q=100&fm=webp 96w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=128&h=128&q=100&fm=webp 128w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=192&h=192&q=100&fm=webp 192w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=1112&h=1112&q=100&fm=webp 1112w","sizes":"(max-width: 64px) 100vw, 64px"},"large":{"aspectRatio":1,"src":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=400&h=400&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=100&h=100&q=100 100w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=200&h=200&q=100 200w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=400&h=400&q=100 400w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=600&h=600&q=100 600w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=800&h=800&q=100 800w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=1112&h=1112&q=100 1112w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=400&h=400&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=100&h=100&q=100&fm=webp 100w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=200&h=200&q=100&fm=webp 200w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=400&h=400&q=100&fm=webp 400w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=600&h=600&q=100&fm=webp 600w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=800&h=800&q=100&fm=webp 800w,\n//images.ctfassets.net/mn39h0tra6wf/40GPT8RxXNNBqoQNTkHBPq/e8c8bea306f1b95c7ddf6d86992c3809/musezadenew.png?w=1112&h=1112&q=100&fm=webp 1112w","sizes":"(max-width: 400px) 100vw, 400px"}}},"body":"<h1>Performance in React</h1><p>Once a React application grows, maintenance becomes a priority. To prepare for this eventuality, we’ll cover performance optimization, type safety, testing, and project structure. Each can strengthen your app to take on more functionality without losing quality.</p><p>Performance optimization prevents applications from slowing down by assuring efficient use of available resource. Typed programming languages like TypeScript detect bugs earlier in the feedback loop. Testing gives us more explicit feedback than typed programming, and provides a way to understand which actions can break the application. Lastly, project structure supports the organized management of assets into folders and files, which is especially useful in scenarios where team members work in different domains.</p><h2>Performance in React</h2><p>This section is just here for the sake of learning about performance improvements in React. We wouldn’t need optimizations in most React applications, as React is fast out of the box. While more sophisticated tools exist for performance measurements in JavaScript and React, we will stick to a simple <code>console.log()</code> and our browser’s developer tools for the logging output.</p><h3>Don’t run on first render</h3><p>Previously we covered React’s useEffect Hook, which is used for side-effects. It runs the first time a component renders (mounting), and then every re-render (updating). By passing an empty dependency array to it as a second argument, we can tell the hook to run on the first render only. Out of the box, there is no way to tell the hook to run only on every re-render (update) and not on the first render (mount). For instance, examine this custom hook for state management with React’s <code>useStat</code>e Hook and its semi persistent state with local storage using React’s <code>useEffect</code> Hook:</p>\n\n```js\nconst useSemiPersistentState = (key, initialState) => {\n  const [value, setValue] = React.useState(\n    localStorage.getItem(key) || initialState\n  );\n\n  React.useEffect(() => {\n    console.log('A');\n\n    localStorage.setItem(key, value);\n  }, [value, key]);\n\n  return [value, setValue];\n};\n```\n\n<p>With a closer look at the developer’s tools, we can see the log for a first time render of the component using this custom hook. It doesn’t make sense to run the side-effect for the initial rendering of the component, because there is nothing to store in the local storage except the initial value. It’s a redundant function invocation, and should only run for every update (re-rendering) of the component.</p><p>As mentioned, there is no React Hook that runs on every re-render, and there is no way to tell the <code>useEffect</code> hook in a React idiomatic way to call its function only on every re-render. However, by using React’s useRef Hook which keeps its <code>ref.current</code> property intact over re-renders, we can keep a <i>made up state</i> (without re-rendering the component on state updates) of our component’s lifecycle:</p>\n\n```js\nconst useSemiPersistentState = (key, initialState) => {\n\n  const isMounted = React.useRef(false);\n\n\n  const [value, setValue] = React.useState(\n    localStorage.getItem(key) || initialState\n  );\n\n  React.useEffect(() => {\n\n    if (!isMounted.current) {\n      isMounted.current = true;\n    } else {\n\n      console.log('A');\n      localStorage.setItem(key, value);\n\n    }\n\n  }, [value, key]);\n\n  return [value, setValue];\n};\n```\n\n<p>We are exploiting the <code>ref</code> and its mutable <code>current</code> property for imperative state management that doesn’t trigger a re-render. Once the hook is called from its component for the first time (component render), the ref’s <code>current</code> is initialized with a <code>false</code> boolean called <code>isMounted</code>. As a result, the side-effect function in <code>useEffect</code> isn’t called; only the boolean flag for <code>isMounted</code> is toggled to <code>true</code> in the side-effect. Whenever the hook runs again (component re-render), the boolean flag is evaluated in the side-effect. Since it’s <code>true</code>, the side-effect function runs. Over the lifetime of the component, the <code>isMounted</code> boolean will remain<code>true</code>. It was there to avoid calling the side-effect function for the first time render that uses our custom hook.</p><p>The above was only about preventing the invocation of one simple function for a component rendering for the first time. But imagine you have an expensive computation in your side-effect, or the custom hook is used frequently in the application. It’s more practical to deploy this technique to avoid unnecessary function invocations.</p><h3>Don’t re-render if not needed</h3><p>Earlier, we explored React’s re-rendering mechanism. We’ll repeat this exercise for the App and List components. For both components, add a logging statement.</p>\n\n```js\nconst App = () => {\n  .....\n\n  console.log('B:App');\n  return ( .... );\n};\n\nconst List = ({ list, onRemoveItem }) =>\n\n  console.log('B:List') ||\n\n  list.map(item => (\n    <Item\n      key={item.objectID}\n      item={item}\n      onRemoveItem={onRemoveItem}\n    />\n  ));\n```\n\n<p>Because the List component has no function body, and developers are lazy folks who don’t want to refactor the component for a simple logging statement, the List component uses the <code>||</code> operator instead. This is a neat trick for adding a logging statement to a function component without a function body. Since the <code>console.log()</code> on the left hand side of the operator always evaluates to false, the right hand side of the operator gets always executed.</p>\n\n```js\nfunction getTheTruth() {\n  if (console.log('B:List')) {\n    return true;\n  } else {\n    return false;\n  }\n}\n\nconsole.log(getTheTruth());\n// B:List\n// false\n```\n\n<p>Let’s focus on the actual logging in the browser’s developer tools. You should see a similar output. First the App component renders, followed by its child components (e.g. List component).</p>\n\n```js\nB:App\nB:List\nB:App\nB:App\nB:List\n```\n\n<p>Since a side-effect triggers data fetching after the first render, only the App component renders, because the List component is replaced by a loading indicator in a conditional rendering. Once the data arrives, both components render again.</p>\n\n```js\n// initial render\nB:App\nB:List\n \n// data fetching with loading\nB:App\n \n// re-rendering with data\nB:App\nB:List\n```\n\n<p>So far, this behavior is acceptable, since everything renders on time. Now we’ll take this experiment a step further, by typing into the SearchForm component’s input field. You should see the changes with every character entered into the element:</p>\n\n```js\nB:App\nB:List\n```\n\n<p>But the List component shouldn’t re-render. The search feature isn’t executed via its button, so the <code>list</code> passed to the List component should remain the same. This is React’s default behavior, which surprises many people.</p><p>If a parent component re-renders, its child components re-render as well. React does this by default, because preventing a re-render of child components could lead to bugs, and the re-rendering mechanism of React is still fast.</p><p>Sometimes we want to prevent re-rendering, however. For instance, huge data sets displayed in a table shouldn’t re-render if they are not affected by an update. It’s more efficient to perform an equality check if something changed for the component. Therefore, we can use React’s memo API to make this equality check for the props:</p>\n\n```js\nconst List = React.memo(\n  ({ list, onRemoveItem }) =>\n    console.log('B:List') ||\n    list.map(item => (\n      <Item\n        key={item.objectID}\n        item={item}\n        onRemoveItem={onRemoveItem}\n      />\n    ))\n\n);\n```\n\n<p>However, the output stays the same when typing into the SearchForm’s input field:</p>\n\n```js\nB:App\nB:List\n```\n\n<p>The <code>list</code> passed to the List component is the same, but the <code>onRemoveItem</code> callback handler isn’t. If the App component re-renders, it always creates a new version of this callback handler. Earlier, we used React’s useCallacbk Hook to prevent this behavior, by creating a function only on a re-render (if one of its dependencies has changed).</p>\n\n```js\nconst App = () => {\n  ...\n\n\n  const handleRemoveStory = React.useCallback(item => {\n\n    dispatchStories({\n      type: 'REMOVE_STORY',\n      payload: item,\n    });\n\n  }, []);\n\n\n  ...\n\n  console.log('B:App');\n\n  return (... );\n};\n```\n\n<p>Since the callback handler gets the <code>item</code> passed as an argument in its function signature, it doesn’t have any dependencies and is declared only once when the App component initially renders. None of the props passed to the List component should change now. Try it with the combination of <code>memo</code> and <code>useCallback</code>, to search via the SearchForm’s input field. The “B:List” output disappears, and only the App component re-renders with its “B:App” output.</p><p>While all props passed to a component stay the same, the component renders again if its parent component is forced to re-render. That’s React’s default behavior, which works most of the time because the re-rendering mechanism is fast enough. However, if re-rendering decreases the performance of a React application, <code>memo</code> helps prevent re-rendering.</p><p>Sometimes <code>memo</code> alone doesn’t help, though. Callback handlers are re-defined each time in the parent component and passed as <i>changed</i> props to the component, which causes another re-render. In that case, <code>useCallback</code> is used for making the callback handler only change when its dependencies change.</p><h3>Don’t rerun expensive computations <a href=https://www.educative.io/courses/road-to-react-with-hooks/g7DJ5QvnjDY#dont-rerun-expensive-computations target=\"_blank\" rel=\"noopener\"></a></h3><p>Sometimes we’ll have performance-intensive computations in our React components – between a component’s function signature and return block – which run on every render. For this scenario, we must create a use case in our current application first.</p>\n\n```js\nconst getSumComments = stories => {\n  console.log('C');\n\n  return stories.data.reduce(\n    (result, value) => result + value.num_comments,\n    0\n  );\n};\n\n\nconst App = () => {\n  ...\n\n  const sumComments = getSumComments(stories);\n\n  return (\n    <div>\n\n      <h1>My Hacker Stories with {sumComments} comments.</h1>\n\n      ...\n    </div>\n  );\n};\n```\n\n<p>If all arguments are passed to a function, it’s acceptable to have it outside the component. It prevents creating the function on every render, so the <code>useCallback</code> hook becomes unnecessary. The function still computes the value of summed comments on every render, which becomes a problem for more expensive computations.</p><p>Each time text is typed in the input field of the SearchForm component, this computation runs again with an output of “C”. This may be fine for a non-heavy computation like this one, but imagine this computation would take more than 500ms. It would give the re-rendering a delay, because everything in the component has to wait for this computation. We can tell React to only run a function if one of its dependencies has changed. If no dependency changed, the result of the function stays the same. React’s useMemo Hook helps us here:</p>\n\n```js\nconst App = () => {\n  ...\n\n  const sumComments = React.useMemo(() => getSumComments(stories), [\n    stories,\n  ]);\n\n\n  return ( ... );\n};\n```\n\n<p>For every time someone types in the SearchForm, the computation shouldn’t run again. It only runs if the dependency array, here <code>stories</code>, has changed. After all, this should only be used for cost expensive computations which could lead to a delay of a (re-)rendering of a component.</p><p>Now, after we went through these scenarios for <code>useMemo</code>, <code>useCallback</code>, and <code>memo</code>, remember that these shouldn’t necessarily be used by default. Apply these performance optimization only if you run into a performance bottlenecks. Most of the time this shouldn’t happen, because React’s rendering mechanism is pretty efficient by default. Sometimes the check for utilities like <code>memo</code> can be more expensive than the re-rendering itself.</p>","backgroundImage":{"fluid":{"aspectRatio":3,"src":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1140&h=380&q=100","srcSet":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=285&h=95&q=100 285w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=570&h=190&q=100 570w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1140&h=380&q=100 1140w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1710&h=570&q=100 1710w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1920&h=640&q=100 1920w","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1140&h=380&q=100&fm=webp","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=285&h=95&q=100&fm=webp 285w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=570&h=190&q=100&fm=webp 570w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1140&h=380&q=100&fm=webp 1140w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1710&h=570&q=100&fm=webp 1710w,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1920&h=640&q=100&fm=webp 1920w","sizes":"(max-width: 1140px) 100vw, 1140px"},"seo":{"width":1200,"height":630,"src":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1200&h=630&q=100&fit=fill","srcSet":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1200&h=630&q=100&fit=fill 1x,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1800&h=945&q=100&fit=fill 1.5x","srcWebp":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1200&h=630&q=100&fm=webp&fit=fill","srcSetWebp":"//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1200&h=630&q=100&fm=webp&fit=fill 1x,\n//images.ctfassets.net/mn39h0tra6wf/6lNziLO0oSx6Y3JMfj540b/fce63831bdbf7ca22f34be9c7f9da599/you-dont-need-microservices.png?w=1800&h=945&q=100&fm=webp&fit=fill 1.5x"}},"backgroundColor":"#3F404A"}]}}}