@openland/foundationdb

@openland/foundationdb

  • Docs
  • Chat

›Layers

Getting Started

  • Getting Started
  • Installation
  • Hello world

Entity Layer

  • Overview

Layers

  • Singleton Worker
  • Migrations
  • PubSub
  • Random ID
  • Distributed Lock

Reference

  • Database
  • Transactions
  • Subspaces
  • Directory Layer

Random ID layer

Random ID allows you to generate globaly unique and time ordered random ids that can be fit in 8 byte integer. Uses Twitter's Snowflake: https://github.com/twitter-archive/snowflake

Dependencies

This layer does not have any depdendencies

Install

yarn install @openland/foundationdb-random

and then add layer in your initialization code:

import { Database } from '@openland/foundationdb';
import { RandomLayer } from '@openland/foundationdb-random';

let db = await Database.open({
    layers: [
        /* other layers */
        new RandomLayer()
    ]
})

Usage

let randomString: string = db.get(RandomLayer).nextRandomId();
← PubSubDistributed Lock →
  • Dependencies
  • Install
  • Usage
Docs
Getting Started
Community
Chat in Openland
Sources
GitHubStar
Copyright © 2021 Openland