summaryrefslogtreecommitdiffstats
path: root/examples/VotingApp/README.md
diff options
context:
space:
mode:
authorTschaen, Brendan (bt054f) <bt054f@att.com>2018-06-26 16:32:37 -0400
committerTschaen, Brendan (bt054f) <bt054f@att.com>2018-06-26 16:44:59 -0400
commit5a28a331688c5578fef9c64d462d07cbae6797da (patch)
tree038fd0c1bb56bf652d574778504f1bf4cb0f4ccf /examples/VotingApp/README.md
parent5e5d6ed9badebfbc1cc65a90e3de8dad232f9e42 (diff)
Add voting app example
Change-Id: Ife1e6ea10cf74e3495ed72bc14a77179665ca327 Issue-ID: MUSIC-82 Signed-off-by: Tschaen, Brendan (bt054f) <bt054f@att.com>
Diffstat (limited to 'examples/VotingApp/README.md')
-rw-r--r--examples/VotingApp/README.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/VotingApp/README.md b/examples/VotingApp/README.md
new file mode 100644
index 00000000..bcd37b9b
--- /dev/null
+++ b/examples/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
+}'