<?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: Muhammad Usman</title>
    <description>The latest articles on DEV Community by Muhammad Usman (@usmanatx).</description>
    <link>https://dev.to/usmanatx</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%2F1791845%2F8b1b21b6-1c21-43d1-9e70-3d34568a3aec.jpg</url>
      <title>DEV Community: Muhammad Usman</title>
      <link>https://dev.to/usmanatx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/usmanatx"/>
    <language>en</language>
    <item>
      <title>System Architecture Design Methodologies Part 3</title>
      <dc:creator>Muhammad Usman</dc:creator>
      <pubDate>Fri, 26 Jul 2024 22:00:19 +0000</pubDate>
      <link>https://dev.to/usmanatx/system-architecture-design-methodologies-part-3-26lm</link>
      <guid>https://dev.to/usmanatx/system-architecture-design-methodologies-part-3-26lm</guid>
      <description>&lt;p&gt;This is the last part of our system architecture design methodologies series. Don’t forget to checkout &lt;a href="https://dev.to/usmanatx/system-architecture-design-methodologies-part1-3g6p"&gt;Part 1&lt;/a&gt; &amp;amp; &lt;a href="https://dev.to/usmanatx/system-architecture-design-methodologies-part-2-30le"&gt;Part 2&lt;/a&gt; as well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layered (n-tier) Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In simple words, this architecture divides a software system into layers. These layers are also called tiers. These layers help with managing, developing, and deploying the components. This architecture is mainly for large-scale applications where scaling is crucial, and managing the code is complex. The most common layers are&lt;/p&gt;

&lt;p&gt;User Interface/Presentation Layer&lt;/p&gt;

&lt;p&gt;Business Logic/Application Layer&lt;/p&gt;

&lt;p&gt;Data Access Layer (ADL)&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%2F362rvesga5horuuuvqgt.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%2F362rvesga5horuuuvqgt.png" alt="Layered (n-tier) Architecture" width="735" height="1057"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each layer has a specific role. This makes the code cleaner, independent, and easy to understand.&lt;/p&gt;

&lt;p&gt;Usability of the components and functionality increases because of the isolation.&lt;/p&gt;

&lt;p&gt;Maintainability and debugging become easier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Adding layers increases latency. This may hurt performance.&lt;/p&gt;

&lt;p&gt;Be mindful of using this architecture. You may overengineer if your application is small.&lt;/p&gt;

&lt;p&gt;If not careful, layers may become tightly coupled. This makes it difficult to modify and scale the system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CQRS (Command Query Responsibility Segregation)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It separates reading from writing. Reading  side handles queries (SELECT) whereas the writing side handles commands (create, update, and delete) CQRS is well-suited for e-commerce, finance, and real-time analytics systems. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;br&gt;
By separating the reading and writing on each side, it becomes independent and easy to scale.&lt;/p&gt;

&lt;p&gt;Separating concerns reduces complexity, making modifications straightforward.&lt;/p&gt;

&lt;p&gt;Testing and debugging becomes easier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;br&gt;
Data may not be consistent across all the nodes. This is especially true if there are multiple writers. &lt;/p&gt;

&lt;p&gt;This architecture relies on eventual consistency. The data may be stale, which might cause issues. &lt;/p&gt;

&lt;p&gt;It has a steep learning curve.&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%2F5jbk0m2ai7qe7qvals7z.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%2F5jbk0m2ai7qe7qvals7z.png" alt="CQRS (Command Query Responsibility Segregation)" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Peer-to-Peer Architecture (P2P)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;P2P is a decentralized network of interconnected components. In P2P, each node can function as both a client and a server simultaneously. In a P2P world, there is no central server or authority that can control or manage the flow of information. Instead, each node is responsible for its own data and communication. Bitcoin is a prime example of P2P architecture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;br&gt;
Because of its decentralized nature, there is no single point of failure.&lt;/p&gt;

&lt;p&gt;Scaling P2P is easy. You can add new nodes to the network without harming performance.&lt;/p&gt;

&lt;p&gt;P2P can reduce the need for large, costly infrastructure, which makes it cost-effective.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;P2P networks can be vulnerable to security risks because of its decentralized nature. &lt;/p&gt;

&lt;p&gt;P2P networks can raise legal issues. These include copyright infringement and data privacy problems. &lt;/p&gt;

&lt;p&gt;The quality of service can vary depending on the performance of the node.&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%2F8nf5g1uzy3rht2cwau3z.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%2F8nf5g1uzy3rht2cwau3z.png" alt="Peer-to-Peer Architecture (P2P)" width="800" height="668"&gt;&lt;/a&gt;**&lt;/p&gt;

</description>
    </item>
    <item>
      <title>System Architecture Design Methodologies Part 2</title>
      <dc:creator>Muhammad Usman</dc:creator>
      <pubDate>Thu, 18 Jul 2024 12:12:45 +0000</pubDate>
      <link>https://dev.to/usmanatx/system-architecture-design-methodologies-part-2-30le</link>
      <guid>https://dev.to/usmanatx/system-architecture-design-methodologies-part-2-30le</guid>
      <description>&lt;p&gt;This is part II of my previous post on System Design methodologies. In the previous post we discussed Monolithic, Microservice and Service Oriented architectures. Today we will learn about Domain Driven Design(DDD), Event-Driven Architecture (EDA) and Serverless architectures. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Domain-Driven Design (DDD):&lt;/strong&gt; Domain-Driven Design (DDD) creates software that mirrors business requirements precisely. It's like creating a map of the business world, and then using that map to build the software.&lt;/p&gt;

&lt;p&gt;DDD helps make sure that everyone is involved in building the software. The developers, stakeholders, and field experts all know what the software needs to do. This way, the software can be built to meet the real needs of the business, and not just what someone thinks it should do.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DDD emphasizes on understanding the business domain. &lt;/p&gt;

&lt;p&gt;It promotes creating modular software. The software is easy to maintain and adapt to business changes.&lt;/p&gt;

&lt;p&gt;It also encourages using aggregates to boost scalability and performance. They do so by cutting database queries and improving data consistency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DDD has a steep learning curve for developers. It takes a lot of time and effort to learn and use its principles.&lt;/p&gt;

&lt;p&gt;It can lead to a complex software system, particularly if not implemented correctly&lt;/p&gt;

&lt;p&gt;Implementing DDD can be expensive at first. It includes training, consulting, and development time. This may not be possible for all organizations.&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%2Fveu0de8ctjszuohrw9uy.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%2Fveu0de8ctjszuohrw9uy.png" alt="Domain-Driven Design (DDD" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Event-Driven Architecture (EDA)&lt;/strong&gt;: EDA is a framework that processes events and reacts to changes in a system. It does it asynchronously. In EDA, an event occurs when something happens or is about to happen. The event triggers a reaction in the system. Follow these steps to implement EDA.&lt;/p&gt;

&lt;p&gt;Identify the events that will trigger reactions in your system.&lt;/p&gt;

&lt;p&gt;Design the event handlers that will react to the identified events.&lt;/p&gt;

&lt;p&gt;Create an event bus that enables publishing and subscribing to events.&lt;/p&gt;

&lt;p&gt;Implement an event store that stores all the events that have occurred in the system.&lt;/p&gt;

&lt;p&gt;Test and debug your EDA system to ensure it works as expected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;EDA enables real time processing of events which helps in immediate processing&lt;/p&gt;

&lt;p&gt;It is easy to scale horizontally, more event handlers can be added into the system easily&lt;/p&gt;

&lt;p&gt;EDA is loosely coiled which makes it easy to modify and scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;EDA can introduce complexity particularly when there are multiple event producers.&lt;/p&gt;

&lt;p&gt;Debugging and testing are hard because the architecture is asynchronous. &lt;/p&gt;

&lt;p&gt;EDA systems can have issues with event versioning. Changes to event structure can break compatibility with existing handlers.&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%2Fm9ciqw90p0ynl72xsog3.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%2Fm9ciqw90p0ynl72xsog3.png" alt="Event-Driven Architecture (EDA)" width="800" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Serverless Architecture&lt;/strong&gt;: Serverless architecture is a cloud computing model. In it, the cloud provider manages the infrastructure. The developer only writes and runs code. The term "serverless" doesn't mean no servers exist. Instead, it means the developer doesn't need to provision or manage servers.&lt;/p&gt;

&lt;p&gt;In serverless architecture, the application is broken into small, separate functions. They can be run on demand. Programmers usually write these functions in a language like Node.js, Python, or Go. They deploy them to a cloud platform such as AWS Lambda, Google Cloud Functions, or Azure Functions.&lt;/p&gt;

&lt;p&gt;When a user makes a request, the cloud platform automatically provisions the resources. These resources include servers to run the function. The function is executed, and the result is returned to the user. Once the function has finished, it releases the resources. The developer only pays for the time and resources used while the function ran.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pay only for the time and resources used during the execution of the function. It become a cost-effective option.&lt;/p&gt;

&lt;p&gt;Serverless architectures can scale automatically to handle changes in traffic.&lt;/p&gt;

&lt;p&gt;Serverless architectures can be highly available. The cloud provider manages the infrastructure and ensures the application is always available.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first time a function is executed, it may take longer to start up, which can lead to slower response times.&lt;/p&gt;

&lt;p&gt;You may become locked into a specific cloud provider's ecosystem. It makes it difficult to move to another provider.&lt;/p&gt;

&lt;p&gt;Debugging and testing serverless applications can be challenging. Because the developer doesn't have direct access to the underlying infrastructure.&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%2Fx6lyig4vp40hf2aw79ae.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%2Fx6lyig4vp40hf2aw79ae.png" alt="Serverless Architecture" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>serverless</category>
      <category>eventdriven</category>
      <category>architecture</category>
    </item>
    <item>
      <title>System Architecture Design Methodologies Part1</title>
      <dc:creator>Muhammad Usman</dc:creator>
      <pubDate>Tue, 16 Jul 2024 21:16:34 +0000</pubDate>
      <link>https://dev.to/usmanatx/system-architecture-design-methodologies-part1-3g6p</link>
      <guid>https://dev.to/usmanatx/system-architecture-design-methodologies-part1-3g6p</guid>
      <description>&lt;p&gt;System Architecture Design Methodologies are like recipes for building complex systems. These methods provide a framework for architects to follow. They design the system for flexibility, simplicity, and consistent performance. Here are some common System Architecture Design Methodologies:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Monolithic Architecture:&lt;/strong&gt; This approach builds the entire system as a single, self-contained unit. It is often used for smaller applications or proof-of-concepts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Since there is a single codebase, it makes it easier to develop, test, and debug.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deployment is often faster and more straightforward.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is relatively easier to optimize performance because all components are co-located.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;A single codebase simplifies deployment, but hinders scaling. As the application grows, adding resources forces you to scale the entire application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Components are tightly coupled. This makes it hard to change them without affecting the whole system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It has a single point of failure.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Fet99cgsmwtahi0ng7ze2.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%2Fet99cgsmwtahi0ng7ze2.png" alt="Monolithic Architecture" width="800" height="477"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Microservice Architecture:&lt;/strong&gt; In this approach, a single application consists of many small services. They are independent and loosely coupled. Each service is designed to perform a specific task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You can easily scale up or down each microservice. You do this depending on if demand increases or decreases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If a particular microservice is down, the rest of the system will not be affected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Maintaining a smaller, independent component is easy. It is easier than making changes in a monolith repository.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Managing multiple services can be more complex than deploying a single application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tracing problems gets harder. You might need to search through many services to find the problem.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Services communicating over a network can increase latency. But, this may not be true in a monolith architecture.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Fb7wuop1ui9f4394xzqal.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%2Fb7wuop1ui9f4394xzqal.png" alt="Microservice Architecture" width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Service-Oriented Architecture (SOA):&lt;/strong&gt; SOA is a middle state. It is between monolith and microservices architectures. SOA takes a hybrid approach. It keeps some coupling between systems, but not as much as in a monolith. SOA typically involves large, complex services. They have a lot of business logic. Microservices are smaller and focused. They perform a specific task or function.&lt;br&gt;
&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Easier to implement than a microservice, as it requires less complex infrastructure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SOA is well-suited for small-scale applications that don't require much scalability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SOA has a centralized management approach, which makes governance easier.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;SOA services are often scaled vertically. This makes it hard to scale them horizontally.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SOA services are tightly coupled, making it harder to make changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The maintenance cost for SOA services could be higher if not set up properly.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2F230rw73lqoiido1vf961.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%2F230rw73lqoiido1vf961.png" alt="Service-Oriented Architecture (SOA)" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>microservices</category>
      <category>architecture</category>
      <category>designsystem</category>
    </item>
  </channel>
</rss>
