프로덕션 환경에 배포하기 전에 코드를 테스트하면 많은 비용을 초래할 수 있는 오류를 포착하는 등 여러 가지 이유에서 도움이 됩니다.
앱의 인프라를 구축할 때 Firebase Local Emulator Suite를 사용하여 먼저 로컬에서 테스트하는 것이 좋습니다.
Local Emulator Suite을 사용하면 Cloud Functions, Cloud Firestore, Realtime Database 등의 인스턴스를 데스크톱 머신에서 로컬로 실행할 수 있습니다.
덕분에 쉽게 새로운 기능(특히 Cloud Functions)을 빠르게 반복할 수 있을 뿐만 아니라 프로덕션에서 서비스 테스트로 인한 Firebase 비용도 발생하지 않습니다.
테스트를 통해 예상 사용량 및 지출이 초과되는 다음과 같은 일반적인 원인이 존재하는지 확인할 수 있습니다.
수백만 개의 결과를 포함하는 데이터베이스 쿼리에 한도를 추가하지 않음
과도한 팬아웃 워크로드 또는 무한 루프를 유발하는 Cloud Functions 조합
사용량 및 지출 수준 보기
앱의 일반적인 사용 패턴을 알아야 하며 중요한 기준 금액을 초과해서는 안 됩니다.
개별 제품 사용량 보기
Firebase 콘솔에 있는 여러 제품의 '사용량' 탭에서 개별 제품 사용량을 확인할 수 있습니다.
Firebase 콘솔의 사용량 및 결제 대시보드에서 프로젝트의 전체 사용량을 확인할 수 있습니다(프로젝트 설정 > 사용량 및 결제로 이동).
월별 사용량을 보고 무료 사용 할당량의 어느 정도를 사용하고 있는지 알 수 있습니다.
제품을 클릭하여 일일 사용량 요약을 확인하고 무료 사용 할당량에서 어느 정도를 사용하고 있는지 검토합니다.
제품마다 사용 할당량이 다르며 따라서 타임라인도 다릅니다. 예를 들면 다음과 같습니다.
Cloud Firestore 및 Cloud Storage 사용량은 매일 계산됩니다.
Cloud Functions 사용량은 매달 계산됩니다.
예산 알림 이메일 설정
Google Cloud Billing에서 예산을 만들고 예산 알림을 설정하면 예상치 못한 청구를 피할 수 있습니다.
예산이란 매달 지출할 계획인 일반적인 금액입니다.
예산 알림은 프로젝트가 설정된 지출 기준을 초과하는 경우 팀에 전송되는 이메일 알림입니다.
기본적으로 Firebase와 Google Cloud는 예산과 기준에 따라 서비스와 사용량을 중지하지 않습니다. 앱에 버그가 있어 요금이 증가했을 수도 있지만, 예상치 못하게 앱이 긍정적인 성장을 했을 가능성도 있기 때문입니다. 가장 필요할 때 예기치 않게 앱이 종료되기를 원하는 사용자는 없을 것입니다.
최근에 Blaze 요금제로 업그레이드했다면 이미 예산 알림을 받았을 수 있습니다. 그래도 예산 알림에 대해 자세히 알아보거나 새 알림을 설정하거나 기존 알림을 수정하려면 이 섹션을 살펴보세요.
예산 및 기본 예산 알림 설정
이 섹션에서는 Firebase와 관련하여 예산과 예산 알림에 대해 개괄적으로 설명합니다. 자세한 내용은 Google Cloud 문서의 예산 알림 설정을 참조하세요.
예산 및 기본 예산 알림을 설정하는 방법은 다음과 같습니다.
예산 설정으로 이동합니다.
Firebase Console에서 프로젝트에 액세스한 다음 사용량 및 결제 > 세부정보 및 설정 페이지로 이동합니다.
예산 및 알림 섹션에서 첫 번째 예산 만들기를 클릭합니다. 그러면 Cloud 콘솔의 예산 및 알림 페이지로 이동합니다.
이미 예산을 설정한 경우 '첫 번째 예산 만들기' 링크 대신 예산이 여기에 표시됩니다.
다음 단계를 완료하여 예산 및 이메일 예산 알림을 설정합니다.
기존 예산을 선택하거나 새로운 예산을 만듭니다.
예산에 설명이 포함된 이름을 지정합니다.
예산 알림을 적용할 프로젝트 및 서비스를 포함하여 예산 알림 범위를 설정합니다. 예산 알림을 시작할 때 모든 서비스를 선택하는 경우가 많습니다.
다음 옵션 중 하나를 사용하여 금액 > 예산 유형을 설정합니다.
설정된 금액 - 앱을 처음 시작하거나 테스트할 때 이 유형을 사용합니다.
지난달 프로젝트 지출 금액과 같은 금액 – 앱이 꾸준히 성장하며 매달 예산 금액을 계속 업데이트하고 싶지 않은 경우에 이 유형을 사용합니다.
예산 비율 알림을 설정합니다.
초기 테스트에서는 실제 값의 1%, 2%, 5%, 50%와 같이 다양한 비율을 사용해 봅니다.
프로덕션 앱의 경우 실제 값의 50%, 100%, 예측 값의 150%와 같이 주요 비율을 사용해 봅니다.
이메일을 받을 사용자를 설정합니다.
기본적으로 적절한 결제 권한을 보유한 모든 사용자(기본적으로 연결된 Cloud Billing 계정의 결제 계정 관리자 및 결제 계정 사용자)에게 알림 이메일이 전송됩니다.
팀의 다른 사용자에게 이메일을 보낼 수도 있습니다. 이를 위해서는 Cloud Monitoring 작업공간을 만들고 이메일 기반 알림 채널을 작업공간의 알림 섹션에 추가해야 합니다. 이 설정에 대한 자세한 내용은 고급 결제 알림 및 로직 설정을 참조하세요.
알림을 낮은 예산 비율(예: 1%)로 설정하면 프로젝트가 기준에 도달했다는 이메일이 몇 시간에서 며칠 이내에 전송됩니다.
[null,null,["최종 업데이트: 2025-08-25(UTC)"],[],[],null,["Whether you're just starting out developing your app or you have a full-blown\nproduction app, you want to make sure you understand your costs and how to avoid\nsurprise bills.\n\nIf you haven't already, check out the [Firebase pricing\nplans](/docs/projects/billing/firebase-pricing-plans) to understand how billing\nfor works for Firebase.\n| **Important:** **Firebase pricing plans apply to the entire project, not just to\nindividual apps registered in the project.** When you're determining which pricing plan is right for you, consider the usage from *all the apps* registered in the same project. Learn more about [best practices](/docs/projects/dev-workflows/general-best-practices) for when to add multiple apps to the same Firebase project. \n\nThis page guides you through important aspects of understanding and monitoring\nyour usage and spend levels, including:\n\n- [Testing your code](#test-code)\n- [Viewing your usage and spending levels](#view-usage-and-spending-levels)\n- [Setting up budget alert emails](#set-up-budget-alert-emails)\n\n*** ** * ** ***\n\nTest your code\n\nTesting your code before deploying to production is a great idea for many\nreasons, like catching errors that might cost you significant amounts of money.\nAs you're building the infrastructure for your app, **we highly recommend first\ntesting locally using the [Firebase Local Emulator Suite](/docs/emulator-suite)**.\n\nThe Local Emulator Suite allows you to run instances of Cloud Functions,\nCloud Firestore, the Realtime Database and more all locally on your desktop machine.\nThis not only makes it easier for you to quickly iterate on new functionality ---\nparticularly Cloud Functions --- but it also ensures that you don't incur any\nFirebase costs that might result from testing against services in production.\n\nAs you're testing, check for these common causes of exceeding expected usage and\nspend:\n\n- Forgetting to add a limit to a database query with millions of results\n\n- Combinations of Cloud Functions that cause excessive fan-out workloads\n or even infinite loops\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\u003cbr /\u003e\n\nView your usage and spending levels\n\nYou need to know what normal usage patterns look like for your app and make sure\nyou're staying within thresholds important to you.\n| Most Firebase products provide product-specific documentation about usage, quotas, and pricing. They also often provide usage-to-billing examples for the product. Visit a product's section in the Firebase documentation to find this type of information.\n|\n| For example, here's documentation to\n| [understand billing for Cloud Firestore](/docs/firestore/pricing).\n\nView individual product usage\n\nYou can view individual product usage in the \"Usage\" tab for many products in\nthe Firebase console.\n\n- You can view specific date ranges in these dashboards.\n\n- Product-level dashboards are available for\n [Authentication](//console.firebase.google.com/project/_/authentication/usage)\n and all the infrastructure products:\n [Realtime Database](//console.firebase.google.com/project/_/database/usage),\n [Cloud Firestore](//console.firebase.google.com/project/_/firestore/usage),\n [Cloud Storage](//console.firebase.google.com/project/_/storage/usage),\n [Cloud Functions](//console.firebase.google.com/project/_/functions/usage),\n and [Hosting](//console.firebase.google.com/project/_/hosting/usage).\n\nView overall project usage\n\nYou can view your project's overall usage in the\n[*Usage and billing* dashboard](//console.firebase.google.com/project/_/usage)\nin the Firebase console (go to *Project Settings* \\\u003e *Usage and billing*).\n\n- You can view your monthly usage and how your usage levels are\n measuring up to the allocated no-cost usage quota.\n\n- Click into any product to review a daily summary of usage and how it\n measures up to the allocated no-cost usage quota.\n\nRemember that each product has different usage quotas and thus different\ntimelines, for example:\n\n- Cloud Firestore and Cloud Storage usage are calculated daily.\n\n- Cloud Functions usage is calculated monthly.\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\u003cbr /\u003e\n\nSet up budget alert emails\n\nAvoid surprises on your bill by creating budgets in\nGoogle Cloud Billing and setting up budget alerts.\n\n- *Budgets* are general monetary amounts that you plan on spending each month.\n\n- *Budget alerts* are email notifications sent to your team if your project\n exceeds a set spending threshold.\n\n| Be aware that **budgets and budget alerts do\n| *not* cap your usage or charges** and that there's a delay between incurring costs and receiving a budget alert (depending on the service, up to a few days). Budgets and budget alerts are intended to help you monitor your spending and to *alert* you about your costs so that you can take action, if needed. For example, you might consider [using\n| budget notifications to programmatically disable Cloud Billing on a\n| project](//cloud.google.com/billing/docs/how-to/disable-billing-with-notifications).\n\nBy default, Firebase and Google Cloud don't turn off services and usage based on\nyour budget and thresholds because although you *might* have a bug in your app\ncausing an increase in charges, you might just be experiencing unexpected\npositive growth of your app. You don't want your app to shut down unexpectedly\nwhen you need it to work the most.\n\nYou might already have a budget alert if you upgraded to a Blaze pricing plan\nrecently. But if you want to learn more about budget alerts, set up a new alert,\nor modify an existing alert, this section is for you!\n| [All Firebase\n| projects are actually Google Cloud projects](/docs/projects/learn-more#firebase-cloud-relationship) behind the scenes, which means billing is shared across Firebase and Google Cloud and you can view the same project in both the Firebase console and the Google Cloud console.\n\nSet up a budget and a basic budget alert\n\nThis section describes budgets and budget alerts at a high-level with a\nFirebase-context. For detailed information, make sure to check out\n[Set budget alerts](//cloud.google.com/billing/docs/how-to/budgets)\nin the Google Cloud documentation.\n| **Note:** To set up a budget or a budget alert, you need to be an Owner of the associated Cloud Billing account.\n\nHere's how to set up a budget and a basic budget alert:\n\n1. Navigate to the budget settings:\n\n 1. Access your project in the Firebase console, then go to the\n **Usage and billing** \\\u003e [**Details \\& settings** page](//console.firebase.google.com/u/0/project/_/usage/details).\n\n 2. In the **Budgets \\& Alerts** section, click **Create first budget** . This\n takes you to the **Budgets \\& alerts** page in the\n Cloud console.\n\n Note that if you already have a budget set up, you'll see it here\n instead of the \"Create first budget\" link.\n2. Complete the following steps to set up a budget and an emailed budget alert:\n\n 1. Select an existing budget or create a new one.\n\n 2. Give your budget a descriptive name.\n\n 3. Set the scope for the budget alert, including the project(s) and\n service(s) that you want the budget alert to apply to. You probably want\n to select *All services* when getting started with budget alerts.\n\n 4. Set the *Amount* \\\u003e *Budget type* using one of these options:\n\n - **A set amount of money** -- use this type when you're first starting\n out or testing your app\n\n - **An amount equal to what your project spent last month** --\n use this type when your app is growing steadily and you don't want\n to keep updating the budget amount every month\n\n 5. Set up *Percent of budget* alerts.\n\n - For initial testing, try out several percentages, like 1%, 2%, 5%,\n and 50% of *Actual*.\n\n - For production apps, try out pivotal percentages, like\n 50% and 100% of *Actual* as well as 150% of *Forecasted*.\n\n | **Tip:** Set a limited number of alert thresholds for your production apps. You want to be informed, but you don't want so many email notifications that you stop paying attention to them.\n 6. Set up who should get emails.\n\n - By default, anyone with the appropriate billing permissions gets the\n notification email (by default, Billing Account Administrators and\n Billing Account Users on the associated Cloud Billing account).\n\n - You can also send emails to other people on your team. This requires\n creating a Cloud Monitoring Workspace and then adding an\n email-based notification channel to the *Alerting* section of the\n workspace. For more information about this setup, visit\n [Set up advanced billing alerts and logic](/docs/projects/billing/advanced-billing-alerts-logic).\n\nIf you set up a notification for a low *Percent of budget* (like 1%),\nyou should get an email within a couple hours or a couple of days telling\nyou that your project has hit that threshold.\n\nNext steps\n\n- Consider using\n [budget notifications to programmatically disable Cloud Billing on a project](//cloud.google.com/billing/docs/how-to/disable-billing-with-notifications).\n\n- Visit\n [Set up advanced billing alerts and logic](/docs/projects/billing/advanced-billing-alerts-logic)\n to learn how to do the following:\n\n - Use Cloud Monitoring to create more sophisticated alerts for billing\n and usage, including custom alerts that send notifications to other\n mediums, like Slack.\n\n - Create additional billing logic based on Google Cloud Pub/Sub."]]