Hacker News new | ask | show | jobs
by canadi 2793 days ago
add_docs() API always UPSERTS and so yes, updates are through "_id". The system auto-assigns an "_id" only when it is not supplied by the user or when an existing field is not mapped as the "_id" field at collection creation time. You will have to use delete_docs() before add_docs(), if you want replace-document behavior.

Our backend architecture is quite scalable and actually grows and shrinks with the demand continuously.

And yes, all documents are automatically indexed and replicated for fast query performance, which is more expensive than just storing them in "_id"->"doc" format. For our use cases and value prop, this one time indexing cost pays for itself several times over by saving time during query processing.