{"id":13630947,"url":"https://github.com/myui/btree4j","last_synced_at":"2025-05-07T09:44:24.447Z","repository":{"id":43944726,"uuid":"113970460","full_name":"myui/btree4j","owner":"myui","description":"Disk-based B+-tree written in Pure Java","archived":false,"fork":false,"pushed_at":"2020-10-13T00:46:36.000Z","size":203,"stargazers_count":219,"open_issues_count":10,"forks_count":49,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-31T08:44:10.528Z","etag":null,"topics":["b-tree","bplustree","btree","btree-indexes","data-structures-and-algorithms","disk","indexing","java"],"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/myui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"myui"}},"created_at":"2017-12-12T09:30:24.000Z","updated_at":"2025-03-01T16:30:32.000Z","dependencies_parsed_at":"2022-09-26T22:11:01.353Z","dependency_job_id":null,"html_url":"https://github.com/myui/btree4j","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myui%2Fbtree4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myui%2Fbtree4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myui%2Fbtree4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myui%2Fbtree4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myui","download_url":"https://codeload.github.com/myui/btree4j/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252853168,"owners_count":21814473,"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":["b-tree","bplustree","btree","btree-indexes","data-structures-and-algorithms","disk","indexing","java"],"created_at":"2024-08-01T22:02:04.189Z","updated_at":"2025-05-07T09:44:24.430Z","avatar_url":"https://github.com/myui.png","language":"Java","readme":"btree4j: Disk-based Prefix B+-tree written in Pure Java\n======================================================= \n[![Donate](https://img.shields.io/badge/github-donate-yellow.svg)](https://github.com/sponsors/myui)\n[![Build Status](https://travis-ci.org/myui/btree4j.svg?branch=master)](https://travis-ci.org/myui/btree4j)\n[![License](http://img.shields.io/:license-Apache_v2-blue.svg)](https://github.com/myui/btree4j/blob/master/LICENSE)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.myui/btree4j/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.myui/btree4j)\n\n# What's Btree4j\n\nBtree4j is a disk-based [Prefix B+-tree](https://dl.acm.org/citation.cfm?id=320530) written in Pure Java.\n\nIt's pretty fast and [100k ops/sec](https://github.com/myui/btree4j/blob/master/src/test/java/btree4j/benchmark/JMHBenchmark.java) is expected even on laptop.\n\n# Using btree4j\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.myui\u003c/groupId\u003e\n    \u003cartifactId\u003ebtree4j\u003c/artifactId\u003e\n    \u003cversion\u003e0.9.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n[Find usage](https://github.com/myui/btree4j/tree/master/src/test/java/btree4j) in unit tests.\n\n# Features and Strength\n\nApplied many improvements over the original Xindice's implementation as follows:\n\n* Implementes [Prefix B+-tree](https://dl.acm.org/citation.cfm?id=320530) in which prefixes are selected carefully to minimize their length. In prefix B+-tree, key prefixes are managed by a [TRIE](https://en.wikipedia.org/wiki/Trie)-like smart algorithm.\n\n\u003e _Rudolf Bayer and Karl Unterauer. \"Prefix B-trees\", Proc. ACM Trans. Database Syst. 2, 1, pp.11-26), March 1977._ [[DOI](https://doi.org/10.1145/320521.320530 )]\n\n* Pointers are [compressed](https://github.com/myui/btree4j/blob/master/src/main/java/btree4j/utils/codec/VariableByteCodec.java) using [Variable Byte Codes](https://en.wikipedia.org/wiki/Variable-length_code) so that more keys/values are fit in memory.\n\n* Support both unique and non-unique indexing. Storing duplicate keys is allowed for non-unique indexing.\n\n* [Index file](https://en.wikipedia.org/wiki/Indexed_file) based on B+-tree is [supported](https://github.com/myui/btree4j/blob/master/src/main/java/btree4j/BTreeIndex.java). [Multiple values per a key](https://github.com/myui/btree4j/blob/master/src/main/java/btree4j/BTreeIndexDup.java) is also supported.\n [BTreeIndex](https://github.com/myui/btree4j/blob/master/src/main/java/btree4j/BTreeIndex.java) stores `\u003cbytes[] KEY, byte[] VALUE\u003e` with VALUE stored on distinct data pages and pointers to them are managed by [B+-Tree](https://github.com/myui/btree4j/blob/master/src/main/java/btree4j/BTree.java) to avoid consuming many disk pages for large values in B+-tree.\n\n* Support variable-length [key](https://github.com/myui/btree4j/blob/master/src/main/java/btree4j/Key.java)/[value](https://github.com/myui/btree4j/blob/master/src/main/java/btree4j/Value.java)\n\n* [Prefix and range search](https://github.com/myui/btree4j/blob/master/src/main/java/btree4j/indexer/BasicIndexQuery.java) is supported in addition to exact match using a [flexible callback handler](https://github.com/myui/btree4j/blob/master/src/main/java/btree4j/BTreeCallback.java). Support [LIKE match](https://github.com/myui/btree4j/blob/master/src/main/java/btree4j/indexer/LikeIndexQuery.java) using wildcards.\n\n* Paging (virtual memory) support using [LRU cache replacement policy](https://github.com/myui/btree4j/blob/master/src/main/java/btree4j/BTree.java) and [Freespace management](https://github.com/myui/btree4j/blob/master/src/main/java/btree4j/FreeList.java).\n\n* Deletion and updates are, of course, supported.\n\n* Support efficient Bulk-loading.\n\n* Minimum dependencies to external libraries. Runs on Java 8 or later.\n\n# Sponsors\n\nNo sponsors yet. Will you be the first?\n\n\u003cspan class=\"badge-githubsponsors\"\u003e\u003ca href=\"https://github.com/sponsors/myui\" title=\"Donate to this project using GitHub Sponsors\"\u003e\u003cimg src=\"https://img.shields.io/badge/github-donate-yellow.svg\" alt=\"GitHub Sponsors donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\nIt will be my motivation to continue working on this project.\n\n# Credits\n\nCopyright 2006 and onwards Makoto Yui\u003cbr/\u003e\nCopyright 1999-2007 The Apache Software Foundation\n\nThis software is originally developed for [XBird](https://github.com/myui/xbird/) based on [Apache Xindice](https://xml.apache.org/xindice/dev/guide-internals.html#3.+Data+storage).\n","funding_links":["https://github.com/sponsors/myui"],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyui%2Fbtree4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyui%2Fbtree4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyui%2Fbtree4j/lists"}