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

FirebaseOverview.pdf

d_date
September 01, 2018

 FirebaseOverview.pdf

DevFest Tokyo 2018

d_date

September 01, 2018
Tweet

More Decks by d_date

Other Decks in Programming

Transcript

  1. - Automatic Trace • ΞϓϦͷύϑΥʔϚϯεΛଌఆ͢Δ • Automatic trace • App

    start • Network • App in foreground / background • Screen
  2. Appendix: Performance Monitoring - Custom Trace let trace = Performance.startTrace(name:

    "request_trace") let contents: String do { contents = try String(contentsOfFile: fileName, encoding: .utf8) } catch { print("Log file doesn't exist yet") contents = "" } let fileLength = contents.lengthOfBytes(using: .utf8) trace?.incrementMetric("log_file_size", by: Int64(fileLength))
  3. let trace = Performance.startTrace(name: "request_trace") let contents: String do {

    contents = try String(contentsOfFile: fileName, encoding: .utf8) } catch { print("Log file doesn't exist yet") contents = "" } let fileLength = contents.lengthOfBytes(using: .utf8) trace?.incrementMetric("log_file_size", by: Int64(fileLength)) 1. Call startTrace with 2. Set your metric with Appendix: Performance Monitoring - Custom Trace
  4. let target = "https://www.google.com/images/branding/googlelogo/2x/ googlelogo_color_272x92dp.png" guard let targetUrl = URL(string:

    target) else { return } guard let metric = HTTPMetric(url: targetUrl, httpMethod: .get) else { return } metric.start() var request = URLRequest(url:targetUrl) request.httpMethod = "GET" let task = URLSession.shared.dataTask(with: request) { data, response, error in if let httpResponse = response as? HTTPURLResponse { metric.responseCode = httpResponse.statusCode } metric.stop() ɾSpecified network trace Appendix: Performance Monitoring - Custom Trace
  5. let target = "https://www.google.com/images/branding/googlelogo/2x/ googlelogo_color_272x92dp.png" guard let targetUrl = URL(string:

    target) else { return } guard let metric = HTTPMetric(url: targetUrl, httpMethod: .get) else { return } metric.start() var request = URLRequest(url:targetUrl) request.httpMethod = "GET" let task = URLSession.shared.dataTask(with: request) { data, response, error in if let httpResponse = response as? HTTPURLResponse { metric.responseCode = httpResponse.statusCode } metric.stop() 1. Initialize HTTPMetric 3. Call stop() when finished 2.Call start() ɾSpecified network trace Appendix: Performance Monitoring - Custom Trace
  6. Google Analytics for Firebase • ϞόΠϧ޲͚Google Analytics • WebͷGoogle Analytics

    • BigQuery -> Data Studioͱ͍͏ར༻Λ૝ఆ • WebଆͷGAͱ౷߹͢ΔͷʹTag ManagerΛ࢖ͬͨΓ͢Δ
  7. App Index • ݕࡧ݁ՌʹΞϓϦΛදࣔ͢Δ • μ΢ϯϩʔυϘλϯ͖ͭ • iOS: Universal LinksΛ༗ޮʹ

    • Android: AppIndexͷϥΠϒϥϦΛೖΕΔ • apple-app-site-associationΛϗετ͢Δ
  8. • NoSQL cloud database • Realtime Data Sync with JSON

    Tree • Available data on offline Firebase Database
  9. Denormalization in NoSQL { "users": { "user1": { "name": "Alice"

    }, "user2": { "name": "Bob" } }, "links": { "link1": { "title": "Example", "href": "http://example.org", "submitted": "user1" } }, "comments": { "comment1": { "link": "link1", "body": "This is awesome!", "author": "user2" } } }
  10. Denormalization in NoSQL { "users": { "user1": { "name": "Alice"

    }, "user2": { "name": "Bob" } }, "links": { "link1": { "title": "Example", "href": "http://example.org", "submitted": "user1" } }, "comments": { "comment1": { "link": "link1", "body": "This is awesome!", "author": "user2" } } }
  11. Denormalization in NoSQL { "users": { "user1": { "name": "Alice"

    }, "user2": { "name": "Bob" } }, "links": { "link1": { "title": "Example", "href": "http://example.org", "submitted": "user1" } }, "comments": { "comment1": { "link": "link1", "body": "This is awesome!", "author": "user2" } } } Join data in client
  12. • 10:40 - Firestore Database Design / Room I •

    13:30 - Realtime Database for High traffic production application / Room J • 14:50 - Realtime Database in Production / Room C + D • Related Session
  13. • NoSQL cloud database • Realtime Data Sync with JSON

    Tree • Available data on offline Firebase Database
  14. • Stores data in documents organized in collections • Sending

    data with protobuf, which have more types • Introduced reference type, so requires less denormalization and data flattening • Indexed queries with compound sorting and filtering Cloud Firestore
  15. Cloud Functions • Cloud Firestore • Realtime Database • Firebase

    Authentication • Google Analytics for Firebase • Crashlytics • Cloud Storage • Cloud Pub/Sub • HTTP