Skip to content

Commit

Permalink
Merge branch 'master' into update/HaloDB-0.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 authored Apr 17, 2024
2 parents 82386af + 3493eae commit 543af79
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 24 deletions.
7 changes: 7 additions & 0 deletions .jvmopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-Xms1024M
-Xmx4096M
-Xss512M
-XX:MaxMetaspaceSize=4096M
-XX:ReservedCodeCacheSize=500M
-XX:+TieredCompilation
-XX:-UseGCOverheadLimit
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# lightdb
Prototype database concept using Lucene and HaloDB
Prototype database concept using pluggable store + indexer

First working release with minimal functionality in `0.1.0`
## Provided Stores
- Yahoo's HaloDB (https://github.com/yahoo/HaloDB) - Preferred for performance
- MapDB (https://mapdb.org)
- Facebook's RocksDB (https://rocksdb.org)

## 0.2 TODO
- [X] Support ObjectStore.all to iterate over the entire database
## Provided Indexers
- Apache Lucene (https://lucene.apache.org) - Most featureful
- SQLite (https://www.sqlite.org) - Fastest

## 1.0 TODO
- [ ] Full implementations for indexers
- [ ] Apache Lucene index types
- [ ] SQLite index types
- [ ] More performance improvements to SQLite integration
- [ ] Better RocksDB performance
- [ ] Create backup and restore features
- [ ] Real-time backup (write changes to incremental file)
- [ ] Complete dump and restore
- [ ] Post-restore incremental restore
- [ ] Testing of empty database loads from backups if available
- [ ] Data integrity checks
- [ ] Verify data identical between store and index
- [ ] Rebuild index from store

## 1.0 TODO
- [ ] Complete Lucene type support
- [ ] Create benchmark tool to evaluate performance of basic operations to see how well this performs
- [ ] Create an SBT plugin to update base traits for case classes (ex. Person would generate PersonFields trait to be mixed into Person companion)
- [ ] Rebuild index from store
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Scala versions
val scala213 = "2.13.13"
val scala3 = "3.3.3"
val scala3 = "3.4.1"
val scala2 = List(scala213)
val allScalaVersions = scala3 :: scala2

Expand All @@ -18,7 +18,7 @@ ThisBuild / organization := org
ThisBuild / version := "0.4.0-SNAPSHOT"
ThisBuild / scalaVersion := scala213
ThisBuild / crossScalaVersions := allScalaVersions
ThisBuild / scalacOptions ++= Seq("-unchecked", "-deprecation")
ThisBuild / scalacOptions ++= Seq("-unchecked", "-deprecation", "-Yno-decode-stacktraces")
ThisBuild / javacOptions ++= Seq("-source", "1.8", "-target", "1.8")

ThisBuild / publishTo := sonatypePublishTo.value
Expand All @@ -43,15 +43,15 @@ ThisBuild / outputStrategy := Some(StdoutOutput)

ThisBuild / Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-oDF")

val collectionCompatVersion: String = "2.11.0"
val collectionCompatVersion: String = "2.12.0"
val haloDBVersion: String = "0.5.6"
val rocksDBVersion: String = "9.0.0"
val catsEffectVersion: String = "3.5.4"
val fabricVersion: String = "1.14.2"
val fs2Version: String = "3.10.2"
val scribeVersion: String = "3.13.2"
val luceneVersion: String = "9.10.0"
val sqliteVersion: String = "3.45.2.0"
val sqliteVersion: String = "3.45.3.0"

val scalaTestVersion: String = "3.2.18"
val catsEffectTestingVersion: String = "1.5.0"
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/lightdb/Collection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ abstract class Collection[D <: Document[D]](val collectionName: String,
name = name,
createKey = createKey,
createV = createV,
store = db.createStoreInternal(s"$collectionName.indexed.$name"),
loadStore = () => db.createStoreInternal(s"$collectionName.indexed.$name"),
collection = this,
maxLinks = maxLinks
)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/lightdb/IndexedLink.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package lightdb

import fabric.rw.RW
import fabric.rw._

case class IndexedLink[D <: Document[D]](_id: Id[IndexedLink[D]],
links: List[Id[D]]) extends Document[IndexedLink[D]]
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/scala/lightdb/IndexedLinks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import cats.effect.IO
case class IndexedLinks[V, D <: Document[D]](name: String,
createKey: V => String,
createV: D => V,
store: Store,
loadStore: () => Store,
collection: Collection[D],
maxLinks: MaxLinks) {
lazy val store: Store = loadStore()

protected[lightdb] def add(doc: D): IO[Unit] = {
val v = createV(doc)
for {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/lightdb/KeyValue.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package lightdb

import fabric.Json
import fabric.rw.RW
import fabric.rw._

case class KeyValue(_id: Id[KeyValue], value: Json) extends Document[KeyValue]

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/lightdb/LightDB.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package lightdb

import cats.effect.IO
import cats.implicits.{catsSyntaxApplicativeByName, catsSyntaxParallelSequence1}
import fabric.rw.RW
import fabric.rw._
import lightdb.upgrade.DatabaseUpgrade

import java.nio.file.Path
Expand Down
10 changes: 5 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.1")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.13")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.10.0")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11")

addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.0")
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1")

addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")

0 comments on commit 543af79

Please sign in to comment.