Skip to content
/ rushdb Public

RushDB is an instant database for modern apps and DS/ML ops built on top of Neo4j

License

Notifications You must be signed in to change notification settings

rush-db/rushdb

Repository files navigation

RushDB Logo

RushDB

The Instant Database for Modern Apps and DS/ML Ops

RushDB is an open-source database built on Neo4j, designed to simplify application development.

It automates data normalization, manages relationships, and infers data types, enabling developers to focus on building features rather than wrestling with data.

🌐 Homepage📢 Blog☁️ Platform 📖 Docs🧑‍💻 Examples

🚀 Feature Highlights

1. Data modeling is optional

Push data of any shape—RushDB handles relationships, data types, and more automatically.

2. Automatic type inference

Minimizes overhead while optimizing performance for high-speed searches.

3. Powerful search API

Query data with accuracy using the graph-powered search API.

4. Flexible data import

Easily import data in JSON, CSV, or JSONB, creating data-rich applications fast.

5. Developer-Centric Design

RushDB prioritizes DX with an intuitive and consistent API.

6. REST API Readiness

A REST API with SDK-like DX for every operation: manage relationships, create, delete, and search effortlessly. Same DTO everywhere.


Setup

Option 1: Managed Environment

The easiest way to start using RushDB is through RushDB Cloud. Free Tier is available.

Get up and running in less than 30 seconds by signing up at app.rushdb.com. RushDB Cloud provides a fully managed environment, so you can focus on building your application without worrying about setup or infrastructure.

Option 2: Self-Hosted Environment

If you prefer to manage your own infrastructure, you can set up RushDB with a Neo4j instance. Here’s how:

  1. Use Neo4j Aura (Free Tier Available)
    Quickly create a Neo4j instance using Neo4j Aura. It’s a managed service that allows you to get started with no configuration hassle.

  2. Deploy Your Own Instance
    Alternatively, you can host your own Neo4j instance. Follow this detailed guide to deploy Neo4j on AWS EC2, including steps for installing the APOC plugin.

Both options allow you to connect RushDB to your Neo4j database for a fully customizable self-hosted environment.

Requirements

  • Minimum Neo4j Version: 5.25.1
  • Required Plugin: apoc-core (installed and enabled)

Make sure your setup meets these requirements for optimal functionality.


Running the RushDB Platform

You can quickly launch the RushDB Platform using the following Docker command:

docker run -p 3000:3000 \
--name rushdb \
-e NEO4J_URL='neo4j+s://1234567.databases.neo4j.io' \
-e NEO4J_USERNAME='neo4j' \
-e NEO4J_PASSWORD='password' \
rushdb/platform

Or by using Docker Compose:

version: '3.8'
services:
  rushdb:
    image: rushdb/platform
    container_name: rushdb
    ports:
      - "3000:3000"
    environment:
      - NEO4J_URL=neo4j+s://1234567.databases.neo4j.io
      - NEO4J_USERNAME=neo4j
      - NEO4J_PASSWORD=password

Environment Variables

Before running the container, ensure you provide the following required environment variables:

  • NEO4J_URL: The connection string for your Neo4j database (e.g., neo4j+s://<your-instance-id>.databases.neo4j.io).
  • NEO4J_USERNAME: The username for accessing the Neo4j database (default is neo4j).
  • NEO4J_PASSWORD: The password for your Neo4j database instance.

Additional Environment Variables

1. RUSHDB_PORT

  • Description: The port on which the application server will listen for incoming requests.
  • Default: 3000

2. RUSHDB_AES_256_ENCRYPTION_KEY

  • Description: The encryption key for securing API tokens using AES-256 encryption.
  • Requirement: Must be exactly 32 characters long to meet the 256-bit key length requirement.
  • Important: Change this to a secure value in production.
  • Default: 32SymbolStringForTokenEncryption

3. RUSHDB_LOGIN

  • Description: The login username for the RushDB admin account.
  • Important: Change this to a secure value in production.
  • Default: admin

4. RUSHDB_PASSWORD

  • Description: The password for the RushDB admin account.
  • Important: Change this to a secure value in production.
  • Default: password

CLI Commands

The RushDB CLI allows you to manage users in self-hosted installations. Below are the available commands:

Create a New User

Command:

rushdb create-user <login> <password>

Example:

rushdb create-user admin@example.com securepassword123

This command creates a new user with the specified login and password. It is only allowed in self-hosted setups.

Update User Password

Command:

rushdb update-password <login> <newPassword>

Example:

rushdb update-password admin@example.com newsecurepassword456

This command updates the password for an existing user identified by the provided login. Like create-user, this command is restricted to self-hosted environments.


Usage

  1. Obtain an API Token:

    • If you’re using RushDB Cloud, get your token from app.rushdb.com.
    • For a self-hosted RushDB instance, retrieve the token from the Dashboard running locally (localhost:3000).
  2. Build Anything:
    Easily push, search, and manage relationships within your data.

With TypeScript / JavaScript

Install the SDK

npm install @rushdb/javascript-sdk

Push any json data

import RushDB from '@rushdb/javascript-sdk';

// Setup SDK
const db = new RushDB("API_TOKEN", {
  // Default URL; only override if necessary.
  url: "https://api.rushdb.com",
});

// Push data: RushDB flattens it into Records and establishes relationships automatically.
await db.records.createMany("COMPANY", {
  name: 'Google LLC',
  address: '1600 Amphitheatre Parkway, Mountain View, CA 94043, USA',
  foundedAt: '1998-09-04T00:00:00.000Z',
  rating: 4.9,
  DEPARTMENT: [{
    name: 'Research & Development',
    description: 'Innovating and creating advanced technologies for AI, cloud computing, and consumer devices.',
    PROJECT: [{
      name: 'Bard AI',
      description: 'A state-of-the-art generative AI model for natural language understanding and creation.',
      active: true,
      budget: 1200000000,
      EMPLOYEE: [{
        name: 'Jeff Dean',
        position: 'Head of AI Research',
        email: 'jeff@google.com',
        dob: '1968-07-16T00:00:00.000Z',
        salary: 3000000,
      }]
    }]
  }]
});

Find Records by specific criteria

// Find Records by specific criteria
const matchedEmployees = await db.records.find({
  labels: ['EMPLOYEE'],
  where: {
    position: { $contains: 'AI' },
    PROJECT: {
      DEPARTMENT: {
        COMPANY: {
          rating: { $gte: 4 },
        },
      },
    },
  },
});

const company = await db.records.findUniq('COMPANY', {
  where: {
    name: 'Google LLC',
  },
});

With REST API and cURL

Specify API base URL

  • RushDB Cloud: https://api.rushdb.com
  • Self-Hosted: Your custom URL (e.g., http://localhost:3000)

Push any json data

curl -X POST https://api.rushdb.com/api/v1/records/import/json \
-H "Authorization: Bearer API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "label": "COMPANY",
  "payload": {
    "name": "Google LLC",
    "address": "1600 Amphitheatre Parkway, Mountain View, CA 94043, USA",
    "foundedAt": "1998-09-04T00:00:00.000Z",
    "rating": 4.9,
    "DEPARTMENT": [{
      "name": "Research & Development",
      "description": "Innovating and creating advanced technologies for AI, cloud computing, and consumer devices.",
      "PROJECT": [{
        "name": "Bard AI",
        "description": "A state-of-the-art generative AI model for natural language understanding and creation.",
        "active": true,
        "budget": 1200000000,
        "EMPLOYEE": [{
          "name": "Jeff Dean",
          "position": "Head of AI Research",
          "email": "jeff@google.com",
          "dob": "1968-07-16T00:00:00.000Z",
          "salary": 3000000
        }]
      }]
    }]
  }
}'

Find Records by specific criteria

curl -X POST https://api.rushdb.com/api/v1/records/search \
-H "Authorization: Bearer API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "labels": ["EMPLOYEE"],
  "where": {
    "position": { "$contains": "AI" },
    "PROJECT": {
      "DEPARTMENT": {
        "COMPANY": {
          "rating": { "$gte": 4 }
        }
      }
    }
  }
}'
You Rock 🚀

Check the Documentation and Examples to learn more 🤓