Skip to content

Commit 4016753

Browse files
author
Jerome Boyer
committed
update data integration
1 parent b9e2f1a commit 4016753

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

cassandra/cassandra-statefulset.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ spec:
1616
labels:
1717
app: cassandra
1818
spec:
19+
affinity:
20+
podAntiAffinity:
21+
requiredDuringSchedulingIgnoredDuringExecution:
22+
- topologyKey: kubernetes.io/hostname
23+
labelSelector:
24+
matchLabels:
25+
app: cassandra
1926
terminationGracePeriodSeconds: 1800
2027
containers:
2128
- name: cassandra
@@ -79,8 +86,7 @@ spec:
7986
name: cassandra-data
8087
spec:
8188
accessModes: ["ReadWriteOnce"]
82-
storageClassName: fast
8389
resources:
8490
requests:
85-
storage: 2Gi
91+
storage: 1Gi
8692

cassandra/cassandra-volumes.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ kind: PersistentVolume
44
metadata:
55
name: cassandra-data-1
66
labels:
7-
type: local
7+
type: glusterfs-storage
88
app: cassandra
99
spec:
1010
capacity:
11-
storage: 2Gi
11+
storage: 1Gi
1212
accessModes:
1313
- ReadWriteOnce
1414
hostPath:
@@ -20,11 +20,11 @@ kind: PersistentVolume
2020
metadata:
2121
name: cassandra-data-2
2222
labels:
23-
type: local
23+
type: glusterfs-storage
2424
app: cassandra
2525
spec:
2626
capacity:
27-
storage: 2Gi
27+
storage: 1Gi
2828
accessModes:
2929
- ReadWriteOnce
3030
hostPath:
@@ -36,11 +36,11 @@ kind: PersistentVolume
3636
metadata:
3737
name: cassandra-data-3
3838
labels:
39-
type: local
39+
type: glusterfs-storage
4040
app: cassandra
4141
spec:
4242
capacity:
43-
storage: 2Gi
43+
storage: 1Gi
4444
accessModes:
4545
- ReadWriteOnce
4646
hostPath:

docs/data/data-integration.md

+10
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,13 @@ There is no universal database solution to address the variety of data requireme
77
When we need to separate the write and read model, like by adapting CQRS, we need to pay attention on where the data are create first, where they should be persisted, and which representations are derived from which sources. For each target reads, what are the expected formats, and data locations?
88

99
The classical approach to keep different systems data consistent, is to use two phase commit transaction, and the orchestrator to keep the write operation in expected sequence. Alternate model is to use event sourcing to keep write order in a log.
10+
11+
## Transaction
12+
13+
We do not want to write another book on transaction, but this is important to keep the following in mind when addressing application design and architecture:
14+
15+
* With ACID transaction, atomicity, isolation and durability are database characteristics. Consistency is application specifics and depends on what the code set in the transaction.
16+
* ACID transaction is not about concurency (like it is in multithreading) but it is the ability to abort a transaction on error and have all writes from that transaction discarded.
17+
* ACID consistency is aimed to keep business logic invariants on the data. Database can guaranty foreign key and constraints, but not business logic invariants.
18+
* ACID isolation guarantees concurrently executing transactions are isolated from each other. They are serialized, which impact performance. So modern databases are using weaker algorithm for isolation.
19+
* ACID durability is to keep the data forever, so for single node, it is to write to harddisc, while with distributed database, a database must wait until all writes or replications are complete before claiming a transaction is successful.

0 commit comments

Comments
 (0)