<?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>Forem: Assyahid Hasan Albana</title>
    <description>The latest articles on Forem by Assyahid Hasan Albana (@assyahid).</description>
    <link>https://forem.com/assyahid</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%2F533233%2F19734253-2137-4e2a-b0da-315efe64e1e5.png</url>
      <title>Forem: Assyahid Hasan Albana</title>
      <link>https://forem.com/assyahid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/assyahid"/>
    <language>en</language>
    <item>
      <title>Microservices Design - API Gateway Pattern</title>
      <dc:creator>Assyahid Hasan Albana</dc:creator>
      <pubDate>Fri, 01 Jan 2021 19:38:20 +0000</pubDate>
      <link>https://forem.com/assyahid/microservices-design-api-gateway-pattern-2dep</link>
      <guid>https://forem.com/assyahid/microservices-design-api-gateway-pattern-2dep</guid>
      <description>&lt;p&gt;According to the definition by Gartner: &lt;strong&gt;“Microservice is a tightly scoped, strongly encapsulated, loosely coupled, independently deployable, and independently scalable application component.”&lt;/strong&gt;&lt;br&gt;
The goal of the microservices is to sufficiently decompose/decouple the application into loosely coupled microservices/modules in contrast to monolithic applications where modules are highly coupled and deployed as a single big chunk. This will be helpful due to the following reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Each microservice can be deployed, upgraded, scaled, maintained, and restarted independent of sibling services in the application.&lt;/li&gt;
&lt;li&gt;Agile development &amp;amp; agile deployment with an autonomous cross-functional team.&lt;/li&gt;
&lt;li&gt;Flexibility in using technologies and scalability.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Different loosely coupled services are deployed based upon their own specific needs where each service has its fine-grained APIs model to serve different clients (Web, Mobile, and 3rd party APIs).&lt;br&gt;
&lt;strong&gt;Client to Microservices connections&lt;/strong&gt;&lt;br&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%2Fi%2Fy72u5xd6lpynh75fsuve.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%2Fi%2Fy72u5xd6lpynh75fsuve.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
While thinking of the client &lt;strong&gt;directly communicating&lt;/strong&gt; with each of the deployed microservices, the following challenges should be taken into consideration:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the case where microservice is exposing fine-grained APIs to the client, the client should request to each microservice. In a typical single page, it may be required for &lt;strong&gt;multiple server round trips in order to fulfill the request. This may be even worse&lt;/strong&gt; for low network operating devices such as mobile.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diverse communication protocol&lt;/strong&gt; (such as gRpc, thrift, REST, AMQP e.t.c) existing in the microservices makes it challenging and bulky for the client to adopt all those protocols.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Common gateway functionalities&lt;/strong&gt; (such as authentication, authorization, logging) have to be implemented in each microservice.&lt;/li&gt;
&lt;li&gt;It will be &lt;strong&gt;difficult to make changes in microservices&lt;/strong&gt; without disrupting client connection. For e.g while merging or dividing microservices, it may be required to recode the client section.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;API Gateway&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To address the above-mentioned challenges, an additional layer is introduced that sits between the client and the server acting as a reverse proxy routing request from the client to the server. Similar to the facade pattern of Object-Oriented Design, it provides a single entry point to the APIs encapsulating the underlying system architecture which is called API Gateway.&lt;br&gt;
In short, it behaves precisely as API management but it is important not to confuse &lt;strong&gt;API management with API Gateway&lt;/strong&gt;.&lt;br&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%2Fi%2Fs3h0ca4pe5uxex3xqxty.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%2Fi%2Fs3h0ca4pe5uxex3xqxty.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Functionalities of API Gateway:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Routing&lt;/strong&gt;&lt;br&gt;
Encapsulating the underlying system and decoupling from the clients, the gateway provides a single entry point for the client to communicate with the microservice system.&lt;br&gt;
&lt;strong&gt;Offloading&lt;/strong&gt;&lt;br&gt;
API gateway consolidates the edge functionalities rather than making every microservices implementing them. Some of the functionalities are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Authentication and authorization&lt;/li&gt;
&lt;li&gt;Service discovery integration&lt;/li&gt;
&lt;li&gt;Response caching&lt;/li&gt;
&lt;li&gt;Retry policies, circuit breaker, and QoS&lt;/li&gt;
&lt;li&gt;Rate limiting and throttling&lt;/li&gt;
&lt;li&gt;Load balancing&lt;/li&gt;
&lt;li&gt;Logging, tracing, correlation&lt;/li&gt;
&lt;li&gt;Headers, query strings, and claims transformation&lt;/li&gt;
&lt;li&gt;IP whitelisting&lt;/li&gt;
&lt;li&gt;IAM&lt;/li&gt;
&lt;li&gt;Centralized Logging (transaction ID across the servers, error logging)&lt;/li&gt;
&lt;li&gt;Identity Provider, Authentication and Authorization
&lt;strong&gt;Backend for Frontend (BFF) pattern&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is a &lt;strong&gt;variation of the API Gateway pattern&lt;/strong&gt;. Rather than a single point of entry for the clients, it provides multiple gateways based upon the client. The purpose is to provide tailored APIs according to the needs of the client, removing a lot of bloats caused by making generic APIs for all the clients.&lt;br&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%2Fi%2Fhht08bo3vudjjogzpj2p.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%2Fi%2Fhht08bo3vudjjogzpj2p.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;How many BFFs do you need?&lt;/strong&gt;&lt;br&gt;
The base concept of BFF is developing niche backends for each user experience. The guideline by Phil Calçado is &lt;strong&gt;‘one experience, one BFF’&lt;/strong&gt;. If the requirements across clients (IOS client, android client, a web browser e.t.c) vary significantly and the time to market of a single proxy or API becomes problematic, BFFs are a good solution. It should also be noted that the more complex design requires a complex setup.&lt;br&gt;
&lt;strong&gt;GraphQL and BFF&lt;/strong&gt;&lt;br&gt;
GraphQL is a query language for your API. Phil Calçado presents in this article that BFF and GraphQL are related but not mutually exclusive concepts. He adds that BFFs are not about the shape of your endpoints, but about giving your client applications autonomy where you can build your GraphQL APIs as many BFFs or as an OSFA (one-size-fits-all) API.&lt;br&gt;
&lt;strong&gt;Notable API Gateways&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Netflix API Gateway: Zuul&lt;/strong&gt;&lt;br&gt;
The Netflix streaming service available on more than 1000 different device types (televisions, set‑top boxes, smartphones, gaming systems, tablets, e.t.c) handing over 50,000 requests per second during peak hours, found substantial limitations in OSFA (one-size-fits-all) REST API approach and used the API Gateway tailored for each device.&lt;br&gt;
Zuul 2 at Netflix is the front door for all requests coming into Netflix’s cloud infrastructure. Zuul 2 significantly improves the architecture and features that allow our gateway to handle, route, and protect Netflix’s cloud systems, and helps provide our 125 million members the best experience possible.&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%2Fi%2Fjdhl3h0ev6xeeondpkrb.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%2Fi%2Fjdhl3h0ev6xeeondpkrb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Amazon API Gateway&lt;/strong&gt;&lt;br&gt;
AWS provides fully managed service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket where developers can create APIs that access AWS or other web services, as well as data stored in the AWS Cloud.&lt;br&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%2Fi%2Fk7xv4o3i52hgy9to3bkh.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%2Fi%2Fk7xv4o3i52hgy9to3bkh.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Kong API Gateway&lt;/strong&gt;&lt;br&gt;
Kong Gateway is an open-source, lightweight API gateway optimized for microservices, delivering unparalleled latency performance and scalability. If you just want the basics, this option will work for you. It is scalable easily horizontally by adding more nodes. It supports large and variable workloads with very low latency.&lt;br&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%2Fi%2F3l0jyqfurfm5e12yblxa.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%2Fi%2F3l0jyqfurfm5e12yblxa.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Other API Gateways&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://apigee.com/api-management/" rel="noopener noreferrer"&gt;Apigee API Gateway&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.mulesoft.com/platform/api-management" rel="noopener noreferrer"&gt;MuleSoft&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/TykTechnologies/tyk" rel="noopener noreferrer"&gt;Tyk.io&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.akana.com/products/api-platform/api-gateway" rel="noopener noreferrer"&gt;Akana&lt;/a&gt;&lt;br&gt;
&lt;a href="https://swagger.io/tools/swaggerhub/." rel="noopener noreferrer"&gt;SwaggerHub&lt;/a&gt;&lt;br&gt;
&lt;a href="https://azure.microsoft.com/en-us/services/api-management/" rel="noopener noreferrer"&gt;Azure API Gateway&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.express-gateway.io/" rel="noopener noreferrer"&gt;Express API Gateway&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.krakend.io/" rel="noopener noreferrer"&gt;Karken D&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Choosing the right API gateway&lt;/strong&gt;&lt;br&gt;
Some of the common baseline for evaluation criteria include simplicity, open-source vs propriety, scalability &amp;amp; flexibility, security, features, community, administrative (support, monitoring &amp;amp; deployment), environment provisioning(installation, configuration, hosting offering), pricing, and documentation.&lt;br&gt;
&lt;strong&gt;API Composition / Aggregation&lt;/strong&gt;&lt;br&gt;
Some API requests in API Gateway map directly to single service API which can be served by routing request to the corresponding microservice. However, in the case of complex API operations that requires results from several microservices can be served by &lt;strong&gt;API composition/aggregation&lt;/strong&gt; (a scatter-gather mechanism). In case of dependency of one another service where synchronous communication is required, the chained composition pattern has to be followed. The composition layer has to support a significant portion of ESB/integration capabilities such as transformations, orchestration, resiliency, and stability patterns.&lt;br&gt;
A root container is deployed with the special distributor and aggregator functionalities (or microservices). The distributor is responsible for breaking down into granular tasks and distributing those tasks to microservice instances. The aggregator is responsible for aggregating the results derived by business workflow from composed microservice.&lt;br&gt;
&lt;strong&gt;API Gateway and Aggregation&lt;/strong&gt;&lt;br&gt;
API gateway with added features results in overambitious gateways that encourage designs that continue to be difficult to test and deploy. It is highly recommended to avoid aggregation and data transformation in the API Gateway. Domain smarts are better suited to be done in application code that follows the defined software development practices. Netflix API Gateway, Zuul 2 removed a lot of the business logic from Gateway that they had in Zuul to origin systems. For more details, refer here.&lt;br&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%2Fi%2F7lxp30b5naroypb34a3z.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%2Fi%2F7lxp30b5naroypb34a3z.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Service Mesh and API Gateway&lt;/strong&gt;&lt;br&gt;
Service mesh in microservices is a configurable network infrastructure layer that handles interprocess communication. This is akin to what is often termed as sidecar proxy or sidecar gateway. It provides a lot of functionalities such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Load Balancing&lt;/li&gt;
&lt;li&gt;Service Discovery&lt;/li&gt;
&lt;li&gt;Health Checks&lt;/li&gt;
&lt;li&gt;Security
&lt;strong&gt;On the surface, it appears as though API gateways and service meshes solve the same problem and are therefore redundant. They do solve the same problem but in different contexts&lt;/strong&gt;. API gateway is deployed as a part of a business solution that is discoverable by the external clients handling north-south traffic(face external client), however, service mesh handles east-west traffic (among different microservices).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Implementing service mesh avoids the resilient communication pattern such as circuit breakers, discovery, health checks, service observability in your own code. For a small number of microservices, alternative strategies for failure management should be considered as service mesh integration may overkill you. For a larger number of microservices, it will be beneficial.&lt;/p&gt;

&lt;p&gt;Combining these two technologies can be a powerful way to ensure application uptime and resiliency while ensuring your applications are easily consumable. Viewing two as a contemporary can be a bad idea and it is better to view two as being complementary to one another in deployments that involve both microservices and APIs.&lt;br&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%2Fi%2Fy2mzo1d2umx30shdwsnn.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%2Fi%2Fy2mzo1d2umx30shdwsnn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Considerations for API Gateway implementation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Possible single point of failure or bottleneck.&lt;/li&gt;
&lt;li&gt;Increase in response time due to additional network hop through API Gateway and risk of complexity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://microservices.io/index.html" rel="noopener noreferrer"&gt;https://microservices.io/index.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://docs.microsoft.com/en-us/azure/architecture/" rel="noopener noreferrer"&gt;https://docs.microsoft.com/en-us/azure/architecture/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/wso2/reference-architecture/blob/master/api-driven-microservice-architecture.md" rel="noopener noreferrer"&gt;https://github.com/wso2/reference-architecture/blob/master/api-driven-microservice-architecture.md&lt;/a&gt;&lt;br&gt;
&lt;a href="https://tsh.io/blog/design-patterns-in-microservices-api-gateway-bff-and-more/" rel="noopener noreferrer"&gt;https://tsh.io/blog/design-patterns-in-microservices-api-gateway-bff-and-more/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.infoq.com/articles/service-mesh-ultimate-guide/" rel="noopener noreferrer"&gt;https://www.infoq.com/articles/service-mesh-ultimate-guide/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://samnewman.io/patterns/architectural/bff/" rel="noopener noreferrer"&gt;https://samnewman.io/patterns/architectural/bff/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://netflixtechblog.com/" rel="noopener noreferrer"&gt;https://netflixtechblog.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>microservices</category>
      <category>programming</category>
      <category>cloud</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Redis, Kafka or RabbitMQ: Which MicroServices Message Broker To Choose?</title>
      <dc:creator>Assyahid Hasan Albana</dc:creator>
      <pubDate>Sat, 26 Dec 2020 17:04:40 +0000</pubDate>
      <link>https://forem.com/assyahid/redis-kafka-or-rabbitmq-which-microservices-message-broker-to-choose-55k8</link>
      <guid>https://forem.com/assyahid/redis-kafka-or-rabbitmq-which-microservices-message-broker-to-choose-55k8</guid>
      <description>&lt;p&gt;When using asynchronous communication for Microservices, it is common to use a message broker. A broker ensures communication between different microservices is reliable and stable, that the messages are managed and monitored within the system and that messages don’t get lost. There are a few message brokers you can choose from, varying in scale and data capabilities. This blog post will compare the three most popular brokers: RabbitMQ, Kafka and Redis.&lt;/p&gt;

&lt;h3&gt;
  
  
  Microservices Communication: Synchronous and Asynchronous
&lt;/h3&gt;

&lt;p&gt;There are two common ways Microservices communicate with each other: Synchronous and Asynchronous. In a Synchronous communication, the caller waits for a response before sending the next message, and it operates as a REST protocol on top of HTTP. On the contrary, in an Asynchronous communication the messages are sent without waiting for a response. This is suited for distributed systems, and usually requires a message broker to manage the messages.&lt;/p&gt;

&lt;p&gt;The type of communication you choose should consider different parameters, such as how you structure your Microservices, what infrastructure you have in place, latency, scale, dependencies and the purpose of the communication. Asynchronous communication may be more complicated to establish and requires adding more components to stack, but the advantages of using Asynchronous communication for Microservices outweigh the cons.&lt;/p&gt;

&lt;h3&gt;
  
  
  Asynchronous Communication Advantages
&lt;/h3&gt;

&lt;p&gt;First and foremost, asynchronous communication is non-blocking by definition. It also supports better scaling than Synchronous operations. Third, in the event Microservice crashes, Asynchronous communication mechanisms provide various recovery techniques and is generally better at handling errors pertaining to the crash. In addition, when using brokers instead of a REST protocol, the services receiving communication don’t really need to know each other. A new service can even be introduced after an old one has been running for a long time, i.e better decoupling services.&lt;/p&gt;

&lt;p&gt;Finally, when choosing Asynchronous operations, you increase your capability of creating a central discovery, monitoring, load balancing, or even policy enforcer in the future. This will provide you with abilities for flexibility, scalability and more capabilities in your code and system building.&lt;/p&gt;

&lt;h3&gt;
  
  
  Choosing the Right Message Broker
&lt;/h3&gt;

&lt;p&gt;Asynchronous communication is usually manages through a message broker. There are other ways as well, such as aysncio, but they’re more scarce and limited.&lt;/p&gt;

&lt;p&gt;When choosing a broker for executing your asynchronous operations, you should consider a few things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Broker Scale – The number of messages sent per second in the system.&lt;/li&gt;
&lt;li&gt;Data Persistency – The ability to recover messages.&lt;/li&gt;
&lt;li&gt;Consumer Capability – Whether the broker is capable of managing one-to-one and/or one-to-many consumers.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;One-to-One&lt;/strong&gt;&lt;br&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%2Fi%2Fx29q4vk0xyweoule3xec.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%2Fi%2Fx29q4vk0xyweoule3xec.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One-to-Many&lt;/strong&gt;&lt;br&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%2Fi%2Fy7c1x9bkwx7j1vfd7oom.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%2Fi%2Fy7c1x9bkwx7j1vfd7oom.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We checked out the latest and greatest services out there in order to find out which provider is the strongest within these three categories.&lt;/p&gt;

&lt;h3&gt;
  
  
  Comparing Different Message Brokers
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;RabbitMQ (AMQP)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Scale&lt;/strong&gt;: based on configuration and resources, the ballpark here is around 50K msg per second.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Persistency&lt;/strong&gt;: both persistent and transient messages are supported.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One-to-one&lt;/strong&gt; vs &lt;strong&gt;one-to-many consumers&lt;/strong&gt;: both.&lt;br&gt;
RabbitMQ was released in 2007 and is one of the first common message brokers to be created. It’s an open source that delivers messages through both point-to-point and pub-sub methods by implementing Advanced Message Queuing Protocols (AMQP). It’s designed to support complex routing logic.&lt;/p&gt;

&lt;p&gt;There are some managed services that allow you to use it as a SaaS but it’s not part of the native major cloud provider stack. RabbitMQ supports all major languages, including Python, Java, .NET, PHP, Ruby, JavaScript, Go, Swift, and more.&lt;/p&gt;

&lt;p&gt;Expect some performance issues when in persistent mode.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Kafka&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Scale&lt;/strong&gt;: can send up to a millions messages per second.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Persistency&lt;/strong&gt;: yes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One-to-one&lt;/strong&gt; vs &lt;strong&gt;one-to-many consumers&lt;/strong&gt;: only one-to-many (seems strange at first glance, right?!).&lt;/p&gt;

&lt;p&gt;Kafka was created by Linkedin in 2011 to handle high throughput, low latency processing. As a distributed streaming platform, Kafka replicates a publish-subscribe service. It provides data persistency and stores streams of records that render it capable of exchanging quality messages.&lt;/p&gt;

&lt;p&gt;Kafka has managed SaaS on Azure, AWS, and Confluent. They are all the creators and main contributors of the Kafka project. Kafka supports all major languages, including Python, Java, C/C++, Clojure, .NET, PHP, Ruby, JavaScript, Go, Swift and more.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Redis&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Scale&lt;/strong&gt;: can send up to a million messages per second.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Persistency&lt;/strong&gt;: basically, no – it’s an in-memory datastore.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One-to-one&lt;/strong&gt; vs &lt;strong&gt;one-to-many consumers&lt;/strong&gt;: both.&lt;/p&gt;

&lt;p&gt;Redis is a bit different from the other message brokers. At its core, Redis is an in-memory data store that can be used as either a high-performance key-value store or as a message broker. Another difference is that Redis has no persistency but rather dumps its memory into a Disk/DB. It’s also perfect for real-time data processing.&lt;/p&gt;

&lt;p&gt;Originally, Redis was not one-to-one and one-to-many. However, since Redis 5.0 introduced the pub-sub, capabilities boosted and one-to-many became a real option.&lt;/p&gt;

&lt;h3&gt;
  
  
  Message Brokers per Use Case
&lt;/h3&gt;

&lt;p&gt;We covered some characteristics of RabbitMQ, Kafka, and Redis. All three are beasts in their category, but as described, they operate quite differently. Here is our recommendation for the right message broker to use according to different use cases.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Short-lived Messages: Redis&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Redis’s in-memory database is an almost perfect fit for use-cases with short-lived messages where persistence isn’t required. Because it provides extremely fast service and in-memory capabilities, Redis is the perfect candidate for short retention messages where persistence isn’t so important and you can tolerate some loss. With the release of Redis streams in 5.0, it’s also a candidate for one-to-many use cases, which was definitely needed due to limitations and old pub-sub capabilities.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Large Amounts of Data: Kafka&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Kafka is a high throughput distributed queue that’s built for storing a large amount of data for long periods of time. Kafka is ideal for one to many use cases where persistency is required.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Complex Routing: RabbitMQ&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;RabbitMQ is an older, yet mature broker with a lot of features and capabilities that support complex routing. It will even support complex routing communication when the required rate is not high (more than a few tens of thousands msg/sec).&lt;/p&gt;

&lt;h3&gt;
  
  
  Consider Your Software Stack
&lt;/h3&gt;

&lt;p&gt;The final consideration, of course, is your current software stack. If you’re looking for a relatively easy integration process and you don’t want to maintain different brokers in a stack, you might be more inclined to work with a broker that is already supported by your stack.&lt;/p&gt;

&lt;p&gt;For example, if you’re using Celery for Task Queue in your system on top of RabbitMQ, you’ll have an incentive to work with RabbitMQ or Redis as opposed to Kafka who is not supported and would require some rewriting.&lt;/p&gt;

&lt;p&gt;We at Otonomo have used all the above through our platform evolution and growth and then some! It’s important to remember that each tool has its own pro &amp;amp; cons and it’s about understanding them and choosing the right tool for the job and that specific moment, situation and requirements.&lt;/p&gt;

</description>
      <category>microservices</category>
      <category>beginners</category>
      <category>messagebroker</category>
      <category>database</category>
    </item>
    <item>
      <title>2020-2021 Technology Outlook: Why Python Is Here to Stay</title>
      <dc:creator>Assyahid Hasan Albana</dc:creator>
      <pubDate>Fri, 25 Dec 2020 22:09:27 +0000</pubDate>
      <link>https://forem.com/assyahid/2020-2021-technology-outlook-why-python-is-here-to-stay-eb</link>
      <guid>https://forem.com/assyahid/2020-2021-technology-outlook-why-python-is-here-to-stay-eb</guid>
      <description>&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%2Fi%2F8idgrat24p5k0r3uoku2.jpeg" 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%2Fi%2F8idgrat24p5k0r3uoku2.jpeg" alt="Alt Text"&gt;&lt;/a&gt;ack Overflow&lt;/p&gt;

&lt;p&gt;SOURCE: Stack Overflow&lt;br&gt;
In 2020, the Python coding language is chosen by tech gods like Google and Reddit, Facebook, PayPal, Instagram, Netflix, and Dropbox. But achieving this success wasn’t easy. This achievement is explained by the fact that Python is a multi-purpose language that can be used for completing any programming task: mobile and web app development, scientific computing, game development, and system administration.&lt;/p&gt;

&lt;p&gt;Whether you’re about to join IT as a coder or interested in Python web development, here’s what you need to know about why Python language has no expiration date.&lt;/p&gt;

&lt;p&gt;It’s easy to learn&lt;br&gt;
Less time and resources are required for a beginner to learn and start implementing Python if we compare this programming language to Java or C++. Python is now called an accessible and straightforward language free of intricate guidelines or complex language syntax.&lt;/p&gt;

&lt;p&gt;At the time when C and C++ were dominant (and not very user-friendly) languages, Python was created with simplicity in mind. The core philosophy of the programming language’s syntax is based on three principles: readability counts, beautiful prevails over ugly, and simple beats complex. So it’s easy to figure out what the code does when you read it.&lt;/p&gt;

&lt;p&gt;It’s a high-level language&lt;br&gt;
What factor makes a programming language high-level? This is the number of layers of code that this language is away from machinery binary code. In other words, high-level languages are close to natural spoken and written languages.&lt;br&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%2Fi%2Ftegqqubj7d7xgabm91o5.jpeg" 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%2Fi%2Ftegqqubj7d7xgabm91o5.jpeg" alt="Alt Text"&gt;&lt;/a&gt; &lt;br&gt;
SOURCE: Security Stack Exchange  &lt;/p&gt;

&lt;p&gt;Python leads the list of high-level programming languages, leaving Ruby, Java, C,  and C++ behind. To form instructions, Python uses words that resemble abbreviations of English words. Developers prefer Python to other languages because while using the language to code, they can concentrate on the task itself instead of focusing on how the computer works.&lt;/p&gt;

&lt;p&gt;It’s cross-platform&lt;br&gt;
Cross-platform or platform-independent is one of the programming language features that allows a developer to run intermediate code on different OS. Coding in cross-platform languages like Python is rising in popularity. &lt;/p&gt;

&lt;p&gt;A Python software written on a Linux system will run on macOS and vice versa. If the Windows PC has the Python interpreter installed, the Python program will run on the Windows PC as well.&lt;/p&gt;

&lt;p&gt;It has exceptional scalability&lt;br&gt;
In the context of web applications, scaling stands for the app’s ability to accept more requests and visitors and have long-term support for security patches and bugs. This is why scalability is the key concern when building a new application. Even though the app can start off as rather small, it might grow large with time. &lt;br&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%2Fi%2Fyv9v39eq0dcafc5nyttm.jpeg" 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%2Fi%2Fyv9v39eq0dcafc5nyttm.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
SOURCE: Ncube &lt;/p&gt;

&lt;p&gt;To avoid code rewiring in the future, it’s essential to pick the right programming language and its framework. Python’s framework Django scales exceptionally. This is why Django is the choice of Spotify, Instagram, YouTube, Quora, Pinterest, and Disqus. But Django isn’t the only possible choice. Check out more about the top 13 Python frameworks to learn.&lt;/p&gt;

&lt;p&gt;It has hundreds of libraries&lt;br&gt;
Any programming language’s library is a set of pre-written reusable codes. Python’s library collection is huge and allows developers to use pre-written code saving time when developing a new program. With a freely-accessible pre-written code, developers working on big projects can significantly cut down the initial development cycle.&lt;/p&gt;

&lt;p&gt;In addition to standard libraries, Python has a few specific ones: those for natural language processing and machine learning. Most of the libraries are mature. Many of them have been battle-tested for over ten years.&lt;br&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%2Fi%2Fmkmlwh354tg8w4hluwhw.jpeg" 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%2Fi%2Fmkmlwh354tg8w4hluwhw.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
SOURCE:  Learn data science &lt;/p&gt;

&lt;p&gt;It offers excellent community support&lt;br&gt;
A Python developer stuck with a piece of code, shouldn’t be concerned about receiving relevant support. To start with, while most languages lack documentation, guides, and video tutorials, Python has this in abundance. And secondly, this is because Python has one of the strongest communities.&lt;/p&gt;

&lt;p&gt;Say a Python developer (beginner or expert) runs into a major issue in the middle of crunch time. Receiving timely help from an active community will help him escape delays. &lt;/p&gt;

&lt;p&gt;So what does a Python community look like? It includes international members with different experiences and skills who call themselves Python programming enthusiasts. They host meetups and conferences or arrange collaborations on code. The community uses mail lists to keep in touch with developers.&lt;/p&gt;

&lt;p&gt;Top 5 Python real-world applications&lt;br&gt;
What are the areas where Python programming plays a crucial role? With so many advanced features, Python has many applications, including:&lt;/p&gt;

&lt;p&gt;Web and mobile app development — Top Python frameworks used for web and mobile app development are Django, Pyramid, and Flask. These frameworks are packed with tools that simplify many tasks and help developers build apps at a rapid rate.&lt;/p&gt;

&lt;p&gt;Machine Learning and Artificial Intelligence — Development of ML and AI apps requires stable but flexible, secure, and well-equipped programming language. Since these four qualities are what Python is known for, this programming language is favored by ML and AI developers. In the field of AI and ML, Python’s most widely used packages are Seasborn, SciPy, Pandas, Numby, and Keras.&lt;/p&gt;

&lt;p&gt;Game development — Python’s extensions help with interactive game development. Basically, there are two Python-based extensions used for game engineering: PyGame and PySoy. They helped developers to build a basis for games like Civilization-IV, World of Tanks, and Battlefield 2.&lt;/p&gt;

&lt;p&gt;FinTech and the financial industry — Python currently dominates the pack of top programming languages when it comes to FinTech and the financial industry. World-known financial institutions like Bank of America have already transformed their tech stack to Python.&lt;br&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%2Fi%2Fm3yo717f4yaj6tr5mjoa.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%2Fi%2Fm3yo717f4yaj6tr5mjoa.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
SOURCE: Skill Crush &lt;/p&gt;

&lt;p&gt;Desktop graphical user interface development — Along with its ability to work on various OS, Python is also known for its modular architecture. Combined, these two features make Python a rather frequent choice for GUI app development. The list of best Python-based frameworks for GUI applications includes PyQt, WxPython, PyGtk, Tkinter, PySide, and Kivy.&lt;/p&gt;

&lt;p&gt;Python has been around for a while. Today, it is the choice of Netflix, Google, Dropbox, Stripe, Instagram, and Spotify. Indeed, Python is frequently referred to as a simple language. However, it’s also very powerful. And even though a developer starts easily, outgrowing Python isn’t as easy as outgrowing any other programming language. With this in mind, consider Python as our primer choice for software development.&lt;/p&gt;

</description>
      <category>python</category>
      <category>codequality</category>
      <category>machinelearning</category>
      <category>deeplearning</category>
    </item>
  </channel>
</rss>
