<?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: Zarema</title>
    <description>The latest articles on DEV Community by Zarema (@quesadilla).</description>
    <link>https://dev.to/quesadilla</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%2F1322607%2Fc94a1b3d-cac8-407d-9c6c-e4476bdd9088.jpg</url>
      <title>DEV Community: Zarema</title>
      <link>https://dev.to/quesadilla</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/quesadilla"/>
    <language>en</language>
    <item>
      <title>Scalability Analysis of Microservices Architectures</title>
      <dc:creator>Zarema</dc:creator>
      <pubDate>Fri, 29 Mar 2024 20:28:45 +0000</pubDate>
      <link>https://dev.to/quesadilla/scalability-analysis-of-microservices-architectures-110n</link>
      <guid>https://dev.to/quesadilla/scalability-analysis-of-microservices-architectures-110n</guid>
      <description>&lt;p&gt;&lt;strong&gt;What are Microservices?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Microservices are a software development architecture that organizes an application as a collection of loosely coupled services. Each service is self-contained and performs a specific task. Microservices communicate with each other through APIs.&lt;/p&gt;

&lt;p&gt;For example, the user authentication microservice can provide an API that allows the product catalog microservice to verify the identity of a user before returning product information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Importance of Scalability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Scalability is paramount in microservices architectures due to their distributed nature. The ability to handle increasing loads efficiently ensures that applications can meet user demands without compromising performance or reliability. Scalability also plays a significant role in cost-effectiveness, as it allows for optimal resource utilization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to Scale Microservices&lt;/strong&gt;&lt;br&gt;
Thera are two ways to scale microservices&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Horizontal&lt;/strong&gt;&lt;br&gt;
This involves adding more microservice instances to handle the increased load. It’s the most common type of scaling for microservices. You can add new containers or virtual machines to distribute the load across multiple instances.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Vertical&lt;/strong&gt; &lt;br&gt;
This involves increasing the resources (CPU, memory, etc.) of an existing microservice instance to handle additional load. While it can provide a short-term performance boost, it has limits. In the long term, it’s more cost-effective to use horizontal scaling.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Performance Testing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I have conducted some performance tests on scaled and unscaled service. The service is a really simple one, so we will not go in depth into it. It is written using Flask snd tested using Locust, and here are the results:&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%2Fwuzc9mjjeitcitb2onfi.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%2Fwuzc9mjjeitcitb2onfi.png" alt="Image description" width="800" height="681"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Requests: 124465
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Fails: 18154
&lt;/h1&gt;

&lt;p&gt;Median (ms): 11000&lt;br&gt;
95%ile (ms): 28000&lt;br&gt;
99%ile (ms): 35000&lt;br&gt;
Average (ms): 12237.01&lt;br&gt;
Min (ms): 1&lt;br&gt;
Max (ms): 40469&lt;/p&gt;

&lt;p&gt;This is the unscaled server results, it was tested by sending 1000 requests every second. So was the scaled version:&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%2Fq43sjsbyakr8a0z2r5cg.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%2Fq43sjsbyakr8a0z2r5cg.png" alt="Image description" width="800" height="511"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Requests:112234
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Fails: 689
&lt;/h1&gt;

&lt;p&gt;Median (ms): 2&lt;br&gt;
95%ile (ms): 3500&lt;br&gt;
99%ile (ms): 6700&lt;br&gt;
Average (ms): 364.78&lt;br&gt;
Min (ms): 1&lt;br&gt;
Max (ms): 19605&lt;/p&gt;

&lt;p&gt;I used 3 instances for scaling, and on the graph we can clearly see where one of the instances crashed and others had to work overtime because of it, but because of this "teamwork" the amount of fails decreased drastically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Scaling microservices is important because it allows your application to handle increased demand and traffic efficiently. By scaling microservices, you can ensure that your application remains responsive, reliable, and performs well under varying load conditions. This scalability enables your application to meet user demands, maintain high availability, and support business growth without sacrificing performance or user experience.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Comparative Study: RESTful vs. GraphQL Architectures for GitHub APIs</title>
      <dc:creator>Zarema</dc:creator>
      <pubDate>Sun, 03 Mar 2024 18:15:13 +0000</pubDate>
      <link>https://dev.to/quesadilla/comparative-study-restful-vs-graphql-architectures-for-github-apis-21k</link>
      <guid>https://dev.to/quesadilla/comparative-study-restful-vs-graphql-architectures-for-github-apis-21k</guid>
      <description>&lt;p&gt;In this study, I compare the performance, flexibility, and client experience of RESTful and GraphQL architectures for GitHub APIs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture Selection&lt;/strong&gt;&lt;br&gt;
I selected GitHub APIs implemented in RESTful principles and GraphQL query language to ensure a fair comparison.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance Testing&lt;/strong&gt;&lt;br&gt;
As part of my performance testing, I measured the time it takes to fetch repositories from IBM, as well as the time it takes to create and delete repositories using both APIs.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fetching Repositories:&lt;/em&gt;&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%2Fy4fy7kfninv1nqtbf9bs.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%2Fy4fy7kfninv1nqtbf9bs.png" alt="Image description" width="800" height="613"&gt;&lt;/a&gt;&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%2F8ec3w17qua25pl1pvz7p.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%2F8ec3w17qua25pl1pvz7p.png" alt="Image description" width="800" height="116"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see&lt;br&gt;
REST fetched 700 repositories in 10.719 seconds.&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%2Fnl16wwtuovesi2brn5im.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%2Fnl16wwtuovesi2brn5im.png" alt="Image description" width="800" height="650"&gt;&lt;/a&gt;&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%2F7q89hkzrdpmyw0sez2wz.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%2F7q89hkzrdpmyw0sez2wz.png" alt="Image description" width="800" height="663"&gt;&lt;/a&gt;&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%2Flseznh2ehvizkevj19ev.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%2Flseznh2ehvizkevj19ev.png" alt="Image description" width="800" height="119"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And GraphQL fetched 900 repositories in 10.345 seconds.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Creating and Deleting Repositories:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;my usage&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%2Faota8heepb6p5yl8yqlm.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%2Faota8heepb6p5yl8yqlm.png" alt="Image description" width="800" height="746"&gt;&lt;/a&gt;&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%2Fgu3s06cbxzj67jiuhedl.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%2Fgu3s06cbxzj67jiuhedl.png" alt="Image description" width="800" height="135"&gt;&lt;/a&gt;&lt;br&gt;
REST created 15 repositories in 16.887 seconds and deleted them in 9.311 seconds.&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%2Fjz7wgqmbu4fnuem0exhl.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%2Fjz7wgqmbu4fnuem0exhl.png" alt="Image description" width="800" height="565"&gt;&lt;/a&gt;&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%2F3qfpxf1xmtkj60zl7jzk.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%2F3qfpxf1xmtkj60zl7jzk.png" alt="Image description" width="800" height="72"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GraphQL created 15 repositories in 16.040 seconds. But, unfortunately, had no support for deleting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flexibility and Extensibility&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With RESTful APIs, adding features and modifying endpoints can be straightforward, especially for developers familiar with RESTful principles. Endpoints are typically designed to represent resources and actions, making it intuitive to add new resources or modify existing ones. However, as requirements evolve, RESTful APIs may face challenges such as endpoint proliferation or the need to version endpoints to maintain backward compatibility.&lt;/p&gt;

&lt;p&gt;In contrast, GraphQL offers a more flexible approach to adding features and modifying endpoints. Its single endpoint allows clients to request precisely the data they need, eliminating the need to create multiple endpoints for different use cases. This simplifies the process of adding new features or modifying existing ones, as developers can extend the GraphQL schema to accommodate new requirements without impacting existing clients.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Evaluation and Recommendations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While both architectures offer capabilities for accommodating evolving requirements, GraphQL's flexibility and ease of schema evolution provide a significant advantage in adapting to changing needs. With RESTful APIs, careful planning and versioning strategies may be necessary to manage endpoint complexity and ensure backward compatibility as requirements evolve.&lt;/p&gt;

&lt;p&gt;It's worth noting that RESTful APIs are older and much more familiar in the industry, which can be advantageous in terms of developer familiarity and tooling support.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
