Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Firebase aventures - cloud based real time data...

Firebase aventures - cloud based real time database

Esteban Dorado Roldan

March 11, 2016
Tweet

More Decks by Esteban Dorado Roldan

Other Decks in Programming

Transcript

  1. Realtime back-end: If the data change, all listeners will be

    called. All data always is up to date.
  2. Database Advantages: • NoSQL data-store • Database is stored as

    JSON • Automatically scales with your app • Cross-platform • Offline mode
  3. Database STORE DATA - Java Firebase ref = new Firebase("https://<your-firebase-app>.firebaseio.com/message");

    ref.setValue("All the things"); SYNC DATA - Java Firebase ref = new Firebase("https://<your-firebase-app>.firebaseio.com/message"); ref.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot snapshot) { System.out.println(snapshot.getValue()); } @Override public void onCancelled(FirebaseError error) { } });
  4. Authentication Characteristics: • Simple, few lines Authentications: Email & Password

    Google Twitter Facebook Github Anonymous ...and even custom backends
  5. The rules By default { "rules": { ".read": true, ".write":

    true, ".validate": "newData.isString() && newData.val().length < 100" } } Three basic rules .read → if and when data is allowed to be read by users. .write → if and when data is allowed to be written. .validate → Defines what a correctly formatted value.
  6. Limitations Android: • UI dependency • Unit test: need Android

    context Firebase: • No file uploading API • No notifications Push • Server side batching • Server side scheduling • Server side event clock