Could you please add to this tutorial an explanation about what is REST and what is CRUD?
Igor Data
31

Hi Igor,

Thanks for reading! That’s a great question — I won’t add it to the tutorial in fear of cluttering it up too much but I can delve into a bit here.

In this tutorial we’re building a back-end for a note-taking application. Most of our API is thus going to be centered around around taking actions on these notes (creating, reading, updating, and deleting, AKA the CRUD actions, which are the four basic actions you can take on a database).

RPC API’s expose endpoints as actions, aka ‘/createnote’, ‘/getnote’, etc. You could totally make this work but it would not be as elegant (in my opinion). REST API’s focus on resources- a tough word to define, but roughly corresponding to a model/object in the database.

With a REST API, you expose one endpoint (‘/notes’) and then let the type of request (GET, PUT, POST, DELETE) determine what action to take. In my opinion this makes it easier for the front-end to communicate — the front-end developer doesn’t need to figure out what action endpoint to hit, but assumes if there is a note resource she can do a GET/PUT/POST/DELETE on it.

This is of course an extremely short summary of some complicated topics, but I hope it helps. Here’s some further reading:

REST vs RPC

CRUD

REST Explained

Like what you read? Give Scott Domes a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.