{"id":18250526,"url":"https://github.com/dropwizard/dropwizard-foundationdb","last_synced_at":"2025-04-04T16:31:28.372Z","repository":{"id":35335102,"uuid":"185870937","full_name":"dropwizard/dropwizard-foundationdb","owner":"dropwizard","description":"A convenience library for the integration of FoundationDB and various layers in a Dropwizard service.","archived":false,"fork":false,"pushed_at":"2024-10-17T04:44:24.000Z","size":322,"stargazers_count":11,"open_issues_count":2,"forks_count":3,"subscribers_count":6,"default_branch":"release/4.0.x","last_synced_at":"2024-10-20T05:52:25.545Z","etag":null,"topics":["dropwizard","foundationdb"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dropwizard.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-09T20:59:40.000Z","updated_at":"2024-10-13T23:37:14.000Z","dependencies_parsed_at":"2024-01-11T05:58:45.368Z","dependency_job_id":"a93c8bf1-de4d-43e9-a700-70c1e71d449e","html_url":"https://github.com/dropwizard/dropwizard-foundationdb","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-foundationdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-foundationdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-foundationdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-foundationdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dropwizard","download_url":"https://codeload.github.com/dropwizard/dropwizard-foundationdb/tar.gz/refs/heads/release/4.0.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223149947,"owners_count":17095954,"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":["dropwizard","foundationdb"],"created_at":"2024-11-05T09:45:00.979Z","updated_at":"2024-11-05T09:45:02.092Z","avatar_url":"https://github.com/dropwizard.png","language":"Java","readme":"# dropwizard-foundationdb\n[![Build](https://github.com/dropwizard/dropwizard-foundationdb/workflows/Build/badge.svg)](https://github.com/dropwizard/dropwizard-foundationdb/actions?query=workflow%3ABuild)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dropwizard_dropwizard-foundationdb\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=dropwizard_dropwizard-foundationdb)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.dropwizard.modules/dropwizard-foundationdb/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.dropwizard.modules/dropwizard-foundationdb/)\n\nProvides easy integration for Dropwizard applications with [FoundationDB](https://apple.github.io/foundationdb/) and various layers. \n\nThis bundle comes with out-of-the-box support for:\n* Configuration\n* Cluster connection lifecycle management\n* Cluster health checks\n* Metrics instrumentation for FoundationDB APIs\n* Support for the [Record Layer](https://www.github.com/FoundationDB/fdb-record-layer)\n\nPossible future additions include:\n* Support for the [Document Layer](https://github.com/FoundationDB/fdb-document-layer)\n* Distributed tracing integration \n\nFor more information on FoundationDB, take a look at the official documentation here: https://apple.github.io/foundationdb/\n\nFor more information on Record Layer, take a look at the documentation located here: https://foundationdb.github.io/fdb-record-layer/\n\n## Dropwizard Version Support Matrix\ndropwizard-foundationdb | Dropwizard v1.3.x  | Dropwizard v2.0.x  | Dropwizard v2.1.x\n----------------------- | ------------------ | ------------------ | ------------------\nv1.3.x                  | :white_check_mark: | :white_check_mark: | :white_check_mark:\nv1.4.x                  | :white_check_mark: | :white_check_mark: | :white_check_mark:\nv1.5.x                  | :white_check_mark: | :white_check_mark: | :white_check_mark:\nv2.0.x                  | :question:         | :question:         | :white_check_mark:\n\n\n## Usage\nAdd dependency on library.\n\nMaven:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.dropwizard.modules\u003c/groupId\u003e\n  \u003cartifactId\u003edropwizard-foundationdb\u003c/artifactId\u003e\n  \u003cversion\u003e${dropwizard-foundationdb.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nGradle:\n```groovy\ncompile \"io.dropwizard.modules:dropwizard-foundationdb:$dropwizardFoundationDBVersion\"\n```\n\n### Foundation DB Usage\nIn your Dropwizard `Configuration` class, configure a `FoundationDBFactory`\n```java\n@Valid\n@NotNull\n@JsonProperty(\"fdb\")\nprivate FoundationDBFactory fdbFactory;\n```\n\nThen, in your `Application` class, you'll want to do something similar to the following:\n```java\nprivate final FoundationDBBundle\u003cExampleConfiguration\u003e foundationdb = new FoundationDBBundle\u003cExampleConfiguration\u003e() {\n    @Override\n    public FoundationDBFactory getFoundationDBFactory(ExampleConfiguration configuration) {\n        return configuration.getFDBFactory();\n    }\n};\n\n@Override\npublic void initialize(Bootstrap\u003cExampleConfiguration\u003e bootstrap) {\n    bootstrap.addBundle(foundationdb);\n}\n\n@Override\npublic void run(ExampleConfiguration config, Environment environment) {\n    final PersonDAO dao = new PersonDAO(foundationdb.getDatabase());\n    environment.jersey().register(new UserResource(dao));\n}\n```\n\nConfigure your factory in your `config.yml` file:\n```yaml\nfdb:\n  name: FoundationDB # Default value\n  apiVersion: 600\n  clusterFilePath: /path/to/cluster/file/fdb_dev.cluster\n  dataCenter: DC1\n  # Optional configuration for health check subspace, timeout and max retries\n  healthCheckTimeout: 5s # Default value\n  healthCheckRetries: 5 # Default value\n  healthCheckSubspace: health-checking # Default value\n  # Optional TLS configuration for TLS-enabled clusters\n  security:\n    type: multi-file\n    certificateChainFilePath: /path/to/keystore/keystore.pem\n    keyFilePath: /path/to/keystore/keystore.pem\n    password: somePasswordHere\n    verifyPeers: Root.CN=Some Root CA\n    caFilePath: /etc/ssl/certs/ca-bundle.crt # Default value\n```\n\n### Record Layer Usage\nIn your Dropwizard `Configuration` class, configure a `RecordLayerFactory`\n```java\n@Valid\n@NotNull\n@JsonProperty(\"recordLayer\")\nprivate RecordLayerFactory recordLayerFactory;\n```\n\nThen, in your `Application` class, you'll want to do something similar to the following:\n```java\nprivate final RecordLayerBundle\u003cExampleConfiguration\u003e recordLayer = new RecordLayerBundle\u003cExampleConfiguration\u003e() {\n    @Override\n    public RecordLayerFactory getRecordLayerFactory(ExampleConfiguration configuration) {\n        return configuration.getRecordLayerFactory();\n    }\n};\n\n@Override\npublic void initialize(Bootstrap\u003cExampleConfiguration\u003e bootstrap) {\n    bootstrap.addBundle(recordLayer);\n}\n\n@Override\npublic void run(ExampleConfiguration config, Environment environment) {\n    final PersonDAO dao = new PersonDAO(recordLayer.getDatabase());\n    environment.jersey().register(new UserResource(dao));\n}\n```\n\nConfigure your factory in your `config.yml` file:\n```yaml\nrecordLayer:\n  name: RecordLayer # Default value\n  maxRetriableTransactionAttempts: 5\n  initialTransactionRetryDelay: 5ms\n  maxTransactionRetryDelay: 500ms\n  directoryCacheSize: 10\n  traceLogGroup: default\n  reverseDirectoryMaxTimePerTransaction: 2500ms\n  reverseDirectoryMaxRowsPerTransaction: 11000\n  clusterFilePath: src/test/resources/fdb_dev.cluster\n  dataCenter: DC1\n  # Optional configuration for health check subspace, timeout and max retries\n  healthCheckTimeout: 5s # Default value\n  healthCheckRetries: 5 # Default value\n  healthCheckSubspace: health-checking # Default value\n  # Optional TLS configuration for TLS-enabled clusters\n  security:\n    enabled: true # Defaulted to true, if the security factory is defined\n    type: multi-file\n    certificateChainFilePath: /path/to/keystore/keystore.pem\n    keyFilePath: /path/to/keystore/keystore.pem\n    password: somePasswordHere\n    verifyPeers: Root.CN=Some Root CA\n    caFilePath: /etc/ssl/certs/ca-bundle.crt # Default value\n```\n#### API Versions and Record Layer\nThere is an `apiVersion` configuration available in the `RecordLayerFactory` class that may be configured. However, record layer itself pins library versions \nto an apiVersion in their database initialization code. Therefore, the value specified for the `apiVersion` **must** match what record layer expects.\nBy default in the dropwizard-foundationdb module, we will pin to the same version as record layer for the version of the record layer we include. If for some reason\nyou as a user need to upgrade record layer independent of dropwizard-foundationdb, **only then should you override the `apiVersion` value.**  \n\n### TLS Configuration Info\nFor more details on working with a TLS-enabled FoundationDB cluster, see the following docs: https://apple.github.io/foundationdb/tls.html\n\n### Connecting to Multiple Clusters from a single application\nSomething to be aware, based on how some of the FoundationDB configurations work, is that some configurations in the \n`RecordLayerFactory` and `FoundationDBFactory` are global to all of the applications connections to various FoundationDB cluster. \n\nSome of these configurations include:\n* `apiVersion`\n* `traceDirectory`\n* and more, for which you should refer to the FoundationDB and Record Layer documentation (linked above) for more info.\n\nTherefore, it's important that special attention is paid to the global configuration values in cases where you need to connect to multiple clusters\nfrom a single application.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropwizard%2Fdropwizard-foundationdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdropwizard%2Fdropwizard-foundationdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropwizard%2Fdropwizard-foundationdb/lists"}