A write method ingests entries without creating individually addressable resources. It suits anonymous or ephemeral data that users read through aggregates such as counts, averages, or dashboard statistics. section 20.2 section 20.6
Design a write method around these rules:
- Return only success or failure status; return no resource and normally no long-running-operation resource. section 20.3 section 20.6
- Model the payload as an entry rather than a resource, usually by renaming the create request's resource field to entry. section 20.3
- Bind the method to the target collection, such as /chatRooms/1/statEntries:write, rather than to the parent resource. section 20.3
- Permit immediate responses before aggregate data becomes visible when ingestion uses delayed analytics processing and eventual consistency. section 20.3.1
Writing a chat-room statistic
A request can target a chat-room statistics collection and carry an entry: parent: "chatRooms/1"; entry: ChatRoomStatEntry. The method acknowledges acceptance with a status code, while later reads retrieve aggregate statistics rather than this entry. section 20.3 section 20.2
Use the sequence diagram to trace entry submission, processing, and aggregate reading. section 20.2
