5 ms·
I'm not sure if FastAPI is the best competition for this library as it focuses on building REST APIs rather than JSON RPCs, but anyway great work!
by iddan 4y ago
I'm not sure if FastAPI is the best competition for this library as it focuses on building REST APIs rather than JSON RPCs, but anyway great work!
- pbreit 4y agoWhat is the difference between RPC and API besides the URL & payload structure?
- efdee 4y agoREST is based around resources and kind of the polar opposite of RPC when it comes to writing APIs.
- whalesalad 4y agoREST is literally RPC. You are making a remote procedure call to a URL. GET this resource. DELETE this resource. It's the same thing. What is the difference between remote.perform('some-action', { payload }) and remote.POST('some-action', payload) ?
- efdee 4y agoThere is no difference: neither of those are REST. Calling an URL with an action in the path name (rather than a resource name) is technically not done in REST -- the action is expressed through your HTTP verb. Using GET/POST/DELETE directly does not mean you're doing REST - there's a whole set of rules and assumptions that come with it.
- pbreit 4y agoIs it though? Or is the difference mostly semantics? At then end of the day it's just barely different ways for issuing a "command".
- lxe 4y agoIt's just semantics. "managing remote resources" or "calling remote procedures" is all just network calls, usually http.
- naasking 4y agoSemantics are 90% of programming though. Learning syntax is simple, learning semantics is hard. Semantics structure how you think about problems and express solutions.
- pbreit 4y agoBut in this case there is almost no difference. Basically same payloads with a slightly different "command" format.
- naasking 4y agoIt's the same payloads with a slightly different command format if you structure your program in exactly the same way. The point is that you don't structure your program in exactly the same way in each case.
- sirsinsalot 4y agoSemantics is 90% of life!
- dahfizz 4y agoThat's rather handwavy. The question is about a performance benchmark. From a performance standpoint, rpc and rest are the same (http requests that execute code on the server). The "semantics" you assign to one or the other don't change the technical details about implementation and performance.
- MuffinFlavored 4y ago> it's all just data > it's all just computers > we're all just going to die anyway
- ashvardanian 4y agoThank you! You are right, FastAPI doesn't promise performance. But on the other hand, they have super usable. We wanted to show, that libraries can be both usable and fast, hence the name of the post :)
- dan-robertson 4y agoThey say ‘high performance’ on their homepage: https://fastapi.tiangolo.com/ https://fastapi.tiangolo.com/
- sixo 4y agoyou would not be crazy to think the "Fast" refers to performance
- jeremycarter 4y agoA common pitfall. FastAPI is orders of magnitude slower than Java or .NET. A simple expressjs API outperforms it, especially with concurrent users.