Top Banner
Firebase Not really yohoho, but Yarr “one strange pirate notes”
58
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Firebase not really_yohoho

FirebaseNot really yohoho, but Yarr“one strange pirate notes”

Page 2: Firebase not really_yohoho

Questions

1. Dive into Real Time Cloud Database2. CRUD and Data Retrieving3. Authentication and Security4. Special Features you would like to use5. Modules

Page 3: Firebase not really_yohoho

Break Points1. Main Goals2. Firebase as Service Provider3. Get it Working4. Play Around5. Something special6. Pros and Cons7. What are we waiting for?8. Conclusion

Page 4: Firebase not really_yohoho

Main Goals- provide with short review of technologie- play around and show examples- provide with directions of using Firebase- conclude everything

Page 5: Firebase not really_yohoho

Firebase as Service ProviderMain InformationFirebase is a cloud services provider and backend as a service company based in San Francisco, California. The company makes a number of products for software developers building mobile or web applications. Firebase was founded in 2011 by Andrew Lee and James Tamplin and launched with a real time cloud database in April 2012. © Wikipedia

Page 6: Firebase not really_yohoho

Firebase as Service ProviderServices:- Real Time Database Provider- Hosting- Simple Login

Page 7: Firebase not really_yohoho

Firebase as Service ProviderReal Time Database ProviderFirebase provides a realtime database and backend as a service. The service provides application developers an API that allows application data to be synchronized across clients and stored on Firebase's cloud. © Wikipedia

Page 8: Firebase not really_yohoho

Firebase as Service ProviderLanguages:- Java Script- Android- iOS- Node.js- Java- Objective-C

Frameworks:- Angular- Ember- Backbone- React

Page 9: Firebase not really_yohoho

Get it Working: DataData Storage:- JSON-structed- relative-oriented

How it works:- pub/sub server- web-sockets

Page 10: Firebase not really_yohoho

Get it Working: StartInstallation:- <script

src="https://cdn.firebase.com/js/client/2.2.4/firebase.js"></script>

- bower install firebase- npm install firebase

Page 11: Firebase not really_yohoho

Get it Working: Create DB1. Sign Up: https://www.firebase.com/2. Create Database

Page 12: Firebase not really_yohoho

Get it Working: ConnectEstablish Database Connection:

Page 13: Firebase not really_yohoho

let’s code, Yarr!

Page 14: Firebase not really_yohoho

Play Around: CRUD

Create

Read

Update

Delete

Page 15: Firebase not really_yohoho

Play Around: CRUDCRUD in Firebase:- flexible (as many ways as you can imagine)- one method and a lot of results

Page 16: Firebase not really_yohoho

Play Around: CreateCreate:- push();- set();

Page 17: Firebase not really_yohoho

Play Around: Createpush();

- soft insert: just adds a new object

Page 18: Firebase not really_yohoho

Play Around: Createbefore push(); after push();

Page 19: Firebase not really_yohoho

Play Around: Create

unique ids

Page 20: Firebase not really_yohoho

Play Around: Createset();

- strong: replace all the existing data

Page 21: Firebase not really_yohoho

Play Around: Createbefore set(); after set();

Page 22: Firebase not really_yohoho

Play Around: Createpush();

- adds new object- assigns unique Id

set();- replace referenced data by incoming

object- doesn’t assign unique Id

Page 23: Firebase not really_yohoho

Play Around: EventsEvents:

- on/once ‘value’- on/once ‘child_added’- on/once ‘child_removed’- on/once ‘child_moved’

Page 24: Firebase not really_yohoho

Play Around: Data ViewData View:

- data snapshot- val();- exists()- child();- parent();- hasChild();- hasChildren();- isNumbers();- isString();- isBoolean();- isNumber();- getPriority();

Page 25: Firebase not really_yohoho

Play Around: ReadRead:- on.(‘value’);- on.(child_added’);- on.(child_removed’);- on.(‘child_changed’);- on.(‘child_moved’);

Page 26: Firebase not really_yohoho

Play Around: Readon.(‘value’)

Page 27: Firebase not really_yohoho

Play Around: Readon.(‘value’)

Page 28: Firebase not really_yohoho

Play Around: Readon.(‘child_added’)

<= show object key

Page 29: Firebase not really_yohoho

Play Around: UpdateUpdate:- update();- set();

Page 30: Firebase not really_yohoho

Play Around: Updateupdate();

new field

Page 31: Firebase not really_yohoho

Play Around: DeleteDelete:- remove();

Page 32: Firebase not really_yohoho

Play Around: Deleteremove();

Page 33: Firebase not really_yohoho

Play Around: SearchSearch Process:

- no strong search queries- no real search engine

Search Methods:- on/once(‘value’)- orderByChild(), orderByKey(), orderByValue(), orderByPriority()- startAt(), endAt(), equalTo()- limit(), limitToLast(), limitToFirst()- ref()

Page 34: Firebase not really_yohoho

Play Around: SearchSource Database:

Page 35: Firebase not really_yohoho

Play Around: SearchorderByChild(); startAt(); endAt();

Page 36: Firebase not really_yohoho

Play Around: SearchlimitToFirst(); equalTo();

Page 37: Firebase not really_yohoho

Play Around: SearchequalTo();

Page 38: Firebase not really_yohoho

Play Around: AuthPretty-looking and Easy:

- automatic user creation- service-side authentication- multiple authentication methods

Authentication Methods:- email and password (using pre-registered email and password)- social network-based (Facebook, Google, Twitter, GitHub)- anonymous (new session = new identifier) - custom (using pre-generated token)

Page 39: Firebase not really_yohoho

Play Around: AuthAuth Settings:

Page 40: Firebase not really_yohoho

Play Around: AuthCreate New User:

Page 41: Firebase not really_yohoho

Play Around: AuthUser List:

Page 42: Firebase not really_yohoho

Play Around: AuthAuthentication:

Page 43: Firebase not really_yohoho

Play Around: SecurityAccess Permissions:

- .read - .write- .validate- .indexOn

Variables:- auth- $location- now- root- data- new Data

Methods:- val()- child()- parent()- isNumber()- isString()- matches(regex)

Operators:- +,-,*,/,%- ===, !==, &&, ||, >, <

Page 44: Firebase not really_yohoho

Play Around: Security

Page 45: Firebase not really_yohoho

Play Around: SecuritySecurity Rules:

Page 46: Firebase not really_yohoho

Play Around: SecuritySecurity Rules & Authentication:

- not authenticated user

Page 47: Firebase not really_yohoho

Play Around: SecuritySecurity Rules & Authentication:

- authenticated user- read soldiers record

Page 48: Firebase not really_yohoho

Play Around: SecuritySecurity Rules & Authentication:

- authenticated user- write soldiers record

Page 49: Firebase not really_yohoho

Play Around: Security- not flexible security rules- breaks search ability- complicated in configuration - force to duplicate data

Page 50: Firebase not really_yohoho

Something SpecialonDisconnect():

- set();- update();- remove();- cancel();

ServerValue:- TIMESTAMP

databaseReference.child(‘.info’)- authenticated- connected- serverTimeOffset

Page 51: Firebase not really_yohoho

Pros and ConsPros:

- fast- auto-scalable - service-side process handling - events-oriented- build-in graphic editor- easy to jump in- user-friendly- understandable API

Cons:- poor search engine- no map reduce implemented- no reference or join functionality- not counted amount of

connections

Page 52: Firebase not really_yohoho

Pros and ConsFree Trial Plan:

- 50 connections- 5 GB Data Transfer- 100 MB Data Storage- 1 GB Hosting Storage- 100 GB Hosting Transfer

Paid Plans:https://www.firebase.com/pricing.html

Page 53: Firebase not really_yohoho

ModulesModule List:https://github.com/firebase/geofire-jshttps://github.com/firebase/vulcanhttps://github.com/firebase/angularfire

More:https://github.com/firebase

Page 54: Firebase not really_yohoho

What are we waiting for?- map reduce- url handling

Page 55: Firebase not really_yohoho

Links: no porn :( https://www.firebase.com/https://www.firebase.com/blog/https://github.com/firebase/

Page 56: Firebase not really_yohoho

Conclusionvar databaseReference = new Firebase(‘https://thanks.for.listening/’);

databaseReference.set({conclusion: ‘think on your own’

});

Page 57: Firebase not really_yohoho

Put Something Herevar presentation = {

author: {name: ‘Roman Sachenko’,email: ‘[email protected]’,

skype: ‘roman.sachenko’,statusMessage: ‘there is no way, but the hard way’

},subject: ‘Firebase: not really yohoho, but

yarr’, date: new Date(‘2015/04/30’),

};

Page 58: Firebase not really_yohoho

DA-14 2015 Roman Sachenko