{"id":13797571,"url":"https://github.com/yildizdb/bigtable","last_synced_at":"2025-05-13T04:32:00.131Z","repository":{"id":44842107,"uuid":"138584092","full_name":"yildizdb/bigtable","owner":"yildizdb","description":"TypeScript Bigtable Client with :battery::battery: included.","archived":false,"fork":false,"pushed_at":"2022-12-03T17:40:50.000Z","size":541,"stargazers_count":12,"open_issues_count":10,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-11T23:58:26.582Z","etag":null,"topics":["big-data","bigtable","google","google-cloud","hbase","key-value","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yildizdb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-25T11:11:44.000Z","updated_at":"2022-07-03T20:24:38.000Z","dependencies_parsed_at":"2023-01-23T04:46:36.325Z","dependency_job_id":null,"html_url":"https://github.com/yildizdb/bigtable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yildizdb%2Fbigtable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yildizdb%2Fbigtable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yildizdb%2Fbigtable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yildizdb%2Fbigtable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yildizdb","download_url":"https://codeload.github.com/yildizdb/bigtable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225176594,"owners_count":17433009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["big-data","bigtable","google","google-cloud","hbase","key-value","nodejs","typescript"],"created_at":"2024-08-04T00:00:24.277Z","updated_at":"2024-11-18T12:31:21.684Z","avatar_url":"https://github.com/yildizdb.png","language":"TypeScript","funding_links":[],"categories":["Cool Stuff"],"sub_categories":["Interesting Projects"],"readme":"# bigtable-client\n\n`yarn add bigtable-client`\n\n## Intro\n\nThis is a TypeScript Bigtable client, it acts as wrapper around the official \nGoogle package [@google-cloud/bigtable](https://github.com/googleapis/nodejs-bigtable).\nWhen working with Bigtable we almost always had the urge to wrap the API to add a pinch\nof convenience to it, as well implement a way to get TTL (per cell basis), as well as metadata\ninformation such as a simple count more efficiently.\n\nThis client automatically manages a `metadata` table and `ttl jobs` for every table that you manage\nthrough it. Additionally it aims to mimic a simple CRUD interface, that is offered by a lot of redis packages\nlike `ioredis` for example.\n\nAdditionally the setup and all operation (except for scan) are optimized for sub-millisecond response times\n(depending on your Google Cloud Bigtable Instance configuration), which helps you to develop real-time\napplications based on this Bigtable. This client is not ment to be used for analytical purposes, although\nit is fairly possible through scan operations.\n\n## Before you get started\n\nMake sure to follow the setup described [here](https://github.com/googleapis/nodejs-bigtable#before-you-begin).\nYou will need a Google Cloud Project with enabled billing, as well as a\nsetup authentication flow for this client to work.\n\n## Using\n\nUsing it is fairly simple:\n\nFirst, you have to setup a factory instance, which gets the general\nconfiguration to connect to your Bigtable instance.\nNOTE: If the instance you describe does not exist, it will be created.\n\n```javascript\nconst {BigtableFactory} = require(\"bigtable-client\");\nconst bigtableFactory = new BigtableFactory({\n\n  projectId: \"my-project-1\", // -\u003e see @google-cloud/bigtable configuration\n  instanceName: \"my-bigtable-cluster\", // -\u003e see @google-cloud/bigtable configuration\n  //keyFilename: \"keyfile.json\", // -\u003e see @google-cloud/bigtable configuration\n\n  // optional:\n  ttlScanIntervalMs: 5000,\n  minJitterMs: 2000,\n  maxJitterMs: 30000,\n});\nawait bigtableFactory.init();\n```\n\nThen, using the factory you can create handles for you tables very easily.\nYou can see that we are taking away the complexity of handling columnFamilies and\ncolumns in general, by assuming default values in the API that can be set via config optionally.\nHowever the API always allows you to access cells (by passing a column name as parameter) directly,\nas well as accessing and deleting whole rows. Please bear in mind that the number is TTL in seconds, \nand will be deleted on the next job run.\n\n```javascript\nconst myTable = await bigtableFactory.get({\n  name: \"mytable\",\n\n  // optional:\n  columnFamily: \"myfamily\",\n  defaultColumn: \"default\",\n  maxVersions: 1,\n});\n\nconst rowKey = \"myrowkey\";\nconst value = \"myvalue\";\n\nawait myTable.set(rowKey, value);\nawait myTable.set(rowKey, value, 10, \"newColumn\");\n\nawait myTable.ttl(rowKey);\n\nawait myTable.multiSet(rowKey, {testColumn: \"hello\", anotherColumn: \"yes\"}, 5);\n\nawait myTable.increase(rowKey);\nawait myTable.decrease(rowKey);\n\nawait myTable.bulkInsert([\n    {\n    row: \"jean-paul\",\n    column: \"sartre\",\n    data: \"france\",\n    },\n    {\n    row: \"emmanuel\",\n    column: \"kant\",\n    data: \"germany\",\n    },\n    {\n    row: \"baruch\",\n    column: \"spinoza\",\n    data: \"netherland\",\n    },\n], 5);\n\nawait myTable.multiAdd(rowKey, {foo: 1, bar: -5}, 7);\nawait myTable.get(rowKey);\n\nawait myTable.ttl(rowKey);\nawait myTable.count();\n\nawait myTable.getRow(rowKey)\nawait myTable.deleteRow(rowKey);\n\nmyTable.close(); // or bigtableFactory.close();\n```\n\nYou can also scan tables (be carefull as these operations are slow).\n\n```javascript\nconst filters = [\n    {\n        // -\u003e check out the official api for bigtable filters: https://cloud.google.com/nodejs/docs/reference/bigtable/0.13.x/Filter#interleave\n    }\n];\n\nconst etl = (row) =\u003e {\n    return row.id || null;\n};\n\nconst cells = await myTable.scanCells(filters, etl);\n```\n\nYou can activate debug logs via env variable `DEBUG=yildiz:bigtable:*`.\n\nYou can find additional implementation examples here:\n* [Example File](example/index.ts)\n* [Integration Test](test/int/Service.test.js)\n\n# License\n\nLicense is MIT\n\n# Disclaimer\n\nThis project is not associated with Google.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyildizdb%2Fbigtable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyildizdb%2Fbigtable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyildizdb%2Fbigtable/lists"}