{"id":24901758,"url":"https://github.com/antonsjava/tempdb","last_synced_at":"2025-10-23T14:50:05.357Z","repository":{"id":57719553,"uuid":"251379639","full_name":"antonsjava/tempdb","owner":"antonsjava","description":"Simple file based db for storing data too big to be stored in memory.","archived":false,"fork":false,"pushed_at":"2021-12-15T20:18:26.000Z","size":24,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T22:32:27.101Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/antonsjava.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":"2020-03-30T17:31:13.000Z","updated_at":"2021-12-15T20:18:29.000Z","dependencies_parsed_at":"2022-09-02T12:31:23.249Z","dependency_job_id":null,"html_url":"https://github.com/antonsjava/tempdb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/antonsjava/tempdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Ftempdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Ftempdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Ftempdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Ftempdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antonsjava","download_url":"https://codeload.github.com/antonsjava/tempdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Ftempdb/sbom","scorecard":{"id":199759,"data":{"date":"2025-08-11","repo":{"name":"github.com/antonsjava/tempdb","commit":"0860b3fdefabc249d75c75a03608fd7b5a5cfab0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/3 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T22:36:38.121Z","repository_id":57719553,"created_at":"2025-08-16T22:36:38.121Z","updated_at":"2025-08-16T22:36:38.121Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005463,"owners_count":26083902,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-02-01T21:17:38.825Z","updated_at":"2025-10-10T22:33:02.977Z","avatar_url":"https://github.com/antonsjava.png","language":"Java","readme":"# tempdb\n\n Simple file based db for storing data too big to be stored in memory.\n\n Sometimes you are facing problem where you have large amount of data which you need \n to process. Your processing is slow and you can't keep open connection to DB or \n something similar. \n\n This small java library allows you to temporary store such data in file on filesystem.\n\n## Supported scenario\n \n There are two form of usage supported.\n \n - sequence usage - data are sequentially read and processed.You have long sequence of data which must be read from db and processed. As your processing is slow you can;t have open db connection whole time. So you can store that data to temporary file and then you can read them in same order as you store them and process it. \n - find by key usage - data are stored with keys and then are look up by that keys. If you have lot of data, which you can't query by key each time when you need them you can make small key based db and then query if locally. (BigQuery is good example for such data transfer)\n\n## Data storing \n \n It is necessary to write code which converts data ti bytes and back. Library provides \n only string storing. (I was using it for json strings.)\n But is is easy to write such code. Let say you have class\n```java\npublic class Person {\n\tString name;\n\tint age;\n}\n```\nThen de/serializers can be \n```java\npublic class PersonSerializer implements BytesSerializer\u003cPerson\u003e {\n    @Override\n    public void serialize(Person value, DataOutputStream dos) throws IOException {\n        if(value == null) throws new IOException(\"blabla\");\n        dos.writeUTF(Person.getName());\n        dos.writeInt(Person.getAge());\n    }\n}\n\npublic class PersonDeserializer implements BytesDeserializer\u003cPerson\u003e {\n    @Override\n    public Person deserialize(DataInputStream dis) throws IOException {\n\t\tPerson p = new Person();\n        p.setName(dis.readUTF());\n        p.setAge(dis.readInt());\n\t\treturn p;\n    }\n}\n```\n\n\n## Sequence usage\n\n### Separated creation and usage\n \n Creation of data and their usage are clearly separated.\n\n```java\n// creation\nSequenceDbWriter\u003cString\u003e writer = SequenceDbBuilder.instance(String.class)\n    .tempfile(\"test\", \".db\", true)\n    .serializer(StringSerialization.serializer())\n    .sequenceDbWriter();\n\nwriter.add(\"jano\");\nwriter.add(null);\nwriter.add(\"fero\");\nwriter.close();\n\n// usage\nSequenceDbReader\u003cString\u003e reader = SequenceDbBuilder.instance(String.class)\n    .dbfile(writer.dbfile()) // connection to creation phase\n    .deserializer(StringSerialization.deserializer())\n    .sequenceDbReader();\n\nAssert.assertEquals(\"jano\", reader.next());\nAssert.assertEquals(\"\", reader.next());\nAssert.assertEquals(\"fero\", reader.next());\nAssert.assertNull(reader.next());\n```\n \n### Mixed creation and usage\n \n Creation of data and their usage are mixed. This scenario use useful only if you\n want to use db as buffer. \n\n```java\nSequenceDb\u003cString\u003e db = SequenceDbBuilder.instance(String.class)\n    .tempfile(\"test\", \".db\", true)\n    .serializer(StringSerialization.serializer())\n    .deserializer(StringSerialization.deserializer())\n    .sequenceDb();\n\ndb.add(\"jano\");\nAssert.assertEquals(\"jano\", db.next());\nAssert.assertNull(db.next());\ndb.add(null);\nAssert.assertEquals(\"\", db.next());\nAssert.assertNull(db.next());\ndb.add(\"ferowww\");\nAssert.assertEquals(\"ferowww\", db.next());\nAssert.assertNull(db.next());\n\ndb.close();\n```\n\n## Find by key usage\n\n### Pure file storage\n\n In this case both data and keys are stored in file. It is safe for memory usage \n but 'slow' for creating and reading file.\n```java\nAvlTreeDb\u003cString, String\u003e db = TreeDbBuilder.instance(String.class, String.class)\n    .tempfile(\"test\", \".db\", true)\n    .keyserializer(StringSerialization.serializer())\n    .keydeserializer(StringSerialization.deserializer())\n    .serializer(StringSerialization.serializer())\n    .deserializer(StringSerialization.deserializer())\n    .avlTreeDb();\n\ndb.put(\"jano\", \"jano\");\ndb.put(\"ferowww\", \"ferowww\");\n\nAssert.assertEquals(\"jano\", db.get(\"jano\").get(0));\nAssert.assertEquals(\"ferowww\", db.get(\"ferowww\").get(0));\n\ndb.close();\n```\n\n\n### Mixed memory/file storage\n \n In this case both data are stored in file and keys are stored in memory. It is faster for \n for creating and reading file but can be problematic for memory usage. (But usually keys \n are much smaller than data and in this case it is acceptable)\n\n```java\nMapTreeDb\u003cString, String\u003e db = TreeDbBuilder.instance(String.class, String.class)\n    .tempfile(\"test\", \".db\", true)\n    .serializer(StringSerialization.serializer())\n    .deserializer(StringSerialization.deserializer())\n    .mapTreeDb();\n\ndb.put(\"jano\", \"jano\");\ndb.put(\"ferowww\", \"ferowww\");\n\nAssert.assertEquals(\"jano\", db.get(\"jano\").get(0));\nAssert.assertEquals(\"ferowww\", db.get(\"ferowww\").get(0));\n\ndb.close();\n```\n\n## Maven usage\n\n```\n   \u003cdependency\u003e\n      \u003cgroupId\u003eio.github.antonsjava\u003c/groupId\u003e\n      \u003cartifactId\u003etempdb\u003c/artifactId\u003e\n      \u003cversion\u003eLASTVERSION\u003c/version\u003e\n   \u003c/dependency\u003e\n```\nYou can find LASTVERSION [here](https://mvnrepository.com/artifact/com.github.antonsjava/tempdb)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonsjava%2Ftempdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonsjava%2Ftempdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonsjava%2Ftempdb/lists"}