Application of abstraction in system design – System Design 02

system-design-system design-application of abstraction in system design-hogantech-hoganblab

What is abstract?

Abstract concepts can help us hide some irrelevant details during system design, allowing us to focus on the overall architecture. It is important to break away from details, because abstraction can hide the complexity within the system design, allowing us to focus more on the results of the system design.

In today's information-rich world, we all use computers to work, but we don't build hardware and develop operating systems from scratch. We use computers to do the job at hand rather than delving all the way into building systems.

Kits are also used as an example here. Software engineers often use kits that have been written by others to develop large systems. So if everyone had to develop their own kit, everyone wouldn't be able to get their work done. On the contrary, if we use a package that has been written by others, then we only need to focus on the development of other functions, which is equivalent to an abstract concept. The "suite" provides a simple interface to use the functions and hides their Internal details of how this is implemented. A good abstraction allows developers to reuse it across multiple projects with similar needs.

database abstraction

Transactions are a database abstraction. When a large number of users read, write or modify data at the same time, Transactions hide many problems and only provide a simple interface. For example: in case of success Can continue, but abort in case of failure. Either way, the data is moved from a consistent state to a new consistent state (Consistency).

Such an abstract concept allows users to not have to worry about high concurrency (High Concurrent) data modification, but can focus on business logic (Business Logic).

Abstraction in decentralized systems

Abstractions in decentralization help engineers simplify their work and relieve them of the burden of dealing with the underlying complexities of distributed systems.

The abstract concept of distributed systems has become more and more popular as many technology giants such as Amazon AWS, Google Cloud and Microsoft Azure provide cloud services for distributed systems. Different levels of abstraction. The services of these distributed systems are also directly provided to users without actually understanding them, such as: CDN, Storage... The advantage of this is that users only need to focus on program development, rather than spending a lot of time understanding how to implement some system components from scratch.

Network abstraction: Remote Procedure Calls

Here I refer to the Chinese naming of IBM's documentation, and also refer to the followingdocument.

What is RPC?

"Remote Procedure Call (RPC)" is a communication protocol that provides a reference example of high-level communication used in operating systems. It can also be said to be an inter-process communication protocol widely used in distributed systems. In the OSI model of network communication, RPC spans the network transport layer and the network application layer.

IBM's detailed explanation is also provided here: RPC assumes the existence of a low-level transmission protocol, such as Transmission Control Protocol/Internet Protocol (TCP/IP) or User Data Packet Protocol (UDP), to send messages between communication programs material. RPC implements a logical client-to-server communication system designed to support web applications.

How does RPC work?

When we perform an RPC, the calling environment is first paused and the process parameters are sent over the network to the environment where the process will be executed. When the procedure execution is complete, the results are returned to the intercall environment and execution resumes like a regular procedure call.

Let us take the Client Side – Server Side program as an example. The RPC program can be divided into the following parts. Here I use Microsoft official documentationPictures for display:

system-design-02-RPC

The RPC system consists of Client, Client Stub and an RPC running service running on the client machine. Server, Server Stub and an RPC running service run on the server machine.

RPC applications in real life

RPC is used in many real-world services. Take a look at the examples given below:

Google

Google GCP, a well-known cloud service, will use RPC for some parts of the distributed system. they developed gRPC, an open source framework that uses RPC to build more efficient, high-performance decentralized systems. Used in services such as Google Search, YouTube, etc., this RPC application enables the entire software system to establish connections and communications between different system components to achieve more efficient and stable connections.

Facebook

Most of Facebook's services use Thrift To perform RPC, some storage systems use Thrift to serialize records on disk (Serializing Record). This RPC application also has several benefits. For example, interoperability and interoperability can be carried out between different programming languages, such as the connection between Python client and C++ server.

Conclusion

Here are some key points:

Abstraction is a concept that helps us hide irrelevant details when designing a system, allowing us to focus on the overall architecture.

Abstraction can hide the complexity within the system design, allowing us to focus more on the results of the system design.

Database abstraction, distributed system abstraction, and network abstraction are all applications of abstract concepts.

RPC is a communication protocol that provides a reference example of high-level communication used in operating systems.

RPC is used in many real-world services, such as Google GCP and Facebook.

Quote

IBM RPC Document

Microsoft – How RPC Works

Google GRPC

Facebook Thrift

Other article

Introduction to Modern System Design - System Design 01

Do you really know Monorepo? 5 minutes to learn about front-end mega-architecture.

Why do big companies use Nx ? Monorepo Tool 5 Minute Quick Build

2023 Yahoo! Software Engineer Software Engineer Interview

Leave a Comment

Your email address will not be published. Required fields are marked *

en_USEnglish