vendredi 6 mars 2020

Separating webserver and processing server

I would like an architecture design advice.

I have a projet composed of a public Node.JS API server (handling client HTTP browser requests)

The purpose of my project is to convert an image to a video (I do this using ffmpeg as CLI and it can take some time)

The business workflow should be the the following:

1) A user sends an image URL and his email (as POST parameters) to the API

2) The API should responds "OK 200" and send later an email containing a video of the image

Here is my idea (and what my current program does):

1) The nodeJS API directly responds "OK 200" to the client

2) The nodeJS server asynchronously downloads the image using npm axios library, then saves that image to current directory, then asynchronously launchs a heavy tool that convert the image to a video (can take some time), then sends an email to the client.

In my design everything occurs on the same server (NodeJS API). I think this isn't a good design at all and I should separate the Nodejs HTTP API and the heavy tasks video processing server. However, this separation means communicating image from a server to another one and i don't know how to do that.

I think there are useful services that I could use on AWS but I don't know which one and how.

Would it be possible to help me in the design of this application (and which cloud services could I use ?)

Aucun commentaire:

Enregistrer un commentaire