Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Explore Firebase #2

Closed
3 tasks done
tenhobi opened this issue Feb 9, 2018 · 2 comments
Closed
3 tasks done

Explore Firebase #2

tenhobi opened this issue Feb 9, 2018 · 2 comments
Assignees
Labels

Comments

@tenhobi
Copy link
Owner

tenhobi commented Feb 9, 2018

Explore Firebase options, try to compare with new Firestore.

  • explore Realtime Database
  • explore Cloud Firestore
  • determine what to use
@tenhobi tenhobi added the good first issue :octocat: Good for newcomers label Feb 9, 2018
@tenhobi tenhobi added this to the 1st iteration milestone Feb 9, 2018
@tenhobi tenhobi mentioned this issue Feb 21, 2018
4 tasks
This was referenced Mar 1, 2018
@tenhobi
Copy link
Owner Author

tenhobi commented Mar 3, 2018

I think we should use Cloud Firestore instead of Realtime Database. It's in a beta now, but it seems we can better structure data, do queries, it's better optimized for getting only data you need etc.

@tenhobi tenhobi closed this as completed Mar 3, 2018
@tenhobi tenhobi reopened this Mar 3, 2018
@tenhobi
Copy link
Owner Author

tenhobi commented Mar 13, 2018

Both RD and CF are NoSQL databases, but RD returns whole JSON subtree on query and querying is quite bad if not possible. CF returns only the selected data, which is awesome to scaling up and you can do smart queries for your data.

Even though CF is in beta yet, we should give a try to it.

CF:

image

it can be used like this:

data:

{
  danceName: "My Dance",
  songs: {
    "aNameOfASong": true,
    "aNameOfAnotherSong": true,
  }
}

code:

db.collection('Dances')
  .where('songs.aNameOfASong', '==', true)
  .get()
  .then(function(querySnapshot) {
    querySnapshot.forEach(function(doc) {
      console.log(doc.id, " => ", doc.data());
    });
   })
   .catch(function(error) {
     console.log("Error getting documents: ", error);
    });

Also the rules for db looks better than for RD https://firebase.google.com/docs/firestore/security/get-started?authuser=0

It's free up to 1 GB stored and 10 GB / month downloaded, for our purposes that's enough.

@tenhobi tenhobi closed this as completed Mar 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants