architecture

2018-04-27T14:31:02.000328Z

If you asked a document store for a key that didn’t exist. Would you expect a) a 400 type response b) a empty document

Ivan 2018-04-27T15:57:26.000262Z

I'd expect 404

Ivan 2018-04-27T15:58:26.000516Z

an empty document is still a document - it doesn't signify non-existence

2018-04-27T17:35:44.000553Z

@ivan.kanak_clojurians me too. And yet, I seem to have not explained this well enough to my co workers. I think there suggesting they in this specific case it's more convenient, but I'm worried it's going to be very confusing for someone else that isn't in on this choice. They wanted to compare it to what happens when you ask for rows in a relational db but I think it's more like asking for a table that doesn't exist...

seancorfield 2018-04-27T19:13:06.000281Z

In SQL, you ask for a result set, and an empty response means "no matches". For a document store, you can ask for "matching documents" and an empty response means "no match" but if you ask for a specific document, an empty document should mean "I found a match and it was this empty document". That's the key difference: SQL is always plural in results (a ResultSet); document stores tend to offer both "find one" and "find all" -- the latter corresponds to SQL.

👍 1
seancorfield 2018-04-27T19:13:53.000689Z

Returning nil for "no matching document" would be OK for the singular case if the client is within the same code, otherwise, yes 404 is the right response (for document-store-as-a-service).