25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

design.md 4.1 KiB

add docs to master (#284) * update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds * update ignore * add mkdocs.yml * update version to 2.4.3 * add about.md docs * add index.md docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * Fix resource files * add docs * add docs * add docs * Create readme.md * add markdown extensions supports * update about.md * add CNAME fiel * add img * update docs * Update README.zh-cn.md
5 년 전
add docs to master (#284) * update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds * update ignore * add mkdocs.yml * update version to 2.4.3 * add about.md docs * add index.md docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * Fix resource files * add docs * add docs * add docs * Create readme.md * add markdown extensions supports * update about.md * add CNAME fiel * add img * update docs * Update README.zh-cn.md
5 년 전
add docs to master (#284) * update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds * update ignore * add mkdocs.yml * update version to 2.4.3 * add about.md docs * add index.md docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * Fix resource files * add docs * add docs * add docs * Create readme.md * add markdown extensions supports * update about.md * add CNAME fiel * add img * update docs * Update README.zh-cn.md
5 년 전
add docs to master (#284) * update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds * update ignore * add mkdocs.yml * update version to 2.4.3 * add about.md docs * add index.md docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * Fix resource files * add docs * add docs * add docs * Create readme.md * add markdown extensions supports * update about.md * add CNAME fiel * add img * update docs * Update README.zh-cn.md
5 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Design
  2. ## Motivation
  3. With the popularity of microservices architecture, more and more people are trying to use microservices to architect their systems. In this we encounter problems such as distributed transactions. To solve these problems, I did not find simplicity and Easy to use solution, so I decided to create such a library to solve this problem.
  4. The original CAP was to solve the transaction problems in the distributed system. She used asynchronous to ensure that this weak consistency transaction mechanism achieved the eventual consistency of the distributed transaction. For more information, see section 6.
  5. Now in addition to solving distributed transaction problems, CAP's other important function is to use it as an EventBus. It has all of the features of EventBus and provides a more simplified way to handle publish/subscribe in EventBus.
  6. ## Persistence
  7. The CAP relies on the local database for persistence of messages. The CAP uses this method to deal with situations in which all messages are lost due to environmental or network anomalies. The reliability of messages is the cornerstone of distributed transactions, so messages cannot be lost under any circumstances.
  8. There are two types of persistence for messages:
  9. **1 Persistence before the message enters the message queue**
  10. Before the message enters the message queue, the CAP uses the local database table to persist the message. This ensures that the message is not lost when the message queue is abnormal or the network error occurs.
  11. In order to ensure the reliability of this mechanism, CAP uses database transactions with the same business code to ensure that business operations and CAP messages are strongly consistent throughout the persistence process. That is to say, in the process of message persistence, the database of any abnormal situation will be rolled back.
  12. **2 Persistence after messages enter the message queue**
  13. After the message enters the message queue, the CAP starts the persistence function of the message queue. We need to explain how the message of the CAP in RabbitMQ and Kafka is persistent.
  14. For message persistence in RabbitMQ, CAP uses a consumer queue with message persistence, but there may be exceptions to this and take part in 2.2.1.
  15. Since Kafka is inherently designed to persist messages using files, Kafka ensures that messages are correctly persisted without loss after the message enters Kafka.
  16. ## Communication Data Streams
  17. The flow of messages in the CAP is roughly as follows:
  18.  >2.2 version before
  19. ![](http://images2017.cnblogs.com/blog/250417/201708/250417-20170803174645928-1813351415.png)
  20. > "P" represents the sender of the message (producer). "C" stands for message consumer (subscriber).
  21. **After version 2.2**
  22. In the 2.2 and later versions, we adjusted the flow of some messages. We removed the Queue table in the database and used the memory queue instead. For details, see: [Improve the implementation mechanism of queue mode](https://github.com/dotnetcore/CAP/issues/96)
  23. ## Consistency
  24. The CAP uses the ultimate consistency as a consistent solution. This solution follows the CAP theory. The following is the description of the CAP theory.
  25. C (consistent) consistency refers to the atomicity of data. It is guaranteed by transactions in a classic database. When a transaction completes, the data will be in a consistent state regardless of success or rollback. In a distributed environment, consistency is Indicates whether the data of multiple nodes is consistent;
  26. A (availability) service is always available, when the user sends a request, the service can return the result within a certain time;
  27. P (Partition Tolerance) In distributed applications, the system may not operate due to some distributed reasons. The good partition tolerance makes the application a distributed system but it seems to be a functioning whole.
  28. According to ["CAP" distributed theory](https://en.wikipedia.org/wiki/CAP_theorem), in a distributed system, we often reluctantly give up strong consensus support for availability and partition fault tolerance, and instead pursue Ultimate consistency. In most business scenarios, we can accept short-term inconsistencies.
  29. Section 6 will introduce this further.