You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/04/02 01:52:12 UTC

[GitHub] [iotdb] SzyWilliam commented on a change in pull request #5396: [IOTDB-2833] Add readme to consensus

SzyWilliam commented on a change in pull request #5396:
URL: https://github.com/apache/iotdb/pull/5396#discussion_r840991737



##########
File path: consensus/README.md
##########
@@ -0,0 +1,122 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# Overview
+The Consensus Package provides the Consensus Layer's service definitions and its implementations.
+ 
+### What is Consensus Layer used for?
+Generally, We maintain multiple copies of application data for the purpose of fault-tolerance and data-integrity.
+There are variety of consensus algorithms to manage multiple copies of data, which differs in levels of data consistency and performance.
+Each consensus algorithm may have multiple industrial implementations.
+The Consensus Layer aims to hide all complications behind different consensus algorithms and implementations, providing higher level of abstraction to the user.
+
+# Consensus Layer
+### Basic Concepts
+
+* `IStateMachine` is the user application that manages a local copy of data.
+* `Peer` is the smallest consensus unit (inside a process), which holds a `IStateMachine` internally.
+* `ConsensusGroup` is a group of `Peer` all managing the same copy of data.
+* `IConsensus` interface defines the basic functionality provided by Consensus Layer. 
+
+User application can create a `ConsensusGroup` with k `Peer` to store data, 
+i.e. that there will be k copies of data.
+
+When write data into a `ConsensusGroup` using `IConsensus::write`, it will be sent to the group leader's `IStateMachine::write` . 
+The leader makes decision about this write operation, 

Review comment:
       okay, I'll fix the term.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org