A New Multiregion Demo
To accompany Lee Surprenant’s article Configure and run a multiregion Bluemix application with IBM Cloudant and Dyn and my last post on the bluemix-cloudant-replicator, Lee and I decided to create a better demo app to demonstrate Cloudant replication at work. This new app allows users to create and delete “Post Cards” across regions. For guidance on deploying the multiregion demo application watch the video below:
As mentioned above, the app has two main capabilities:
- To add a new card to the database simply click the button located in the bottom-left of the screen that says “Leave a card.”
- You may also clear the database by clicking the button in the bottom-right of the screen labeled “Clear all cards.”
When a card is created, a random “stamp” is assigned to the card using Lorempixel.com. This image should help you locate your card when you visit the other regions. It is also worth mentioning that the background images change according to the time of day. Using the Weather Insights service on Bluemix, we determine the solar position for each region and render an appropriate image.
We aimed to keep the code for this demo concise and easy to read, but to do so we did make some sacrifices. The most notable being the absence of dynamic card rendering. While it would be nice for the cards to dynamically appear in other regions without a page refresh, we did not want to complicate the code anymore than what was necessary to show Cloudant replication. We’d love your thoughts on the project and encourage people to visit our repo. The repository is under an MIT License, so feel free to fork it and hack away!