Skip to content
Advertisement

Admin SDK Transaction behavior on Realtime Database

I have been using Admin SDK Transaction on Firestore for a while, I know Firestore locks documents during transaction.

But I am not sure it works as same as on Realtime Database because offical document keep bring me to the client side API page, Or just because it’s no difference between client sdk and admin sdk on realtime database.

Advertisement

Answer

While, for Firestore, the concurrency controls are different between the JS SDK (optimistic concurrency controls) and the Admin SDK (pessimistic concurrency controls), as explained here in the documentation, for the Realtime Database the two SDKs use the same controls.

More precisely, for the RTDB, both the JS SDK and the Admin SDK use optimistic concurrency controls: “If another client writes to the location before your new value is successfully written, your update function will be called again with the new current value, and the write will be retried”.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement