Coder Social home page Coder Social logo

laky-64 / jdb Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 2.0 124 KB

A very fast parallel database based on json text plain with encryptation

License: MIT License

PHP 97.13% Python 2.87%
jdb database json-text crypted php composer-package python3 memcached-server

jdb's Introduction

JDB(v. 3.3-stable)

JDB is very fast parallel database based on json text plain with encryptation

JDB 2.3-stable it's still available but deprecated

Library maked by Laky64

JDB Bechmark

PHP Python Mode Thread Mode
One Thread 15ms 37ms Sequential Single Thread
Two Thread 47ms 85ms Async Multi Thread
Four Thread 79ms 149ms Async Multi Thread
Eight Thread 143ms 133ms Async Multi Thread
Twelve Thread 207ms 402ms Async Multi Thread

JDB Structure

Below is how the JDB database is structured

JDB Core Structure
DATABASE PASSWORD
database1 password1
database2 password2
database3 password3
Database Structure
TABLE PRIMARY KEY PRIMARY KEY TYPE
table1 primary_key1 primary_key_type1
table2 primary_key2 primary_key_type2
table3 primary_key3 primary_key_type3
Table Structure
COLUMN1 COLUMN2 COLUMN3
ROW1 value1 value2 value3
ROW2 value1 value2 value3
ROW3 value1 value2 value3

JDB Core Threads

In the JDB core there are different types of threads each with different jobs, here it is:

  • Controller Unit Thread It divides the workload on the various Operation Threads according to the freest one
  • I/O Thread It performs backups to disk every 500ms from RAM Database
  • Operation Thread It performs computation or query operations, usually more than one of these threads are started

Getting Started

Now Available in Async Multi-Thread, supported Windows Environment and Python Client!

First create the database folder, then create in the database folder with the name of the table to which you want to attribute, in which you want to insert the fields

Installation with composer

With json file (Composer):

{
    ...
    "require": {
        "laky64/jdb": "*"
    }
}

With command line (Composer):

- composer require laky64/jdb

Warning!

Read this documentation carefully so as not to cause malfunctions with JDB

JDB CORE

Requirements:

  • PHP > 7.4
  • PHP OpenSSL
  • PHP Memcache
  • Memcached Server
  • AmpPHP

Type of Threads Available

  • Two Thread 1 I/O Thread, 1 Controller Unit and 2 Operation Thread (Very fast but not optimized for multiple connections)
  • Four Thread 1 I/O Thread, 1 Controller Unit and 4 Operation Thread (Fast and optimized for mid level of multiple connections)
  • Eight Thread 1 I/O Thread, 1 Controller Unit and 8 Operation Thread (Slow but optimized for high level of multiple connections)
  • Twelve Thread 1 I/O Thread, 1 Controller Unit and 12 Operation Thread (Very slow but optimized for very high level of multiple connections)

Make runner for local JDB Server

First you need to run a Memcached Server without stopping, then create a php file to run the JDB Core without stopping (Suggested one for server)

header('Content-Type: text/plain'); //For make readable JDBC Core results
ini_set('memory_limit', '2048M'); //For avoid a memory overload
use laky64\database\JDB_CORE;
include 'vendor/autoload.php';
new JDB_CORE(JDB_CORE::NUM_THREAD, 'database_folder', 'ip_memcached_server', 'port_memcached_server');

Available Clients

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

jdb's People

Contributors

laky-64 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tappo03

jdb's Issues

Save database problem

When I do multiple simultaneous saves, the save does not take place correctly, how can I solve it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.