Wiki
Clone wikibitsy / Home
Please visit Bitsy v3 for the Tinkerpop3-compatible version of Bitsy
Bitsy is a small, fast, embeddable, durable in-memory graph database that implements the Blueprints API.
Features
- Support for most Blueprints features including key indices and threaded transactions
- ACID guarantees on transactions
- Designed for multi-threaded OLTP applications
- Implements optimistic concurrency control
- Data stored in readable text files
- Serialization using the Jackson JSON processor
- Recovers cleanly from power failures and crashes provided the underlying file system supports metadata journaling, like NTFS, ext3, ext4, XFS and JFS (not FAT32 or ext2)
- High read and write throughputs in multi-threaded environments
- Supports online backups through a JMX interface
Getting started
Embedding Bitsy
Maven
If you are using Maven, you can add Bitsy and its dependencies to your project by adding this dependency:
<dependency> <groupId>com.lambdazen.bitsy</groupId> <artifactId>bitsy</artifactId> <version>1.5.2</version> </dependency>
The Roadmap page has the release notes as well as the objectives for upcoming releases.
Snapshots from Sonatype
You can use 1.5.3-SNAPSHOT (coming soon) for the latest fixes on 1.5.2.
Snapshots are hosted in the Sonatype OSS Maven Repository at https://oss.sonatype.org/content/groups/public/. You can configure this repository by following these instructions. The pom.xml should typically have an additional section that looks like this:
<repositories> <repository> <id>sonatype-snapshots</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> </repository> </repositories>
Without Maven
Bitsy is a packaged in a JAR file that can be downloaded from the Downloads Page. The latest stable version for production is bitsy-1.5.2.jar. You can add the JAR to your project's classpath along with the dependencies are listed here, which are also available in the Downloads Page.
Using Bitsy
The following code snippet shows how Bitsy can be launched and stopped:
import java.nio.file.Path; import com.lambdazen.bitsy.BitsyGraph; public class Test { public static void main(String[] args) { Path dbPath = Paths.get("...path to a directory..."); // Open the database BitsyGraph myGraph = new BitsyGraph(dbPath); ... use myGraph in any number of threads // Close the database myGraph.shutdown(); } }
Now you can use Bitsy like any Blueprints graph database using the Tinkerpop software stack.
Note: The above example uses the simple constructor for BitsyGraph. Refer to Tuning Bitsy for other constructors, including a memory-only (non-durable) database constructor.
Deep dive
This presentation provides an overview of Bitsy's design principles and features. The improvements in version 1.5 are summarized in this presentation. Follow me on Twitter @lambdazen for the latest developments in this project.
The following Wiki pages go into a little more detail:
- Design Principles: No Seek, No Socket and No SQL
- Optimistic concurrency: Covers the concurrency control and best practices to retry transactions
- Write algorithms: Details the different write algorithms along with the threads, buffers and logs used
- Serialization format: Specifies the JSON format for the various records in the database files
- Benchmarks: Illustrates the read and write throughputs in a multi-threaded OLTP setting (updated recently)
- Tuning Bitsy: Covers the different BitsyGraph settings and how they can be changed (updated recently)
- Monitoring and Management: Covers JMX and SLF4J integration
- Backup and Restore: Discusses offline/online backup and restore procedures
- Integrating with Rexster: Discusses integration with Rexster
- Large Objects: Handling large objects outside of Bitsy
- Fancy Indexes: Maintaining Lucene and Lucene-like indexes outside of Bitsy
- Roadmap: Lists planned releases
- Frequently Asked Questions
Licensing
Bitsy is available under the Apache 2.0 License.
Updated