2

Unfortunately when using the amazing Firebase Realtime Database (ie, traditional Firebase), and the Cloud Functions thereof

There's no concept really of lockup available, other than the base transaction concept. (Which is awesome as far as it goes.) For example you can't do a say read, delete, insert.

We haven't user the new Firestore in a project yet; I'm wondering if it solves that particular problem?

This would make it tremendously useful for things like, well almost anything really, transactional game currencies, logic, etc.

Is this an advantage of Firestore?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Fattie
  • 27,874
  • 70
  • 431
  • 719

1 Answers1

2

Transactions in Firestore are more flexible than those in Realtime Database. With Realtime Database transactions, you had to choose a single location in that transaction, and you could only modify children under that location. All clients has to be using transactions to safely modify that transaction.

With Firestore transactions, you can transact using any arbitrary set of documents across any set of collections in your database, and you have atomicity on changes made to those documents. You're not obliged to choose just one collection or just one document.

There is no such thing as a "lock" in either product. Locks are not provided because they're difficult to manage correctly (avoiding deadlock) while also being scalable to millions of concurrent writers.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441