What is Firebase๐Ÿ”ฅ ?

์„์ง„ยท2024๋…„ 2์›” 18์ผ
0
post-thumbnail
post-custom-banner

๐Ÿ”ฅFirebase

๊ตฌ๊ธ€์—์„œ ๋งŒ๋“ค์–ด์ง„ BAAS(Backend As A Service) ๋ชจ๋ฐ”์ผ์—์„œ ํ•„์š”ํ•œ ๊ฑฐ์˜ ๋ชจ๋“  ๊ธฐ๋Šฅ์„ ์ œ๊ณต, ์ €์žฅ์žฅ์น˜, ํ…Œ์ŠคํŒ… ํ‘ธ์‹œ ๋“ฑ ํ•„์š”ํ•œ ๊ฑฐ์˜ ๋ชจ๋“  ๊ธฐ๋Šฅ์„ ์ œ๊ณต

๐Ÿ”ฅRealTime DataBase

์‹ค์‹œ๊ฐ„์œผ๋กœ ์ ‘๊ทผ ํ•  ์ˆ˜ ์žˆ๋Š” database NoSQL์˜ ํ˜•ํƒœ๋กœ ๊ตฌ์„ฑ๋˜์–ด์žˆ์Œ, ์‹ค์งˆ์ ์œผ๋กœ ์ €์žฅ๋˜๋Š” ๊ฐ’์€ key์™€ value๊ฐ’์œผ๋กœ ๊ตฌ์„ฑ๋œ JSON Object

๐Ÿ”ฅ์ œํ•œ์‚ฌํ•ญ

๋™์‹œ ์—ฐ๊ฒฐ์— ๋Œ€ํ•œ ์ œํ•œ์ด ์žˆ์Œ(๋ฌด๋ฃŒ plan 100, ์œ ๋ฃŒ plan 20๋งŒ) ํ•œ๋ฒˆ์— Write์€ 1MB ๋‚ด์™ธ

๐Ÿ”ฅStorage

ํŒŒ์ผ ์ €์žฅ์„ ์œ„ํ•ด์„œ ์‚ฌ์šฉ, ํ”„๋กœํ•„์‚ฌ์ง„, ์ž„์‹œ ์ €์žฅํ•˜๋Š” ํŒŒ์ผ ์ €์žฅ ๊ฐ€๋Šฅ.

๐Ÿ”ฅCloud Firestore

๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅ ํ•˜๊ธฐ ์œ„ํ•œ ์ œํ’ˆ, ์‹ค์‹œ๊ฐ„์„ฑ, NoSQL์„ ์ง€์›ํ•œ๋‹ค๋Š” ์ ์„ Realtime database์™€ ๋น„์Šท

  • ์ €์žฅํ•˜๋Š” ๊ฐ’: JSON ํ˜•ํƒœ๊ฐ€ ์•„๋‹Œ Collections๋ฅผ ์ €์žฅ
  • Document: Data๊ฐ€ ์ง‘ํ•ฉํ•ด์žˆ๋Š” ๋‹จ์œ„
  • Collections: Document๊ฐ€ ์ง‘ํ•ฉํ•ด์žˆ๋Š” ๋‹จ์œ„

๐Ÿ”ฅRealTime Database vs ColudFirestore ์ฐจ์ด

์ข…ํ•ฉ : ํฐ ๋‹จ์œ„ ๋ฐ์ดํ„ฐ ์š”์ฒญ์‹œ์—๋Š” Cloud Firestore
๋ฐ์ดํ„ฐ๊ฐ€ ์ž‘๊ณ  CRUD๊ฐ€ ์ž์ฃผ ๋ฐœ์ƒํ•˜๋ฉด Realtime database

๐Ÿ”ฅFirebase์— ์ต์ˆ™ํ•ด์ง€๊ธฐ

crashlytics / remote config / abtest

Crashlytics

  • ์•ฑ์ด ๊ฐ•์ œ์ข…๋ฃŒ ๋˜์—ˆ์Œ์„ ์•Œ๋ ค์ฃผ๋Š” Tool, ๋กœ์ง์„ ์ž˜ ์ž‘์„ฑํ•˜๋”๋ผ๋„ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋“ฑ์—์„œ ํฌ๋ž˜์‹œ๊ฐ€ ๋‚  ์ˆ˜ ๋„ ์žˆ๋‹ค.

Remote Config

  • ์›๊ฒฉ์— ์žˆ๋Š” ์ƒ์ˆ˜๊ฐ’์„ ์—…๋ฐ์ดํŠธ ํ•ด์ค„ ์ˆ˜ ์žˆ๋Š” Tool, ํŠน์ • ๊ธฐ๋Šฅ์— ๋Œ€ํ•œ ON/OFF ๋˜๋Š” ํŠน์ •ํ™”๋ฉด์˜ ํ…์ŠคํŠธ๋ฅผ ๋ฐ”๊พธ๋Š”๊ฒƒ์œผ๋กœ ํ™œ์šฉ

    ์ฃผ์˜์ : Remote Config๊ฐ’์„ ์กฐํšŒ ์‹คํŒจํ–ˆ์„๋•Œ ๋Œ€๋น„ํ•˜์—ฌ ๊ธฐ๋ณธ๊ฐ’์„ ์„ค์ •, ์‹คํŒจ ๋“ฑ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ์ด์œ ๋กœ ์ธํ•˜์—ฌ ์ตœ์‹ ๊ฐ’์„ ํ•ญ์ƒ ๋ณด์—ฌ์ฃผ์ง€๋Š” ์•Š์Œ

AB Test

  • A๊ทธ๋ฃน๊ณผ B๊ทธ๋ฃน์„ ๋‘๊ณ  ์–ด๋–ค ๊ทธ๋ฃน์ด ๋” ๋งŽ์€ ์ „ํ™˜์œจ์„ ๋ณด์ด๋Š”์ง€ ์ฒดํฌ, ๊ธฐ์กด ๋ฒ„์ „๊ณผ ์‹ ๊ทœ๋กœ ๋ณ€๊ฒฝ๋œ ๋ฒ„์ „์—์„œ์˜ ๋ถ„๊ธฐ, ๊ฐœ์„ ๋œ ๋ฒ„์ „์—์„œ์˜ ์œ ์ € ํ”ผ๋“œ๋ฐฑ์„ ๋ฐ›๋Š”๋‹ค๋Š” ์ด์ 

  • ์‚ฌ์ „์ž‘์—…

    • Remote Config: config ์„ค์ •๋œ ๊ฐ’๋“ค์— ๋Œ€ํ•˜์—ฌ ๊ฐ€๋Šฅ
    • Analytics: ๋ถ„์„์„ ์œ„ํ•ด ํ•„์š”

๐Ÿ”ฅReact-Native-Firebase

Firebase๋ฅผ ์‚ฌ์šฉ ๊ฐ€๋Šฅ ํ•˜๋„๋ก ๋งŒ๋“ค์–ด๋‘” Package
https://rnfirebase.io/

  • npx expo install expo-dev-client
  • npx expo install @react-native-firebase/app
  • npx expo install expo-build-properties
  • googleServicesFile ํŒŒ์ผ์„ ๋„ฃ์–ด์ค€๋‹ค.
  • ์ด ๊ณผ์ •์ด ๋ชจ๋‘ ์™„๋ฃŒ๋˜๋ฉด npx expo prebuild --clean ์ปค๋งจ๋“œ๋ฅผ ํ•ด์ฃผ๊ฒŒ ๋˜๋ฉด native ์ฝ”๋“œ๋“ค์ด ์ถ”๊ฐ€๋œ๋‹ค.

๐Ÿ”ฅ OAuth 2.0

์ธ์ฆ์„ ์œ„ํ•œ ๊ฐœ๋ฐฉํ˜• ํ‘œ์ค€ ํ”„๋กœํ† ์ฝœ
Thrid party ํ”„๋กœ๊ทธ๋žจ์—๊ฒŒ ๋ฆฌ์†Œ์Šค ์†Œ์œ ์ž๋ฅผ ๋Œ€์‹ ํ•˜์—ฌ ์„œ๋ฒ„์—์„œ ๋ฐ์ดํ„ฐ ์ œ๊ณต

Authentication: ์ธ์ฆ ํ•˜๋Š” ๋‹จ๊ณ„

Authorization: ์ธ์ฆ์ด ๋๋‚œ ๋’ค Access Token์ด ๋ถ€์—ฌ๋˜๋Š”๊ฒƒ

Access Token: ์œ ์ €์—๊ฒŒ ๊ถŒํ•œ ๋ฐ›์•˜์Œ์„ ์ธ์ฆํ•˜๋Š” Token

Refresh Token: Access Token์„ Refresh ํ•˜๊ธฐ ์œ„ํ•œ Token

  • npm install @react-native-firebase/auth
  • npx expo prebuild
profile
๋‚ด ์„œ๋น„์Šค ๋งŒ๋“ค๊ธฐ
post-custom-banner

0๊ฐœ์˜ ๋Œ“๊ธ€