Service to get json data and write to database


#1

Hi,

sorry if my question sounds a bit stupid but I’m totally new to rust and never took a deep dive into any programming language. But this may change in the near future :slight_smile: .

As a starting point for further (hobby)development I want to…

… create a service(api client) which retrieves data(.json) from 2(or more) web apis with different structure for request and response. Then it should write the data with unified format into a db(redis). (data will be price quotes from currency exchanges)

I think this should be a quite common task?! Is there a howto or could someone give me a high level schema what I could use to achieve this?

I hope it is clear what I mean and someone can point me in the right direction… :wink:


#2

High level sketch/ideas:

  1. Use the reqwest crate for making http calls to get the json response.
  2. Use the serde_json crate to deserialize the json into rust types.
  3. Use some existing Redis client lib (check crates.io) to write to Redis.

#3

@vitalyd

thank you for your quick response. I wasn’t aware of the reqwest crate.