apibara / dna

Apibara is the fastest platform to build production-grade indexers that connect onchain data to web2 services.
https://www.apibara.com/
Apache License 2.0
166 stars 26 forks source link

Use transactions to replace pending data in MongoDB sink #355

Closed fracek closed 3 months ago

fracek commented 3 months ago

Summary

By default, MongoDB handles updating pending data by removing the previous call data and inserting the new data after that. Sometimes this results in data "flashing".

This PR adds support for replacing pending data in one transaction. Notice that this feature requires a special deployment of MongoDB (with replication) and so it cannot be turned on by default.

Testing strategy