telefonicaid / fiware-orion

Context Broker and CEF building block for context data management, providing NGSI interfaces.
https://fiware-orion.rtfd.io/
GNU Affero General Public License v3.0
212 stars 264 forks source link

Buffer for updateContext "bulk" processing #1153

Open fgalan opened 9 years ago

fgalan commented 9 years ago

Current Orion version (0.23.0) processes updateContext containing N elements in sequential mode, doing N query/insert operations, even when the N refer to the same entity/attributes. This is a suboptimal behaviour.

It would be better to keep a buffer while updateContext is being processed, doing the modifications (and any futher brokering logic, i.e. notification on changed values) in the buffer. The buffer will be consolidated in the DB once updateContext processing is finalized.

fgalan commented 9 years ago

In some sense, it is related with https://github.com/telefonicaid/fiware-orion/issues/881

fgalan commented 2 months ago

This MongoDB operation could be used http://mongoc.org/libmongoc/current/mongoc_bulk_operation_update.html, accumulating all the documents to be updated.

This bulk could also include the update to upgrade fiware correlators in DB, as explained in https://github.com/telefonicaid/fiware-orion/pull/3893#issuecomment-879929033