Browse Courses

Application Architecture

An examination of application architecture types including monolithic microservices, and component-based approaches. The article discusses the characteristics of effective components - reusability, replaceability independence, extensibility, encapsulation, and context-neutrality - and provides real-world examples of architectural components like APIs controllers, and UI elements.

Application architecture is the process of defining the framework of an application. It involves making decisions about the application's components, their relationships, and how they interact with each other. A well-designed application architecture can improve the performance, scalability, and maintainability of an application.


Application Architecture

Application architecture is the process of defining the framework of an application. It involves making decisions about the application’s components, their relationships, and how they interact with each other. A well-designed application architecture can improve the performance, scalability, and maintainability of an application. Two common types of application architecture are monolithic and microservices.

Monolithic Architecture

In a monolithic architecture, all the components of an application are tightly coupled and run as a single unit. This means that all the code for the application is contained in a single codebase and deployed as a single package. Monolithic architectures are simple to develop and deploy, but they can be difficult to scale and maintain as the application grows.

Microservices Architecture

In a microservices architecture, an application is broken down into smaller, independent services that communicate with each other over a network. Each service is responsible for a specific function of the application and can be developed, deployed, and scaled independently. Microservices architectures are more complex to develop and deploy, but they offer greater flexibility, scalability, and resilience.

Component-Based Architecture

Component-based architecture focuses on the decomposition of the design into the logical components. It provides a higher level of abstraction than object-oriented designs. The architecture defines, composes, and implements loosely coupled independent components so they work together to create an application.

Characteristics of a Component

A component is an individual unit of encapsulated functionality that serves as a part of an application in conjunction with other components. There are six characteristics of components: reusable, replaceable, independent, extensible, encapsulated, and non-context specific.

    graph TD;
	    Component --> Reusable
	    Component --> Replaceable
	    Component --> Independent
	    Component --> Extensible
	    Component --> Encapsulated
	    Component --> Non-context-specific

Examples of Components

An API can be packaged as a component if it is reusable across different systems and applications. For example, an open-source API can connect a system to a specific database. Another example is a data access object (DAO) that allows switching databases without the application being aware of the change.

A controller is another type of component. It decides which other components need to be called for a particular event and manages the flow of data between components.

A user interface (UI) component is another example. It encapsulates the visual and interactive aspects of an application, such as buttons, forms, and dialogs, and can be reused across different parts of the application or in different applications.

Components vs. Services

A service is like a component, also a unit of functionality, but it is designed to be deployed independently and reused by multiple systems. A service focuses on a solution to a business need. A key difference between a component and a service is that a service will only have one unique, always running instance with whom multiple clients communicate.

In a layered architecture, services are made of components and components consist of objects. A service is also a type of component but it is meant to be deployed independently of the overall system. Examples of services include: checking a customer’s credit, calculating a monthly loan payment, or processing a mortgage application.

Service-Oriented Architecture (SOA)

In an SOA, services are loosely coupled and interface with each other via a communication protocol over a network. SOA supports building distributed systems that deliver services to other applications through the communication protocol.

Distributed Systems

A distributed system is a system with multiple services located on different machines that coordinate interactions by passing messages to each other via a communication protocol such as HTTP. Even though the services in a distributed system operate on multiple machines, it appears to the end-user as a single coherent system. A distributed system shares resources such as hardware, software, and data. They are fault-tolerant, meaning if a node or service fails, the system continues to run, implying that the system may change during execution without service interruption. Multiple activities run concurrently on a distributed system, reducing latency and increasing throughput.

Another property of distributed systems is that they are scalable as the number of users increases. The computers running the distributed system do not need to use the same kind of hardware or operating systems. A distributed system may be made up of different kinds of computers and programming languages. A node is any device on a network that can recognize, process, and transmit data to other nodes on the network. A distributed system consists of multiple interconnected nodes where the nodes are running one or more services in an SOA.

Distributed systems generally use one or more of the following basic types of architecture: 1.

  1. Client-server
  2. Three-tier
  3. Peer-to-peer
  4. Microservices

Conclusion

  • Components are reusable, independent, replaceable, extensible, encapsulated, and non-context specific.
  • Component-based architecture is the decomposition of the system into logical independent components.
  • Services are made of components, and components consist of objects.
  • Services are deployed independently and can be reused by multiple systems.
  • In an SOA, services are loosely coupled and interface with each other via a communication protocol over a network.
  • Distributed systems run on multiple services on different machines and they appear to the end-user as a single coherent system.

FAQ

Application architecture is the process of defining the framework of an application. It involves making decisions about the application’s components, their relationships, and how they interact with each other.

In a monolithic architecture, all the components of an application are tightly coupled and run as a single unit. This means that all the code for the application is contained in a single codebase and deployed as a single package.

In a microservices architecture, an application is broken down into smaller, independent services that communicate with each other over a network. Each service is responsible for a specific function of the application and can be developed, deployed, and scaled independently.

Component-based architecture focuses on the decomposition of the design into logical components. It provides a higher level of abstraction than object-oriented designs and defines, composes, and implements loosely coupled independent components.

A component is an individual unit of encapsulated functionality that serves as a part of an application in conjunction with other components. Characteristics include being reusable, replaceable, independent, extensible, encapsulated, and non-context specific.

A service is like a component but is designed to be deployed independently and reused by multiple systems. Services focus on solving business needs and have a unique, always-running instance.

In an SOA, services are loosely coupled and interface with each other via a communication protocol over a network. SOA supports building distributed systems that deliver services to other applications.

A distributed system is a system with multiple services located on different machines that coordinate interactions by passing messages to each other via a communication protocol. It appears to the end-user as a single coherent system.

Basic types of distributed system architecture include client-server, three-tier, peer-to-peer, and microservices.