Go Advanced Training Camp (2)

Go Architecture Practice – Microservices (Microservice Usability Design)

Click me download: Go Advanced bootcamp extract horse: D17C

directory

Isolation timeout control Overload protection Flow limiting Degradation Retry Load balancing Best practices References

isolation

Isolation, in essence, is the separation of systems or resources, so that when a system failure occurs, the propagation scope and impact scope can be limited. That is, after a failure occurs, only the faulty service is unavailable, while other services are still available. Service isolation: dynamic/static separation, read/write separation Weight isolation: core, fast/slow, and hotspot physical isolation: threads, processes, clusters, and equipment rooms

Quarantine – Service quarantine

Static and static isolation: small to CPU cacheline false sharing, database mysql table design to avoid bufferpool frequent outdated, static table isolation, large to architecture design V (cmL46679910) in the image, static resources and other cache acceleration. Essentially the same idea, namely speed/cache access transformation frequency is small. For example, in the CDN scenario, the separation of static resources and dynamic APIS also reflects the idea of isolation: 1) Reduce the load of the application server, and the load of static file access is all through the CDN. 2) Object storage has the lowest storage cost. 3) Massive storage space, no need to upgrade the storage architecture. 4) Static CDN bandwidth acceleration and low delay.

Archive: Manuscript form, which stores the name, author, classification, tag, status and other information of the manuscript and represents the basic information of the manuscript. In a submission process, the frequency of changes is low once the manuscript is created. Archive_stat: statistical table of manuscripts, indicating the number of manuscripts played, liked, collected and coin-inserted, with relatively frequent updates. As the manuscript gets the flow, the manuscript is sent by the userV(cmL46679910), all kinds of counting information is updated frequently. MySQL BufferPool is used to cache the DataPage. DataPage is used to cache the rows of the table, so if you update the DataPage frequently, you will get a lower hit ratio, so you can still use the same idea in your table design. The main table is basically updated. The main table is not hit in the upstream Cache. The main table is still in the BufferPool Cache.

Read/write separation: master/slave, Replicaset, and CQRS.

Isolation – Light isolation

1. Resource pools for core isolation services are divided by Level (L0/L1/L2). 1) Core/non-core fault domain differential isolation (machine resources, dependent resources). 2) Multiple clusters: Use redundant resources to improve the throughput and DISASTER recovery capabilities.

We can think of the throughput of a service as a pool. When a sudden flood comes in, it takes a certain amount of time for the pool to be discharged. At this time, the time for other tributaries to stay in the pool depends on the previous discharge capacity, and the time will increase, affecting small requests. In the architecture of the log transport system, the entire stream is put into a Kafka topic (early design: better sequential IO), and there are different logids within the streamV(cmL46679910), logid will have different sink end, and they will have differential speed before. For example, HDFS jitter throughput drops, ES normal water level, and global data will have overall backpressure.

Isolation by latitude: sink, department, business, logid, importance (S/A/B/C). Business logs also belong to a logid, and the log level can serve as an isolation channel. 3. Hot Spot isolation what is hot spot? Hot spots are frequently accessed data. Many times you want to count the Top K accesses in a hotspot and cache their accesses. For example: small table broadcast: upgrade from Remotecache to LocalCache, app update regularly, and even make the operating platform support broadcast localCache refresh. atomic.Value

Active preheating: For example, when the live room page height is online, the bypass monitors active defense.

Isolation – Physical isolation

Thread isolation is mainly isolated by thread pools and is the basis of service isolation. The business is classified and handed over to different thread pools for processing. When a thread pool has a problem processing a business request, V (cmL46679910) will not spread the failure and affect other thread pools, ensuring the service is available. For Go, all IO are Nonblocking and are hosted to Runtime, blocking only Goroutine, not M. We only need to consider the control of total Goroutine, and do not need thread isolation of threading model language.