freno
freno copied to clipboard
Suggested API
Starting with the most basic usage, this Issue will present would-be API endpoints.
-
/write-request/<app-name>/<store-type>/<store-name>
This is the primary requestfreno
would serve: an app connecting and asking "is it OK to write?". examples:-
/write-request/spokes/mysql/maincluster
-
/write-request/gh-ost/mysql/othercluster
Initially we will only support the
mysql
store-type. Other stored may be added in the future. -
Further comments to this issue will present other API endpoints
Hey @shlomi-noach I was thinking on providing sensible defaults to be able to spike new applications or services that require throttling functionality, without requiring configuration changes on freno itself. Thus, a request to:
-
<ENDPOINT_ROOT>/<storage-name>
- Would default to storage type mysql, and an anonymous application, for the given storage. (Disabling anonymous - unregistered- applications, could be a matter of configuration too) -
<ENDPOINT_ROOT>/<storage-name>/<app-name>
- Would default to storage type myql, for the given application and storage. -
<ENDPOINT_ROOT>/<storage-name>/<app-name>/<storage-type>
- Would specifiy all the variables.
Also, is there any reason why we prefer to call <ENDPOINT_ROOT>
write-request
instead of the shorter write
?
@miguelff I was also thinking about defaults, and what I'm concerned about is that we would add an application that calls the API without specifying an app-name
, and then another one and another one, and would never update the apps to specify their names, because that's life, and end up with lots of calls we're not sure where they came from.
Or maybe I'm just being pessimistic.
At least, we could keep the existing URI and just have the apps use the name default
for app-name
.
Same can go for mysql
Also, is there any reason why we prefer to call <ENDPOINT_ROOT> write-request instead of the shorter write?
No particular reason. If we find that shorter URIs make a substantial savings for network, we can alias it as much as we like. We can then go for w
for writes, m
for mysql
etc.
Update: we have /check
instead of /write-request
:
-
/check/<app-name>/<store-type>/<store-name>
- example:
/check/gh-ost/mysql/main7
TODO:
- [ ] API documentation page