CAP teoremasi (Brewer teoremasi)
Qonunlar 0 06.08.2023 203

CAP teoremasi (Erik Brewer tomonidan aniqlangan) taqsimlangan ma'lumotlar ombori uchun quyidagi uchta kafolatdan faqat ikkitasi (ko'pi bilan) berilishi mumkinligini aytadi:

  • Muvofiqlik: ma'lumotlarni o'qiyotganda, har bir so'rov eng so'nggi ma'lumotlarni oladi yoki xato qaytariladi
  • Mavjudligi: ma'lumotlarni o'qiyotganda, har bir so'rov xato bo'lmagan javob oladi, bu eng so'nggi ma'lumotlar ekanligiga kafolatsiz
  • Bo'limga tolerantlik: tugunlar orasidagi tarmoq so'rovlarining ixtiyoriy soni bajarilmasa, tizim kutilganidek ishlashda davom etadi.

Fikrlashning o'zagi quyidagicha. Tarmoq bo'limi sodir bo'lmasligiga kafolat berishning iloji yo'q (qarang: The Fallacies of Distributed Computing). Shuning uchun, bo'lim bo'lsa, biz operatsiyani bekor qilishimiz mumkin (bardoshlilikni oshirish va mavjudlikni kamaytirish) yoki davom etishimiz (mavjudlikni oshirish, lekin izchillikni kamaytirish).

Ism kafolatlarning birinchi harflaridan kelib chiqadi (Muvofiqlik, mavjudlik, bo'linish tolerantligi). Shuni esda tutingki, bu ACID  bilan bog'liq emasligini bilish juda muhim, bu izchillikning boshqa ta'rifiga ega. Yaqinda PACELC teoremasi ishlab chiqildi, bu tarmoq bo'linmaganda (ya'ni, tizim kutilganidek ishlayotganda) kechikish va izchillik uchun cheklovlar qo'shadi.

Ko'pgina zamonaviy ma'lumotlar bazasi platformalari ma'lumotlar bazasi foydalanuvchisiga yuqori darajada mavjud bo'lgan operatsiyani (bu "iflos o'qishni" o'z ichiga olishi mumkin) yoki juda izchil operatsiyani (masalan, "kvorum tomonidan tan olingan yozish") tanlash imkoniyatini taklif qilish orqali ushbu teoremani bilvosita tan oladi. ').

Haqiqiy dunyo misollari:

Inside Google Cloud Spanner and the CAP teoremasi - Cloud Spanner qanday ishlashi haqida batafsil ma'lumot beradi, bu dastlab CAPning barcha kafolatlariga ega bo'lgan platformaga o'xshab ko'rinadi, ammo kaput ostida CP tizimi mavjud.

Shuningdek qarang:

Klarkning uchta qonuni: Clarke's three laws on Wikipedia

Britaniyalik ilmiy fantastika yozuvchisi Artur C. Klark Klarkning uchta qonuni deb nomlanuvchi uchta iborani ishlab chiqdi. Uchinchi qonun eng mashhur va eng ko'p keltiriladigan qonundir.

Bu qonunlar deb ataladi:

  • Taniqli, ammo keksa olim biror narsa mumkin, deb aytsa, ular deyarli to'g'ri. Ular biror narsaning iloji yo'qligini aytishganda, ular noto'g'ri bo'lishi mumkin.
  • Imkoniyat chegaralarini kashf qilishning yagona yo'li - ulardan biroz o'tib, imkonsiz narsaga kirishishdir.
  • Har qanday etarlicha ilg'or texnologiyani sehrdan ajratib bo'lmaydi.
CAP Theorem (Brewer's Theorem)
Qonunlar 0 06.08.2023 203

The CAP Theorem (defined by Eric Brewer) states that for a distributed data store only two out of the following three guarantees (at most) can be made:

  • Consistency: when reading data, every request receives the most recent data or an error is returned
  • Availability: when reading data, every request receives a non error response, without the guarantee that it is the most recent data
  • Partition Tolerance: when an arbitrary number of network requests between nodes fail, the system continues to operate as expected

The core of the reasoning is as follows. It is impossible to guarantee that a network partition will not occur (see The Fallacies of Distributed Computing). Therefore in the case of a partition we can either cancel the operation (increasing consistency and decreasing availability) or proceed (increasing availability but decreasing consistency).

The name comes from the first letters of the guarantees (Consistency, Availability, Partition Tolerance). Note that it is very important to be aware that this does not relate to ACID, which has a different definition of consistency. More recently, PACELC theorem has been developed which adds constraints for latency and consistency when the network is not partitioned (i.e. when the system is operating as expected).

Most modern database platforms acknowledge this theorem implicitly by offering the user of the database the option to choose between whether they want a highly available operation (which might include a 'dirty read') or a highly consistent operation (for example a 'quorum acknowledged write').

Real world examples:

See also:

Clarke's three laws

Clarke's three laws on Wikipedia

Arthur C. Clarke, an british science fiction writer, formulated three adages that are known as Clarke's three laws. The third law is the best known and most widely cited.

These so-called laws are:

  • When a distinguished but elderly scientist states that something is possible, they are almost certainly right. When they state that something is impossible, they are very probably wrong.
  • The only way of discovering the limits of the possible is to venture a little way past them into the impossible.
  • Any sufficiently advanced technology is indistinguishable from magic.