#2859 A key-value database based on async/await IO written in pure fantom

go4 Fri 8 Oct

axdb2 is a high performance distributed key-value database. It was developed for learning how database works.

  • Distributed: Raft consensus protocol
  • Storage Engine: LSM-Tree / B+Tree
  • Asynchronous IO: async/await based

axdb2 depends to asyncServer.

The asyncServer is an async/await based asynchronous IO framework that making network development easier. the code like this:

class TestServer : Handler {

  override async Void onService(Socket socket) {
    buf := NioBuf.makeMem(1024)
    n := await socket.read(buf, 1)
    buf.flip()
    echo("=====server receive: $buf: "+buf.readAllStr)

    buf.clear
    buf.printLine("HelloWorld")
    buf.flip
    n2 := await socket.write(buf)
    echo("=====send: "+n2)
  }

  static Void main() {
    Server {
      port = 8080
      handler = TestServer#
    }.start
  }
}

The Http protocol is also supported.

asyncServer , axdb2

Have fun!

andy Fri 8 Oct

Very cool!

Years ago I wrote a (non-distributed) database to explore how we could use Clojure-style persistent data structures for zero-copy concurrent access:

https://github.com/afrankvt/bruno

Has always been one of my favorite Fantom projects (and still runs a production website so actually got to use it!)

go4 Sat 9 Oct

Thanks. The bruno looks very lightweight.

Login or Signup to reply.