Graph reachability depends on topology and failures. Under a partition, consistency-first behavior may reject writes while availability-first behavior permits divergent replicas.
Before operating the equipment or executing the program, derive the expected outcome using the required theoretical work in Experiment. Use the diagram to identify the variables and system boundaries.
BC-M03 · Academic orientation
Scope and objectives
Scope of the experiment
Compare a consistency-first replicated store against an availability-first store during a network partition. Explore disintermediation, replication and the CAP trade-off.
The focus of this experiment is to compare replication, decentralization and consistency assumptions. Students then trace partition scenarios under the stated CAP model, and justify availability and consistency trade-offs. The Concepts view explains the operation before the practical work; the Simulation view is used to examine reference and changed inputs, not to substitute for actual measurements.
Learning objectives
Compare replication, decentralization and consistency assumptions.
Trace partition scenarios under the stated CAP model.
Justify availability and consistency trade-offs.
Identify the configured inputs (Network participants; Topology; Network condition; Replication policy; New replica value) and record the corresponding observed outputs with units where applicable.
Compare the reference calculation or decision with an independent implementation or authorized observation; state any discrepancy and the applicable model boundary.
Expected learning outcomes
On completion, students can compare replication, decentralization and consistency assumptions, trace partition scenarios under the stated CAP model, and justify availability and consistency trade-offs.
Required deliverables
Submit the derivation or state trace for the named operation, the exact reference and changed configurations, the associated simulator or practical evidence, and a short validation statement addressing justify availability and consistency trade-offs. Separate predicted values from observations.
Prerequisite knowledge and related learning
Review the foundational terminology in Concepts and confirm readiness using the existing setup instructions. After completion, continue to Blockchain domain and membership.
Environment and experimental methodology
The listed browser model and experiment-specific local Python, Solidity or EVM workflow, where provided. Do not treat a model as a deployed ledger.
Begin with a manual prediction, record the baseline, change one independent condition at a time, and compare the resulting trace or measurements with the original prediction. Record observations and uncertainty separately from reference values. Follow the experiment’s specific procedure, safety limits, and acceptance checks.
Scientific theory · Replication and partition trade-offs
Decentralization distributes control or work among participants; a replicated store maintains multiple copies. Under a partition, CAP's consistency property concerns a single-copy view, while availability requires responses from nonfailed nodes. A consistency-first policy can reject operations rather than permit divergent states. Reconciliation after recovery needs a conflict policy.
Worked example and engineering interpretation
Replicas A and B start at 10. A write of 42 during a partition can be rejected by a consistency-first policy or accepted on A under an availability-first policy, leaving B at 10. The example is a simplified teaching store, not a complete distributed consensus protocol.
Engineering principles · additional worked teaching example
A partition interrupts communication between replicas. Consistency means clients observe the specified coherent state; availability means non-failing nodes respond under the model. During a partition a strong-consistency design may reject writes; an available design may reconcile divergent histories.
From theory to experiment
Predict the reference result before operating the workbench; check the actual intermediate state, units and constraints. The existing simulation, implementation and procedure below are distinct sources of evidence.
Worked engineering reasoning and boundary conditions
Engineering reference configuration: Network participants = 8; Topology = ring; Network condition = partition; Replication policy = CP; New replica value = 42; DHT content key = sensor-A; DHT owner retained content = true. In the classroom model, Reachable from first live node = 4; Write accepted = No; Replica A = 10; Replica B = 10; Content retrievable = Yes. The model separates network reachability, write availability, replica agreement and content persistence. Two-replica single-writer reconciliation and bounded graph/DHT model; not a distributed consensus or IPFS implementation.
Use the diagram to follow the calculation or state progression. Keep the teaching configuration separate from the independent exercise values; compare observations with the actual model and implementation.
Concept animation · topology and link dependencies
Explore the teaching example independently of the simulator. Each step reveals an operation, data relationship or calculated state. The Simulation view has separate editable inputs.
Step 1 of 6 · Connection 1
Connection 1
Link 1
0 → 1 · link
Connection 2
Link 1
0 → 1 · link
Link 2
1 → 2 · link
Connection 3
Link 1
0 → 1 · link
Link 2
1 → 2 · link
Link 3
2 → 3 · link
Connection 4
Link 1
0 → 1 · link
Link 2
1 → 2 · link
Link 3
2 → 3 · link
Link 4
4 → 5 · link
Connection 5
Link 1
0 → 1 · link
Link 2
1 → 2 · link
Link 3
2 → 3 · link
Link 4
4 → 5 · link
Link 5
5 → 6 · link
Connection 6
Link 1
0 → 1 · link
Link 2
1 → 2 · link
Link 3
2 → 3 · link
Link 4
4 → 5 · link
Link 5
5 → 6 · link
Link 6
6 → 7 · link
Teaching example only; inspect live calculations or real practical evidence separately.
How to investigate Decentralization, replication and CAP
Compare a consistency-first replicated store against an availability-first store during a network partition. Explore disintermediation, replication and the CAP trade-off.
Analytical investigation means collecting an observation, identifying the mechanism, using a calculation or state trace to explain it, and checking your conclusion against evidence. Controlled comparison means changing one independent variable, holding the remaining relevant conditions constant, and measuring a dependent variable against a baseline. Experimental validation means comparing a predicted result to a reproducible observation or assertion; agreement inside a model does not certify hardware. Evidence-based reasoning connects a specific observation to a theoretical rule and states uncertainty, not merely an opinion. Performance characterization records a named metric and its units across conditions; sensitivity analysis changes one parameter across several values. A threat assessment links an asset, threat, consequence and evidence to a mitigation.
Experiment-specific guided practice
Objective: Compare a consistency-first replicated store against an availability-first store during a network partition. Explore disintermediation, replication and the CAP trade-off.
Use ring, eight nodes and partition. Inspect edges, connected components and the two replica values. CP rejects a write of 42 while partitioned.
Switch only policy to AP. Observe A=42 and B=10 before recovery; after recovery the model propagates the single accepted write.
Restore healthy connectivity and compare CP and AP writes.
Choose star and fail hub, then choose mesh under the same failed node. Compute reachable live nodes for each topology.
Reference check: CP blocks the isolated write; AP accepts it locally and replicas temporarily differ. Recovery restores agreement under the stated policy.
Model boundary: Two-replica teaching abstraction with one writer and explicit last-version reconciliation, not a production distributed database.
Independent task and submission evidence
2. Switch only policy to AP. Observe A=42 and B=10 before recovery; after recovery the model propagates the single accepted write. Record the named input, prediction, actual output and one limitation; restore the original condition and repeat.
Before execution write the independent variable and its levels, dependent observation with units where applicable, baseline, controlled variables, measurement method and expected result. For a state machine use state/event/output rather than inventing a numeric metric. Record failures and repeat the baseline. A weak conclusion is “it works”; a supported conclusion names the changed setting, observed value/state, corresponding rule and one limitation.
Trial
Changed setting
Fixed settings
Predicted result
Actual observation / units
Evidence / uncertainty
A: baseline
Reference
Record
Predict
Record
Record
B: one change
Record
Same as A
Predict
Record
Record
A: repeat
Restore
Same as A
Predict
Record
Record
Completion: submit the filled table, relevant simulator screenshot or terminal/notebook output, reasoning with units/assumptions, and one limitation. Preserve the independent assessment questions; this guide does not fill their answers.
Compare a consistency-first replicated store against an availability-first store during a network partition. Explore disintermediation, replication and the CAP trade-off.
Learning goals
Explain the mechanism using the actual intermediate states in this experiment.
Predict and verify the reference and modified conditions described below.
Interpret the acceptance criteria and identify the limits of the model.
Module flashcards · 12 questions
Browse all 12 questions and explanationsWhat is a network partition?
A communication failure that prevents replicas from exchanging messages.
What does CP sacrifice in this model?
Availability of writes during the partition to preserve consistency.
What does AP sacrifice here?
Immediate consistency between replicas.
Why define a conflict policy?
Recovery requires a deterministic way to reconcile divergent state.
Does CAP mean a system can never have all three properties?
The trade-off is required under a partition; healthy networks can provide both consistency and availability.
What is disintermediation?
Removing an intermediary from a service workflow.
Why is competition not full decentralization?
Selecting among intermediaries can reduce monopoly without removing intermediaries.
Why is the recovery rule deliberately limited?
A single-writer last-version rule does not solve concurrent multi-writer conflict resolution.
With healthy CP and a new value of 42, what do A and B store?
Both store 42.
With partitioned CP, what happens to the write of 42?
It is rejected; both replicas retain 10.
With partitioned AP, what are the values before recovery?
A stores 42 and B retains 10.
After recovery in this experiment, why do replicas agree?
The single-writer last-version reconciliation rule propagates the accepted value.
Loading experiment-specific apparatus…Previous model / additional reference tools
Loading computational workbench…
Independent theoretical exercises
Before the simulation or practical, solve both experiment-specific tasks. List the given inputs, show the intermediate calculation or state trace, identify the expected observation, and state a limitation. Show formulas and intermediate calculations where relevant, or draw the requested state/sequence diagram. These are independent classroom fixtures; where they differ from the reference configuration below, do not treat them as measured values. Compare your predictions with the corresponding experiment afterwards.
01 · Predict and derive using the given inputs
For an eight-node ring with two opposite links removed, draw the components and count reachable nodes from node 0.
Engineering method — A partition interrupts communication between replicas. Consistency means clients observe the specified coherent state; availability means non-failing nodes respond under the model. During a partition a strong-consistency design may reject writes; an available design may reconcile divergent histories. Apply this method to the assigned values independently; compare your reasoning with the relevant simulator or practical implementation.
02 · Compare or justify using evidence
Trace a write of 42 to one component under CP and AP teaching policies; explain reconciliation and how a DHT owner departure changes availability.
Engineering method — A partition interrupts communication between replicas. Consistency means clients observe the specified coherent state; availability means non-failing nodes respond under the model. During a partition a strong-consistency design may reject writes; an available design may reconcile divergent histories. Apply this method to the assigned values independently; compare your reasoning with the relevant simulator or practical implementation.
03 · Scenario analysis
Scenario analysis · Independent work
Six replicas split 4+2 and require four acknowledgements to commit. Which partition can commit? Explain why availability to all clients is not guaranteed.
Scenario analysis — A partition interrupts communication between replicas. Consistency means clients observe the specified coherent state; availability means non-failing nodes respond under the model. During a partition a strong-consistency design may reject writes; an available design may reconcile divergent histories. Apply this method to the assigned values independently; compare your reasoning with the relevant simulator or practical implementation.
Work is saved locally when browser storage is available. Export it for submission; no remote upload or automatic grade is assigned.
Expanded independent theoretical exercise bank
Progress from calculation and interpretation to diagnosis and controlled engineering design. Complete the questions without opening the simulation first; show intermediate steps.
Intermediate · Explain a changed-input result
Independent theoretical exercise · BC-M03-01
Use the reference configuration (Network participants = 8; Topology = ring; Network condition = partition; Replication policy = CP; New replica value = 42; DHT content key = sensor-A; DHT owner retained content = true), but change Network participants = 10. The model reports Reachable from first live node = 5. Explain the governing rule and assumptions that make this output plausible; identify an independent verification method.
Intermediate · Quantitative comparison
Independent theoretical exercise · BC-M03-02
Two model observations of Reachable from first live node are 4 (reference) and 5 (changed condition). Compute signed change and, when the reference is nonzero, percentage change. Explain why units matter.
Intermediate · Interpret a technical trace
Independent theoretical exercise · BC-M03-03
For Network condition = hub failed, the model supplies this excerpt from Replica state:
Stage · A · B · Agreement
Initial · 10 · 10 · Yes
After write · 42 · 42 · Yes
After link recovery · 42 · 42 · Yes
Compute the range (maximum minus minimum) of the A column in these rows. Identify the maximum observation. Do not extrapolate beyond these rows.
Advanced · Reverse reasoning
Independent theoretical exercise · BC-M03-04
An observation is Reachable from first live node = 7. Candidate A uses Network participants = 8; Topology = ring; Network condition = partition; Replication policy = CP; New replica value = 42; DHT content key = sensor-A; DHT owner retained content = true. Candidate B changes the listed settings (Network condition = hub failed) and keeps the remaining settings fixed. Which is consistent with the observation? If both can explain it, say what additional evidence is required.
Advanced · Diagnose a reported mismatch
Independent theoretical exercise · BC-M03-05
A student configures Replication policy = AP while preserving all other reference settings, but copies the reference report of Write accepted = No. Evaluate whether the report is justified. Identify the first configuration/output check to perform.
Challenging · Design a controlled verification
Independent theoretical exercise · BC-M03-06
Design a controlled comparison for Decentralization, replication and CAP using reference Network participants = 8; Topology = ring; Network condition = partition; Replication policy = CP; New replica value = 42; DHT content key = sensor-A; DHT owner retained content = true and test Network participants = 10. Specify the changed setting(s), measured metric Reachable from first live node, controls, repetitions, an acceptance check and what evidence can distinguish an actual implementation from the model.
Step-by-step experimental procedure
Measure decentralization trade-offs under node loss, partition and independent storage failures.
1 · Reference workbench configuration
Use the named reference workbench and its reference inputs. Additional live instruments may have different controls; use the matching instrument. Record virtual and practical results separately.
Network participants8
Topologyring
Network conditionpartition
Replication policyCP
New replica value42
DHT content keysensor-A
DHT owner retained contentYes
2 · Perform the investigation in order
Use ring, eight nodes and partition. Inspect edges, connected components and the two replica values. CP rejects a write of 42 while partitioned.
Switch only policy to AP. Observe A=42 and B=10 before recovery; after recovery the model propagates the single accepted write.
Restore healthy connectivity and compare CP and AP writes.
Choose star and fail hub, then choose mesh under the same failed node. Compute reachable live nodes for each topology.
Change DHT key and inspect SHA-derived slot and successor. Switch retained content off: route availability is not data availability.
Design a DApp using an on-chain commitment, off-chain store and independent computation; identify which subsystem remains centralized.
3 · Compare controlled trials
Trial
Independent change
Expected check
Observation
Partitioned CP
Use reference inputs above
Write accepted: No; Replica A: 10; Replica B: 10
Record actual result
Partitioned AP
Replication policy = AP
Write accepted: Yes; Replica A: 42; Replica B: 10
Record actual result
Healthy CP
Network condition = healthy
Replica B: 42
Record actual result
Failed star hub
Topology = star; Network condition = hub failed
Reachable from first live node: 1
Record actual result
Missing content
DHT owner retained content = No
Content retrievable: No
Record actual result
4 · Analyze and report
Explain CAP consistency versus availability during a partition, and separate storage persistence from routing.
Model boundary: Two-replica single-writer reconciliation and bounded graph/DHT model; not a distributed consensus or IPFS implementation.
Controlled investigation · reproducible evidence
Method. Use the existing reference workbench configuration and the named controlled changes below. A controlled variable stays fixed while the independent variable is intentionally changed; the dependent variable is the resulting observed output. First predict each trial from the Concepts page. Run the baseline, then change only the specified setting and record the outcome. For deterministic traces one execution per case and a repeated verification are sufficient; for timing or stochastic measurements repeat at least five times, recording each run, median and range. Reset to the reference state between independent comparisons.
Trial
Independent change
Dependent observation
Partitioned CP
Use reference inputs above
Record actual outcome and units
Partitioned AP
Replication policy = AP
Record actual outcome and units
Healthy CP
Network condition = healthy
Record actual outcome and units
Failed star hub
Topology = star; Network condition = hub failed
Record actual outcome and units
Evidence: attach the completed comparison table, one trace or screenshot per condition, and actual practical terminal/hardware evidence where applicable. Explain any prediction mismatch and distinguish modeled behavior from measured results.
Download this notebook and open Google Colab. Select File → Upload notebook and choose the downloaded .ipynb.
Read the Markdown instructions before each executable cell. Use a Python runtime, run cells from top to bottom, and resolve imports if necessary.
Perform the baseline and controlled changes. Save the notebook with actual outputs and your written interpretation.
Execution scope: Two-replica teaching abstraction with one writer and explicit last-version reconciliation, not a production distributed database. Default computational cells passed isolated local Python execution; physical equipment and live services require separate verification.
01Instructions · Markdown
# BC-M03 · Decentralization, replication and CAP
**PSUT IoT Engineering Studio — Dr. Mohammad Alja’afreh**
## 1. Scientific objective
Measure decentralization trade-offs under node loss, partition and independent storage failures.
Complete the analytical worksheet in the portal first. Record your predictions before running this notebook. This notebook is a bounded local computational investigation; use the portal’s separate WSL, hardware or Remix procedure for real interfaces.
02Instructions · Markdown
## Experiment-specific preparation
Compare a consistency-first replicated store against an availability-first store during a network partition. Explore disintermediation, replication and the CAP trade-off.
**Reference procedure (use the matching simulator/WSL tool where named, not an unrelated service):**
1. Use ring, eight nodes and partition. Inspect edges, connected components and the two replica values. CP rejects a write of 42 while partitioned.
2. Switch only policy to AP. Observe A=42 and B=10 before recovery; after recovery the model propagates the single accepted write.
3. Restore healthy connectivity and compare CP and AP writes.
4. Choose star and fail hub, then choose mesh under the same failed node. Compute reachable live nodes for each topology.
5. Change DHT key and inspect SHA-derived slot and successor. Switch retained content off: route availability is not data availability.
**Evidence:** CP blocks the isolated write; AP accepts it locally and replicas temporarily differ. Recovery restores agreement under the stated policy.
**Boundary:** Two-replica teaching abstraction with one writer and explicit last-version reconciliation, not a production distributed database.
03Instructions · Markdown
## 2. Reference configuration and investigation
1. Use ring, eight nodes and partition. Inspect edges, connected components and the two replica values. CP rejects a write of 42 while partitioned.
2. Switch only policy to AP. Observe A=42 and B=10 before recovery; after recovery the model propagates the single accepted write.
3. Restore healthy connectivity and compare CP and AP writes.
4. Choose star and fail hub, then choose mesh under the same failed node. Compute reachable live nodes for each topology.
5. Change DHT key and inspect SHA-derived slot and successor. Switch retained content off: route availability is not data availability.
6. Design a DApp using an on-chain commitment, off-chain store and independent computation; identify which subsystem remains centralized.
Run cells in order; do not substitute model results for physical measurements.
04Instructions · Markdown
## 3. Model a partition with two independent replicas.
05Python · executable cell
PYTHON · Code cell
# =====================================================================
# BC-M03 | Code cell 01 | Decentralization, replication and CAP
# Purpose: 3. Model a partition with two independent replicas.
# Inputs: the explicit fixture/settings below and any preceding cell state.
# Output: inspect printed values, returned records or assertions; record evidence.
# =====================================================================
# Define the reusable operation write; keep its logic separate from the trial.
def write(policy,partition,new=42):
a=b=10
if policy=="CP" and partition:return a,b,False
a=new
if not partition:b=a
return a,b,True
# Check the expected invariant so a mismatch fails visibly instead of appearing successful.
assert write("CP",True)==(10,10,False)
# Check the expected invariant so a mismatch fails visibly instead of appearing successful.
assert write("AP",True)==(42,10,True)
# =====================================================================
# BC-M03 | Code cell 02 | Decentralization, replication and CAP
# Purpose: 4. Compare recovery and key placement.
# Inputs: the explicit fixture/settings below and any preceding cell state.
# Output: inspect printed values, returned records or assertions; record evidence.
# =====================================================================
import hashlib
# Set (a, b, accepted) for the next computation or reference condition.
a,b,accepted=write("AP",True); b=a if accepted else b
# Check the expected invariant so a mismatch fails visibly instead of appearing successful.
assert a==b==42
# Repeat the same operation for each configured input so observations are comparable.
for key in ("sensor-A","sensor-B"):print(key,int.from_bytes(hashlib.sha256(key.encode()).digest(),"big")%8)
## Experimental analysis and submission
1. Record the reference input, predicted output and actual result.
2. Modify one independent variable and run the relevant cells again.
3. Explain the result using the theory and identify model limitations.
4. Save the notebook with outputs and retain the separate theoretical worksheet.
**Your derivation and conclusion:**
(Complete independently.)
09Instructions · Markdown
## Guided reasoning and evidence
A controlled comparison changes one independent input while keeping the other relevant inputs fixed; the dependent variable is the recorded output. Use this lab’s reference condition above.
**Independent task:** 2. Switch only policy to AP. Observe A=42 and B=10 before recovery; after recovery the model propagates the single accepted write. Record the named input, prediction, actual output and one limitation; restore the original condition and repeat.
| Trial | Input/configuration | Prediction | Observation | Evidence / limitation |
|---|---|---|---|---|
| A | Reference | | | |
| B | Changed input | | | |
| A repeat | Reference | | | |
A conclusion is supported only when it cites the recorded values or observed states and explains them with the experiment theory.
Formative assessment
Explain the following without looking at the simulation output, then reveal the reference response.
What is a network partition?
A communication failure that prevents replicas from exchanging messages.
What does CP sacrifice in this model?
Availability of writes during the partition to preserve consistency.
What does AP sacrifice here?
Immediate consistency between replicas.
Why define a conflict policy?
Recovery requires a deterministic way to reconcile divergent state.
Applied task
Inject a partition, first with CP then AP; compare accepted writes and replica versions.
Submit your reference and modified observations with a justification.
The original tutor and adaptive examination retain their existing 102-lab catalogue. Use the module-specific study questions above and copy this contextual prompt into your chosen AI assistant if needed.
Explain the engineering mechanism in BC-M03 · Decentralization, replication and CAP. My task: Compare a consistency-first replicated store against an availability-first store during a network partition. Explore disintermediation, replication and the CAP trade-off.. Acceptance: CP blocks the isolated write; AP accepts it locally and replicas temporarily differ. Recovery restores agreement under the stated policy.. Model boundary: Two-replica teaching abstraction with one writer and explicit last-version reconciliation, not a production distributed database.. Ask me for my actual observations and distinguish model predictions from real measurements.
Shared research workbenches · network designer & advanced studiesConcurrent-device simulation & Monte Carlo research