Data inlining stores related information directly inside a resource rather than linking to a separate resource. It can simplify common reads, but increases payload size, query work, and consistency concerns when the embedded data is shared or changes frequently. section 4.2.2 section 4.3.3
ChatRoom administrator
A ChatRoom can contain an adminUser object, allowing the administrator’s name to be returned in one API call. A reference instead stores adminUserId and requires a second call to retrieve the User. Prefer inlining when the information is commonly needed; prefer a reference when it is infrequently used or produces substantial extra data. section 4.2.2
Apply these checks before inlining:
- Inline data that answers frequent resource queries without another network request. section 4.2.2
- Avoid inlining infrequently used data, deeply nested data, or shared values that must remain consistent across resources. section 4.2.2 section 4.3.3
