SkipLabs / skip

Skip is a framework for building reactive services
https://skiplabs.io
MIT License
155 stars 10 forks source link

[skip/server] Split control service and streaming service. #515

Closed beauby closed 3 days ago

beauby commented 4 days ago

This commit changes the REST API of the skip server, making it listen on two separate ports, one for the public facing streaming API, and one for the backend-only control API (sync reads/writes and stream creation/deletion).

The control API (by default exposed on port 8081) is now:

The streaming API (by default exposed on port 8080) is now:

Splitting the two has several benefits:

beauby commented 4 days ago

I don't understand the description regarding "public facing streaming API" versus "backend-only control API". User clients will need to use both in order to set up, pull from, and close a stream, right?

No, only the streaming endpoint will be exposed to the outside world. The resource instantiation (POST /v1/streams) itself will be handled by the web app (by making a call to the control API on the backend's local network), and responding to the client with a redirect to the streaming endpoint.

Basically you can see the control API as analogous to a Postgres database connection, in that it is never exposed to the outside world directly.

It is "public-facing" versus "backend-only" that is confusing me. Any hints?

Does the above help?