Does microservice architecture make sense here?


#1

Hello

I have an app that requires syncing large amounts of data from external APIs.

This is done by polling each service every 30s - 60s, and then mapping over the response (10-100 items in each), so as to format them before inserting them into the database.

Currently, I only have a single application that handles managing publications and displaying the formatted API data, while also running the polling operations in the background.

I have run Kadira to check the performance, on just on development, with a single user, I will often incur a computation time of 500ms for each polling operation.

Would it make sense to move the external service syncing to a seperate microservice, that alone handles fetching new data, formatting it and then inserting into the (same) database?

Extra questions

  • How does microservices affect hosting costs?
  • Can I connect to the same database on both apps? (using Compose)
  • Good/bad idea? Alternatives?

Thanks