Cloud Bigtable is Google's NoSQL Big Data database service. It's the same database that powers many core Google services, including Search, Analytics, Maps, and Gmail.
The Cloud Bigtable C++ Client library offers types and functions to access Cloud Bigtable from C++ applications. It offers access to the Cloud Bigtable API, including admin operations to list, read, write, and delete Instances, Clusters, Tables, and Application Profiles.
Quickstart
The following "Hello World" program should give you a sense of how to use the library.
#include "google/cloud/bigtable/table.h"
int main(int argc, char* argv[]) try {
if (argc != 4) {
std::string const cmd = argv[0];
auto last_slash = std::string(cmd).find_last_of('/');
std::cerr << "Usage: " << cmd.substr(last_slash + 1)
<< " <project_id> <instance_id> <table_id>\n";
return 1;
}
std::string const project_id = argv[1];
std::string const instance_id = argv[2];
std::string const table_id = argv[3];
// Create a namespace alias to make the code easier to read.
namespace cbt = ::google::cloud::bigtable;
cbt::Table table(cbt::MakeDataConnection(),
cbt::TableResource(project_id, instance_id, table_id));
std::string row_key = "r1";
std::string column_family = "cf1";
std::cout << "Getting a single row by row key:" << std::flush;
google::cloud::StatusOr<std::pair<bool, cbt::Row>> result =
table.ReadRow(row_key, cbt::Filter::FamilyRegex(column_family));
if (!result) throw std::move(result).status();
if (!result->first) {
std::cout << "Cannot find row " << row_key << " in the table: " << table_id
<< "\n";
return 0;
}
cbt::Cell const& cell = result->second.cells().front();
std::cout << cell.family_name() << ":" << cell.column_qualifier() << " @ "
<< cell.timestamp().count() << "us\n"
<< '"' << cell.value() << '"' << "\n";
return 0;
} catch (google::cloud::Status const& status) {
std::cerr << "google::cloud::Status thrown: " << status << "\n";
return 1;
}
Error Handling to learn how the library reports run-time errors.
Environment Variables for environment variables affecting the library. Some of these environment variables enable logging to the console. This can be an effective approach to diagnose runtime problems.
The Setting up your development environment guide describes how to set up a C++ development environment in various platforms, including the Google Cloud C++ client libraries.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["\u003cp\u003eThis webpage provides documentation for the Google Cloud Bigtable C++ Client library, which enables C++ applications to access and manage Cloud Bigtable.\u003c/p\u003e\n"],["\u003cp\u003eThe library offers functions to perform admin operations, such as listing, reading, writing, and deleting Instances, Clusters, Tables, and Application Profiles within Cloud Bigtable.\u003c/p\u003e\n"],["\u003cp\u003eVersion 2.37.0-rc is the latest version available, while numerous prior versions can be found listed and accessible through this documentation, with version 2.18.0 having the most links to information.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation includes examples and guides for getting started, advanced operations, administrative tasks, error handling, environment variables, endpoint overrides, authentication configuration, and mocking.\u003c/p\u003e\n"]]],[],null,["Version 2.18.0keyboard_arrow_down\n\n- [2.42.0-rc (latest)](/cpp/docs/reference/bigtable/latest)\n- [2.41.0](/cpp/docs/reference/bigtable/2.41.0)\n- [2.40.0](/cpp/docs/reference/bigtable/2.40.0)\n- [2.39.0](/cpp/docs/reference/bigtable/2.39.0)\n- [2.38.0](/cpp/docs/reference/bigtable/2.38.0)\n- [2.37.0](/cpp/docs/reference/bigtable/2.37.0)\n- [2.36.0](/cpp/docs/reference/bigtable/2.36.0)\n- [2.35.0](/cpp/docs/reference/bigtable/2.35.0)\n- [2.34.0](/cpp/docs/reference/bigtable/2.34.0)\n- [2.33.0](/cpp/docs/reference/bigtable/2.33.0)\n- [2.32.0](/cpp/docs/reference/bigtable/2.32.0)\n- [2.31.0](/cpp/docs/reference/bigtable/2.31.0)\n- [2.30.0](/cpp/docs/reference/bigtable/2.30.0)\n- [2.29.0](/cpp/docs/reference/bigtable/2.29.0)\n- [2.28.0](/cpp/docs/reference/bigtable/2.28.0)\n- [2.27.0](/cpp/docs/reference/bigtable/2.27.0)\n- [2.26.0](/cpp/docs/reference/bigtable/2.26.0)\n- [2.25.1](/cpp/docs/reference/bigtable/2.25.1)\n- [2.24.0](/cpp/docs/reference/bigtable/2.24.0)\n- [2.23.0](/cpp/docs/reference/bigtable/2.23.0)\n- [2.22.1](/cpp/docs/reference/bigtable/2.22.1)\n- [2.21.0](/cpp/docs/reference/bigtable/2.21.0)\n- [2.20.0](/cpp/docs/reference/bigtable/2.20.0)\n- [2.19.0](/cpp/docs/reference/bigtable/2.19.0)\n- [2.18.0](/cpp/docs/reference/bigtable/2.18.0)\n- [2.17.0](/cpp/docs/reference/bigtable/2.17.0)\n- [2.16.0](/cpp/docs/reference/bigtable/2.16.0)\n- [2.15.1](/cpp/docs/reference/bigtable/2.15.1)\n- [2.14.0](/cpp/docs/reference/bigtable/2.14.0)\n- [2.13.0](/cpp/docs/reference/bigtable/2.13.0)\n- [2.12.0](/cpp/docs/reference/bigtable/2.12.0)\n- [2.11.0](/cpp/docs/reference/bigtable/2.11.0) \n\nGoogle Cloud Platform Bigtable C++ Client Library\n=================================================\n\nCloud Bigtable is Google's NoSQL Big Data database service. It's the same database that powers many core Google services, including Search, Analytics, Maps, and Gmail.\n\nThe Cloud Bigtable C++ Client library offers types and functions to access Cloud Bigtable from C++ applications. It offers access to the Cloud Bigtable API, including admin operations to list, read, write, and delete [Instances, Clusters](https://cloud.google.com/bigtable/docs/instances-clusters-nodes), [Tables](https://cloud.google.com/bigtable/docs/overview), and [Application Profiles](https://cloud.google.com/bigtable/docs/app-profiles).\n\n### Quickstart\n\nThe following \"Hello World\" program should give you a sense of how to use the library. \n\n #include \"google/cloud/bigtable/table.h\"\n\n int main(int argc, char* argv[]) try {\n if (argc != 4) {\n std::string const cmd = argv[0];\n auto last_slash = std::string(cmd).find_last_of('/');\n std::cerr \u003c\u003c \"Usage: \" \u003c\u003c cmd.substr(last_slash + 1)\n \u003c\u003c \" \u003cproject_id\u003e \u003cinstance_id\u003e \u003ctable_id\u003e\\n\";\n return 1;\n }\n\n std::string const project_id = argv[1];\n std::string const instance_id = argv[2];\n std::string const table_id = argv[3];\n\n // Create a namespace alias to make the code easier to read.\n namespace cbt = ::google::cloud::bigtable;\n\n cbt::Table table(cbt::MakeDataConnection(),\n cbt::TableResource(project_id, instance_id, table_id));\n\n std::string row_key = \"r1\";\n std::string column_family = \"cf1\";\n\n std::cout \u003c\u003c \"Getting a single row by row key:\" \u003c\u003c std::flush;\n google::cloud::StatusOr\u003cstd::pair\u003cbool, cbt::Row\u003e\u003e result =\n table.ReadRow(row_key, cbt::Filter::FamilyRegex(column_family));\n if (!result) throw std::move(result).status();\n if (!result-\u003efirst) {\n std::cout \u003c\u003c \"Cannot find row \" \u003c\u003c row_key \u003c\u003c \" in the table: \" \u003c\u003c table_id\n \u003c\u003c \"\\n\";\n return 0;\n }\n\n cbt::Cell const& cell = result-\u003esecond.cells().front();\n std::cout \u003c\u003c cell.family_name() \u003c\u003c \":\" \u003c\u003c cell.column_qualifier() \u003c\u003c \" @ \"\n \u003c\u003c cell.timestamp().count() \u003c\u003c \"us\\n\"\n \u003c\u003c '\"' \u003c\u003c cell.value() \u003c\u003c '\"' \u003c\u003c \"\\n\";\n\n return 0;\n } catch (google::cloud::Status const& status) {\n std::cerr \u003c\u003c \"google::cloud::Status thrown: \" \u003c\u003c status \u003c\u003c \"\\n\";\n return 1;\n }\n\n### More Information\n\n- Read more about [Cloud Bigtable](https://cloud.google.com/bigtable/docs/)\n- [`Table::ReadRow()`](/cpp/docs/reference/bigtable/2.18.0/classgoogle_1_1cloud_1_1bigtable_1_1Table#classgoogle_1_1cloud_1_1bigtable_1_1Table_1a94a5e33606a43b60905738b38b7a915d) - to read a single row from an existing Table\n- [`Table::ReadRows()`](/cpp/docs/reference/bigtable/2.18.0/classgoogle_1_1cloud_1_1bigtable_1_1Table#classgoogle_1_1cloud_1_1bigtable_1_1Table_1a337d7204d6ca65ccf7824a53ead0dfdb) - to read multiple rows from an existing Table\n- [`Table::Apply()`](/cpp/docs/reference/bigtable/2.18.0/classgoogle_1_1cloud_1_1bigtable_1_1Table#classgoogle_1_1cloud_1_1bigtable_1_1Table_1af366b667670d71c5e6bca30a2590177a) - to update or insert new rows into a Table\n- [`Table::BulkApply()`](/cpp/docs/reference/bigtable/2.18.0/classgoogle_1_1cloud_1_1bigtable_1_1Table#classgoogle_1_1cloud_1_1bigtable_1_1Table_1aee7d2d4f21852b395656f25935929fa9) - to update or insert multiple rows into a Table\n- [Getting Started with Bigtable](/cpp/docs/reference/bigtable/2.18.0/bigtable-hello-world)\n- [Advanced Reading and Writing Samples](/cpp/docs/reference/bigtable/2.18.0/bigtable-samples-data-client)\n- [Getting Started with Bigtable Table Administrative Operations](/cpp/docs/reference/bigtable/2.18.0/bigtable-hello-table-admin)\n- [Getting Started with Bigtable Instance Administrative Operations](/cpp/docs/reference/bigtable/2.18.0/bigtable-hello-instance-admin)\n- [Error Handling](/cpp/docs/reference/bigtable/2.18.0/bigtable-error-handling) to learn how the library reports run-time errors.\n- [Environment Variables](/cpp/docs/reference/bigtable/2.18.0/bigtable-environment-variables) for environment variables affecting the library. Some of these environment variables enable logging to the console. This can be an effective approach to diagnose runtime problems.\n- [Override the default endpoint](/cpp/docs/reference/bigtable/2.18.0/bigtable-endpoint-example)\n- [Override the authentication configuration](/cpp/docs/reference/bigtable/2.18.0/bigtable-auth-example)\n- [Override Retry, Backoff, and Idempotency Policies](/cpp/docs/reference/bigtable/2.18.0/bigtable-override-retry)\n- [Mocking the Cloud Bigtable C++ client](/cpp/docs/reference/bigtable/2.18.0/bigtable-mocking)\n- The [Setting up your development environment](https://cloud.google.com/cpp/docs/setup) guide describes how to set up a C++ development environment in various platforms, including the Google Cloud C++ client libraries."]]