aboutsummaryrefslogtreecommitdiffstats
path: root/example/VotingApp/README.md
diff options
context:
space:
mode:
authorTschaen, Brendan <ctschaen@att.com>2018-10-16 20:22:35 -0400
committerTschaen, Brendan <ctschaen@att.com>2018-10-16 20:27:37 -0400
commit46350c084766789ea59e83f1917c57c81d653048 (patch)
tree3463279fcee9c26d190d854324bbd7f86422fe2e /example/VotingApp/README.md
parent287bdcbb5482f94df091c3b7b766fed0007efa2e (diff)
Include Cassandra locking
Change-Id: I085acf8336d5f27782ee12768846a5befd3ee60d Issue-ID: MUSIC-148 Signed-off-by: Tschaen, Brendan <ctschaen@att.com>
Diffstat (limited to 'example/VotingApp/README.md')
-rw-r--r--example/VotingApp/README.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/example/VotingApp/README.md b/example/VotingApp/README.md
new file mode 100644
index 00000000..bcd37b9b
--- /dev/null
+++ b/example/VotingApp/README.md
@@ -0,0 +1,31 @@
+
+The voting app for MUSIC illustrates the features of MUSIC as a
+multi-site state management
+service. It is a program that
+maintains state in MUSIC in the form of a vote-count table that has two columns, the candidateName
+and his voteCount. To the external client that is using the voting app to update votes, the
+votingApp provides a simple function to update the
+votecount of the candidate in an exclusive manner. This is possible because of the locking service
+in MUSIC. Since each candidate is a key in MUSIC, the votingapp simply acquires the geo-distributed
+lock and only then upates the count. This guarantees correctness even when clients access different
+end-points across data centers. Further since state is replicated correctly across data-centers,
+even when one of the data centers fail, functioning can continue simply by using the MUSIC end point
+in the other data center.
+
+The main function in the VotingApp.java is emulating clients from different data centers by randomly
+chosing MUSIC end points. By updating vote counts
+randomly using different MUSIC end points and still receiving the correct total count when doing a
+read, the main function indicates the multi-site capability of MUSIC.
+
+
+To run the application, make sure you have onboarded the application using music's admin api.
+A curl call using the default values would be:
+curl -X POST \
+ http://localhost:8080/MUSIC/rest/v2/admin/onboardAppWithMusic \
+ -H 'Content-Type: application/json' \
+ -d '{
+"appname" : "votingapp",
+"userId" : "abc123d",
+"password" : "password",
+"isAAF" : false
+}'