To provide your mobile applications with centrally controlled configuration you need a backend service that can provide the applications with this. I developed and open sourced a backend service that provide this functionality, and this code is now made available as a service in Open Source Cloud.
This means that you don’t have to have your own cloud infrastructure to get started but you always have the option to do so as it is open source. In this blog post I will walk you through how you setup this service in Open Source Cloud.
Step 1: Create an account
If you already have an account at Open Source Cloud you can skip this step.
Head over to www.osaas.io and create a free account. Follow the procedure and create a new tenant.
Step 2: Create a Key / Value Store
To store the configuration variables we will use a Redis compatible key/value store called Valkey. This is also open source and has been made available as a service in Open Source Cloud.
There is of course nothing preventing you from using a Redis cloud service for this instead but in this post we will use services available in Open Source Cloud.
When you have logged on to the platform and created your tenant, go to browse and search for “valkey” and click on the card in the search result.
Click on the button “Create valkey” and give this instance a name. What name you choose is not important now.
Write down the IP and port found on the instance card for the Valkey instance that you just created.
Step 3: Create a configuration backend
Now it is time to create the configuration service backend. Navigate back to browse and search for “application config” and click on the card named “Application Config Service”.
Now press button “Create config-service” and enter a name of the config backend service and the Redis URL to the Valkey instance you created. Construct the Redis URL using the prefix redis://
and the IP and port you noted down earlier.
Wait until the service is ready and status “running” and then you can click on the instance card.
Insert a new configuration value by clicking on the Add new button in the top right corner. As an example we create a configuration variable called “hello” and with the value “world”.
Press create button and you will find the variable in the list.
Step 4: Use the configuration in your application
To get the address to the configuration value click on the “Copy to clipboard” icon and you can use this address in your application to fetch the variable.
As an example we can write this simple web application (entered in codepen.io):
Conclusion
You no longer need to build and host your own backend to provide the applications with configuration variables with this open source project available as a service in Open Source Cloud.