Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the implementation of distributed system in web?

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "what is the implementation of distributed systems in web". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Implementation of distributed system

A, RPC (dubbo) b, spring cloud

Consistency problem of distributed system

Single system

Database consistency is guaranteed by transaction ACID

Database multi-versioning is implemented based on MVCC, using hidden row transactions ID and rollback pointers

Compare the version number of a transaction whose ID is less than or equal to that of a transaction when querying within a transaction

Consistency in a distributed system means that all data backups have the same value at the same time.

The reason for the inconsistency of the distributed system is that the system has been split. Our system is no longer a stand-alone system but a distributed system. Network transmission is unreliable.

The scene mainly has the following aspects

1. Synchronous call timeout

2. Asynchronous callback timeout

3. Inconsistency between cache and database

Solution

CAP and BASE theory

TCC mode: (in the case of issuing an order withholding inventory) lock the inventory first and pay to deduct the inventory.

Guarantee final consistency

Query mode: the client provides a query interface to obtain the status. You can use this mode during the timeout.

Compensation mode: starts to retry compensation after failure, and notifies the staff if it cannot be compensated

Asynchronous assurance mode: the asynchronous operation is encapsulated and persisted in storage, and then notifies other systems through a timer

Periodic check mode: check data consistency on a regular basis through tasks

The server guarantees the idempotency of the interface.

Write the database to the cache first (if you operate the cache first, a copy of the old data will be cached when there is a request before it is entered the database)

The thought of Service Governance

1. Service registration and discovery

2. Service load balancing

3. Service log collection

4. Link monitoring

5. Request gateway zuul

7. Service fault tolerance

8. Service configuration

This is the end of the content of "what is the implementation of distributed system in web". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report