Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@hexc REST is simplex on the other hand websocket is duplex. A server can send data to the client on will.
-
Yeah totally...I think REST is probably the best method of constructing web services, thus far. Doesn't mean its as good as it gets, but a far cry from the dark days of SOAP. When you had to jump through hoops just to get hello world from the remote server. I think GraphQL looks interesting and would love the opportunity to try it out on a project. So will be keeping an eye on that one.
-
The problem with REST is the same as with SQL ORMs but in reverse: There is this thing called the "object relational impedance mismatch", a technical term for "shit how am I going to hydrate this into an object".
Usually you don't really need "resources". You need smart answers, things like "do people who like cats also like the color purrple" and "out of the 3049 people in this age group on the donor list, which one would be the best match for this patient".
Those are horrible things to query in a RDBS, horrible things to hydrate OOP classes with, and horrible things to define REST endpoints around.
Of course, there are places where a "CRUD resources" based backend is perfect, like the classic blog example with authors and articles and comments, or a music album information site with record labels and albums and artists.
I think for smarter applications, these mapping steps are far from optimal though. -
hexc11266y@rookiemaverick yeah , I know what websockets are, just didn't know what you meant by "websockets", like do you mean to say they are history? And if so why do you think that?
-
hexc11266y@rookiemaverick ah well cool because one of the Large projects I've been working on uses websockets to update clients data whenever the database gets updated. So no need for the client code to poll the server or for the user to refresh the page. 😋
Related Rants
REST is history?? I don't think so.
joke/meme
rest