In this use-case, we’ll explore two inescapable concepts when it comes to developing production-grade backend systems: API endpoints and database storage. We’ll walk you through each step of the way.
There’s a saying amongst developers that all applications are purely frontends to a database, thus highlighting the importance of 2 things: storage of course, but also communication concepts and protocols allowing for different parts of an application to efficiently ‘talk together’. Here comes the point where we’re surely thinking about APIs.
In this very straightforward case, we’ll illustrate these two concepts from end to end: using a simple Ryax-generated API to pass on zipped .json files through HTTP POST requests. After receiving these files we’ll launch a very simple ‘average’ script for simplicity’s sake. Last step is to push the result .csv file into a MariaDB database. All this using Ryax’s low-code interface, with pre-built bricks that you can find in our dedicated public repository: https://gitlab.com/ryax-tech/workflows/api-json-mariadb
Here’s how it will look like in Ryax:
Let’s quickly describe each step:
- Magic-api: low-code pre-built API trigger that we will use two ways: to read the content of the database; and to launch a simple json script that injects data into the base.
- Analyze-json-files: this step uncompresses a .zip with .json files and computes the mean value for every parameter list, and generate a result .csv file with final data ready to inject in the database.
- Insert-csv-db: this last step will read the resulting .csv file and insert a new entry in the MariaDB database table for each line.
Why did we choose MariaDB for this example, you may ask? Well, MariaDB is an open-source, community-developed (which we love) fork of the world standard MySQL. Which means it is super generic to work with, highly supported and stable… and that’s all we need 🙂
The first thing we have to do to begin with is get an access to a Ryax instance. You can either use our free public demo instance or even ask for a free private platform just for yourself (comes with a time limit). Either way, here’s where to start: https://ryax.tech/try-ryax
Full text version coming soon… (the complete tutorial is also available in the video above)