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 document outlines the \u003ccode\u003eDataClient\u003c/code\u003e class, which is used to connect to and interact with Cloud Bigtable's data manipulation APIs, providing access to the \u003ccode\u003egoogle.bigtable.v2.Bigtable\u003c/code\u003e wrappers.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDataClient\u003c/code\u003e object needs to be configured at construction and this configuration includes credentials, endpoints, timeouts, and other gRPC options; and multiple \u003ccode\u003eTable\u003c/code\u003e objects can share a single \u003ccode\u003eDataClient\u003c/code\u003e connection.\u003c/p\u003e\n"],["\u003cp\u003eIt is recommended to reuse \u003ccode\u003eDataClient\u003c/code\u003e instances as creating new objects can be time-consuming due to the connection and authentication processes with Cloud Bigtable servers.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDataConnection\u003c/code\u003e class is now the preferred way to interact with the Bigtable data API, with a migration guide available for those still using \u003ccode\u003eDataClient\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDataClient\u003c/code\u003e class has several deprecated functions, including \u003ccode\u003eChannel()\u003c/code\u003e, \u003ccode\u003ereset()\u003c/code\u003e, and \u003ccode\u003eBackgroundThreadsFactory()\u003c/code\u003e, that are scheduled for deletion.\u003c/p\u003e\n"]]],[],null,["# Class DataClient (2.15.1)\n\nVersion 2.15.1keyboard_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.15.1/classgoogle_1_1cloud_1_1bigtable_1_1Table) objects may share a connection via a single [`DataClient`](/cpp/docs/reference/bigtable/2.15.1/classgoogle_1_1cloud_1_1bigtable_1_1DataClient) object. The [`DataClient`](/cpp/docs/reference/bigtable/2.15.1/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.15.1/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.15.1/classgoogle_1_1cloud_1_1bigtable_1_1DataClient) instances when possible.\n| **Deprecated:**\n|\n|\n| [`google::cloud::bigtable::DataConnection`](/cpp/docs/reference/bigtable/2.15.1/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.15.1/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.15.1/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.15.1/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.15.1/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`"]]