官术网_书友最值得收藏!

Chapter 2. Simple Chain

At first sight, chains might look a little intimidating. Often, there is a lot of code which can be difficult to go through when you are trying to identify particular problems or issues. But fear not, things are not as bad as they seem. Chains are useful and can reduce a number of potential issues.

In many systems, problems are hidden in the form of scheduled tasks that rely on one task to be completed before the next task is started. A nice example of this is a cold backup, which is performed in three individual sections:

  1. Shut down the database.
  2. Copy the database files to a remote location.
  3. Start up the database.

In the example above, when the cold backup was implemented, step 2 originally took four minutes. Therefore, the administrator decided that step 3 could be started five minutes after step 1 was completed. However, after a few weeks the database grew bigger and the copy phase of the backup took 20 minutes. This is what we might call a time bomb. Everything looks as though it is working fine. The database will run after the backup is completed and data files apparently get copied to a remote location. However, what will happen if the storage is hit by a power failure? In this case, a good backup is needed. But this backup does not exist because the original timings are no longer valid. Had the backup been implemented using a chain, this disaster could easily have been prevented. This chapter will show how this can be done.

主站蜘蛛池模板: 德庆县| 眉山市| 顺义区| 通辽市| 平凉市| 龙海市| 山阴县| 白城市| 布尔津县| 阿图什市| 茂名市| 乐亭县| 云龙县| 浮梁县| 鸡东县| 龙陵县| 凤城市| 岑巩县| 鄄城县| 晋州市| 清徐县| 江山市| 墨脱县| 湾仔区| 通化县| 新昌县| 湖北省| 遵义县| 华亭县| 新龙县| 大姚县| 绥宁县| 宁都县| 奉新县| 博罗县| 建阳市| 锦州市| 吉木萨尔县| 武乡县| 井陉县| 仁怀市|