mysql - Relationship between REST API & Database -
i've been studying databases , rest apis lately , have question relationship between two.
imagine have database 3 tables, students, enrolled, , classes.
students , classes denote entities students , classes, whereas enrolled table denotes relationship.
if map dataset in rest api, have 3 different crud routes 3 tables, eg ('/students', '/classes', '/enrolled')?
and question goes rest apis in general -- when write/make rest api, constructing 1:1 mapping of database?
thanks in advance-- trying nail down conceptual understanding of relationship between two.
cheers!
http verbs used crud operations while writing/ making rest api not constructing 1:1 mapping of database.
rest can have hypermedia controls. if wants to doctors appointment first needs available appointment slot , using appointment slot can make request make appointment. while delivering available appointment slot can send url booking slot.
read - http://martinfowler.com/articles/richardsonmaturitymodel.html
Comments
Post a Comment