4 ms·
Why should a server limit itself to a single client? At some point, you might want to make a mobile app companion to your site, or you might white-label your se
by zdragnar 4y ago
Why should a server limit itself to a single client? At some point, you might want to make a mobile app companion to your site, or you might white-label your services in partnership with another company who will need to use your APIs, or any number of other common scenarios.
A hobbyist / small company doesn't need to have RESTful APIs. The whole point is to design them so that they play well with others, and when you get to that point, you (or more likely the people who depend on you) will wish you had.
- ClumsyPilot 4y ago> you might white-label your services in partnership with another company who will need to use your APIs, As soon as you have a third party using your API things get another layer of conplexity: do you charge them? Do you rate limit them? if you have several partners, how do you authenticate them? etc. API gateway solve some of that, and sometimes you dont care, but generally its not as sinple as goving your internal API to people and telling them to go wild
- zdragnar 4y agoOf course it isn't that simple- most of the additional challenges you mentioned are business problems, though, not technical, and are generally orthogonal to the actual design of the API. The biggest hurdle to opening up your API is usually needing to move from a single tenant to a multi-tenant architecture in your database. Some tenants will have regulatory burdens you need to meet, and your early adopters will likely have a slew of requests that you'll need to decide on- do you risk tailoring your application to their needs with features future clients won't want? To these last points, I think RESTful architecture helps, rather than hinders, but YMMV.