Connects to Cloud Bigtable's data manipulation APIs.
This class is used by the Cloud Bigtable wrappers to access Cloud Bigtable. Multiple bigtable::Table objects may share a connection via a single DataClient object. The DataClient object is configured at construction time, this configuration includes the credentials, access endpoints, default timeouts, and other gRPC configuration options. This is an interface class because it is also used as a dependency injection point in some of the tests.
Cost
Applications should avoid unnecessarily creating new objects of type DataClient. Creating a new object of this type typically requires connecting to the Cloud Bigtable servers, and performing the authentication workflows with Google Cloud Platform. These operations can take many milliseconds, therefore applications should try to reuse the same DataClient instances when possible.
[[["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 page details the \u003ccode\u003eDataClient\u003c/code\u003e class, which is integral for interacting with Cloud Bigtable's data manipulation APIs within the C++ client library.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDataClient\u003c/code\u003e class facilitates access to Bigtable data and can be shared among multiple \u003ccode\u003ebigtable::Table\u003c/code\u003e objects to reuse connections.\u003c/p\u003e\n"],["\u003cp\u003eIt's recommended to reuse \u003ccode\u003eDataClient\u003c/code\u003e instances rather than creating new ones unnecessarily, as creating new instances involves resource-intensive authentication and connection processes with Cloud Bigtable servers.\u003c/p\u003e\n"],["\u003cp\u003eThe preferred method for interacting with the Bigtable Data API is now through \u003ccode\u003egoogle::cloud::bigtable::DataConnection\u003c/code\u003e, and users are provided with a link for migrating code from \u003ccode\u003eDataClient\u003c/code\u003e to it.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation covers a range of functions such as \u003ccode\u003eMutateRow\u003c/code\u003e, \u003ccode\u003eCheckAndMutateRow\u003c/code\u003e, \u003ccode\u003eReadRows\u003c/code\u003e, and \u003ccode\u003eSampleRowKeys\u003c/code\u003e, that allow for various data operations on Cloud Bigtable, also, the deprecated functions and the newer options for their previous functionality are highlighted.\u003c/p\u003e\n"]]],[],null,["# Class DataClient (2.20.0)\n\nVersion 2.20.0keyboard_arrow_down\n\n- [2.42.0-rc (latest)](/cpp/docs/reference/bigtable/latest/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.41.0](/cpp/docs/reference/bigtable/2.41.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.40.0](/cpp/docs/reference/bigtable/2.40.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.39.0](/cpp/docs/reference/bigtable/2.39.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.38.0](/cpp/docs/reference/bigtable/2.38.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.37.0](/cpp/docs/reference/bigtable/2.37.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.36.0](/cpp/docs/reference/bigtable/2.36.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.35.0](/cpp/docs/reference/bigtable/2.35.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.34.0](/cpp/docs/reference/bigtable/2.34.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.33.0](/cpp/docs/reference/bigtable/2.33.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.32.0](/cpp/docs/reference/bigtable/2.32.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.31.0](/cpp/docs/reference/bigtable/2.31.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.30.0](/cpp/docs/reference/bigtable/2.30.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.29.0](/cpp/docs/reference/bigtable/2.29.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.28.0](/cpp/docs/reference/bigtable/2.28.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.27.0](/cpp/docs/reference/bigtable/2.27.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.26.0](/cpp/docs/reference/bigtable/2.26.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.25.1](/cpp/docs/reference/bigtable/2.25.1/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.24.0](/cpp/docs/reference/bigtable/2.24.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.23.0](/cpp/docs/reference/bigtable/2.23.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.22.1](/cpp/docs/reference/bigtable/2.22.1/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.21.0](/cpp/docs/reference/bigtable/2.21.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.20.0](/cpp/docs/reference/bigtable/2.20.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.19.0](/cpp/docs/reference/bigtable/2.19.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.18.0](/cpp/docs/reference/bigtable/2.18.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.17.0](/cpp/docs/reference/bigtable/2.17.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.16.0](/cpp/docs/reference/bigtable/2.16.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.15.1](/cpp/docs/reference/bigtable/2.15.1/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.14.0](/cpp/docs/reference/bigtable/2.14.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.13.0](/cpp/docs/reference/bigtable/2.13.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.12.0](/cpp/docs/reference/bigtable/2.12.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient)\n- [2.11.0](/cpp/docs/reference/bigtable/2.11.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient) \nConnects to Cloud Bigtable's data manipulation APIs. \nThis class is used by the Cloud Bigtable wrappers to access Cloud Bigtable. Multiple [`bigtable::Table`](/cpp/docs/reference/bigtable/2.20.0/classgoogle_1_1cloud_1_1bigtable_1_1Table) objects may share a connection via a single [`DataClient`](/cpp/docs/reference/bigtable/2.20.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient) object. The [`DataClient`](/cpp/docs/reference/bigtable/2.20.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient) object is configured at construction time, this configuration includes the credentials, access endpoints, default timeouts, and other gRPC configuration options. This is an interface class because it is also used as a dependency injection point in some of the tests.\n\n###### Cost\n\nApplications should avoid unnecessarily creating new objects of type [`DataClient`](/cpp/docs/reference/bigtable/2.20.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient). Creating a new object of this type typically requires connecting to the Cloud Bigtable servers, and performing the authentication workflows with Google Cloud Platform. These operations can take many milliseconds, therefore applications should try to reuse the same [`DataClient`](/cpp/docs/reference/bigtable/2.20.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient) instances when possible.\n| **Deprecated:**\n|\n|\n| [`google::cloud::bigtable::DataConnection`](/cpp/docs/reference/bigtable/2.20.0/classgoogle_1_1cloud_1_1bigtable_1_1DataConnection) is the preferred way to communicate with the Bigtable Data API. To migrate existing code, see [Migrating from DataClient](/cpp/docs/reference/bigtable/2.20.0/migrating-from-dataclient).\n\n\u003cbr /\u003e\n\nFunctions\n---------\n\n### MutateRow(grpc::ClientContext \\*, google::bigtable::v2::MutateRowRequest const \\&, google::bigtable::v2::MutateRowResponse \\*)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### AsyncMutateRow(grpc::ClientContext \\*, google::bigtable::v2::MutateRowRequest const \\&, grpc::CompletionQueue \\*)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### CheckAndMutateRow(grpc::ClientContext \\*, google::bigtable::v2::CheckAndMutateRowRequest const \\&, google::bigtable::v2::CheckAndMutateRowResponse \\*)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### AsyncCheckAndMutateRow(grpc::ClientContext \\*, google::bigtable::v2::CheckAndMutateRowRequest const \\&, grpc::CompletionQueue \\*)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### ReadModifyWriteRow(grpc::ClientContext \\*, google::bigtable::v2::ReadModifyWriteRowRequest const \\&, google::bigtable::v2::ReadModifyWriteRowResponse \\*)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### AsyncReadModifyWriteRow(grpc::ClientContext \\*, google::bigtable::v2::ReadModifyWriteRowRequest const \\&, grpc::CompletionQueue \\*)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### ReadRows(grpc::ClientContext \\*, google::bigtable::v2::ReadRowsRequest const \\&)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### AsyncReadRows(grpc::ClientContext \\*, google::bigtable::v2::ReadRowsRequest const \\&, grpc::CompletionQueue \\*, void \\*)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### PrepareAsyncReadRows(::grpc::ClientContext \\*, google::bigtable::v2::ReadRowsRequest const \\&, grpc::CompletionQueue \\*)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### SampleRowKeys(grpc::ClientContext \\*, google::bigtable::v2::SampleRowKeysRequest const \\&)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### AsyncSampleRowKeys(grpc::ClientContext \\*, google::bigtable::v2::SampleRowKeysRequest const \\&, grpc::CompletionQueue \\*, void \\*)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### virtual PrepareAsyncSampleRowKeys(grpc::ClientContext \\*, google::bigtable::v2::SampleRowKeysRequest const \\&, grpc::CompletionQueue \\*)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### MutateRows(grpc::ClientContext \\*, google::bigtable::v2::MutateRowsRequest const \\&)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### AsyncMutateRows(::grpc::ClientContext \\*, google::bigtable::v2::MutateRowsRequest const \\&, grpc::CompletionQueue \\*, void \\*)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### PrepareAsyncMutateRows(grpc::ClientContext \\*, google::bigtable::v2::MutateRowsRequest const \\&, grpc::CompletionQueue \\*)\n\nthe google.bigtable.v2.Bigtable wrappers.\n\n### project_id() const\n\n### instance_id() const\n\n### Channel()\n\nReturn a new channel to handle admin operations. \nIntended to access rarely used services in the same endpoints as the Bigtable admin interfaces, for example, the google.longrunning.Operations.\n| **Deprecated:** This member function is scheduled for deletion and [`DataClient`](/cpp/docs/reference/bigtable/2.20.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient) will be marked as `final`. Do not extend this class. Application developers who need to configure the gRPC Channel can pass any of the following options into `MakeDataClient(...)`: - [`google::cloud::GrpcChannelArgumentsOption`](https://cloud.google.com/cpp/docs/reference/common/latest/structgoogle_1_1cloud_1_1GrpcChannelArgumentsOption.html) - [`google::cloud::GrpcChannelArgumentsNativeOption`](https://cloud.google.com/cpp/docs/reference/common/latest/structgoogle_1_1cloud_1_1GrpcChannelArgumentsNativeOption.html)\n\n### reset()\n\nReset and create new Channels. \n| **Deprecated:** This member function is scheduled for deletion and [`DataClient`](/cpp/docs/reference/bigtable/2.20.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient) will be marked as `final`. Do not extend this class. The client library will handle all interactions with the gRPC channels.\n\n### BackgroundThreadsFactory()\n\nThe thread factory this client was created with. \n| **Deprecated:** This member function is scheduled for deletion and [`DataClient`](/cpp/docs/reference/bigtable/2.20.0/classgoogle_1_1cloud_1_1bigtable_1_1DataClient) will be marked as `final`. Do not extend this class. Application developers who need to configure the background threads can pass any of the following options into `MakeDataClient(...)`: - [`google::cloud::GrpcBackgroundThreadPoolSizeOption`](https://cloud.google.com/cpp/docs/reference/common/latest/structgoogle_1_1cloud_1_1GrpcBackgroundThreadPoolSizeOption.html) - [`google::cloud::GrpcCompletionQueueOption`](https://cloud.google.com/cpp/docs/reference/common/latest/structgoogle_1_1cloud_1_1GrpcCompletionQueueOption.html) - `google::cloud::GrpcBackgroundThreadFactoryOption`"]]