g-viet / til

Today I learned
6 stars 0 forks source link

Firebase: Realtime Database vs Cloud Firestore #21

Open g-viet opened 6 years ago

g-viet commented 6 years ago
Creteria Realtime Database Cloud Firestore
DataModel document-type document-type with subcollection
Support iOS, Android iOS, Android, Web
Querying Always return entire subtree Data stored by subcollection is indexed and able to get single subtree
DBTransaction Write data as an individual operation Batch operation and complete atomically
DBTransaction Every transaction needs callback function Transaction automatically repeat until they're completed
Reliability Limited to zonal availability Hold data across multiple data centers in distinct regions, ensure global scalability and strong reliability
Scalability Limited to zonal availability Hold data across multiple data centers in distinct regions, ensure global scalability and strong reliability
Scalability Need sharding. Scale to around 100,000 concurrent connections and 1,000 writes/second in a single database Automatic
Security Validate data separately using validate rule cover access validation

Ref: https://firebase.google.com/docs/database/rtdb-vs-firestore