Skip to content

Commit 368a9a7

Browse files
committed
Merge branch 'crud-and-data-models' of https://github.com/ReCoded-Org/curriculum-backend-readings into crud-and-data-models
2 parents 999b8bf + 632612d commit 368a9a7

File tree

2 files changed

+2
-2
lines changed
  • module3-crud-and-data-models

2 files changed

+2
-2
lines changed

module3-crud-and-data-models/r1-schema-and-data-models/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ We will need to send the `dish` data too.
7070

7171
To read resources in a REST environment, we use the GET method. in practice, reading a resource shouldn't change any information - it should only retrieve it.
7272

73-
Note: technically, you can change data in a `GET` request but since we are creating a RESTful API, you shouldn't do that, and, in-general, changing data in a `GET` request would be confusing to the users of your api.
73+
To read resources in a REST environment, we use the GET method. Reading a resource should never change any information - it should only retrieve it. REST itself is more like a set of guidelines. Technically, you can change data in a `GET` request, but since we are creating a RESTful API, you shouldn't do that. Having a GET request that updates data in your database would be confusing to the users of your API and violate the expected behavior of REST.
7474

7575
##### Request:
7676

module3-crud-and-data-models/r1.1-principles-of-setting-up-your-schema/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ This is not so much a "storage space" issue as it is a "data consistency" issue.
4646

4747
##### 3. Avoid JOINs and $lookups if they can be avoided, but don't be afraid if they can provide a better schema design.
4848

49-
Having a JOIN or $lookup means you are doing some kind of search in your database for the corresponding field and that operation takes time. So if you embed your data in a single object, you will spare this operation, and your query can be much faster and cleaner.
49+
Having a JOIN or `$lookup` means you are doing some kind of search in your database for the corresponding field and that operation takes time. So if you embed your data in a single object, you will spare this operation, and your query can be much faster and cleaner.
5050

5151
##### 4. How you model your data depends _entirely_ on your particular application's data access patterns.
5252

0 commit comments

Comments
 (0)