DEV Community

Cover image for Datagoose, JSON Based Database for Best Performance.
5elenay
5elenay

Posted on • Edited on

3 2

Datagoose, JSON Based Database for Best Performance.

Datagoose

Datagoose is an easy to use JSON based database for python.

With Datagoose:

  • Best performance. Datagoose is a lightweight database.
  • Methods that makes your job easier.
  • Regex supports.
  • Safe to use.
  • Auto or manual save, for who wants better performance.
  • Easy to use database. Created for everyone.
  • Rich options. includes hash keys, database path, garbage leak option and more.
  • Auto backup
  • Events
  • Can be dumped, also can load a data from JSON file.
    • <Datagoose>.load()
    • <Datagoose>.dump()

Source Code

Click

Download

You can download with pip install -U datagoose (PyPi Page) or, you can use with source code.

Documentation

Performance

Test Result (Auto-Save Enabled):

  • 100 Data with insert many:

    Starting Insert...
    Inserting Finished in  0:00:00.007002
    
  • 1,000 Data with insert many:

    Starting Insert...
    Inserting Finished in  0:00:00.032004
    
  • 10,000 Data with insert many:

    Starting Insert...
    Inserting Finished in  0:00:00.278020
    
  • 100,000 Data with insert many:

    Starting Insert...
    Inserting Finished in  0:00:02.808687
    
  • 1,000,000 Data with insert many:

    Starting Insert...
    Inserting Finished in  0:00:31.908481
    

Random Example Code

from datagoose import Datagoose
import random

# Getting Database
# Will create a new JSON file if not exists.
db = Datagoose("example", {
    "AUTO_SAVE": True,
    "USE_REGEX": True,
    "PATH": "dg/databases"
})

# insert many function example.
db.insert_many(*(
    {
        "NAME": random.choice(["eric", "kyle", "ike"]),
        "LAST_NAME": random.choice(["cartman", "marsh"]),
        "AGE": random.randint(9, 12),
        "POINT": random.randint(1, 10_000),
        "UID": i 
    } for i in range(10_000)
))

# find and sort function example (you can use regex.)
for res in db.find_and_sort({ "NAME": r"eric|kyle", "LAST_NAME": r"cartman", "AGE": 10 }, "POINT"):
    print(res)
Enter fullscreen mode Exit fullscreen mode

Postgres on Neon - Get the Free Plan

No credit card required. The database you love, on a serverless platform designed to help you build faster.

Get Postgres on Neon

Top comments (0)

Billboard image

Try REST API Generation for Snowflake

DevOps for Private APIs. Automate the building, securing, and documenting of internal/private REST APIs with built-in enterprise security on bare-metal, VMs, or containers.

  • Auto-generated live APIs mapped from Snowflake database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay