Giter Club home page Giter Club logo

php-foundationdb's Introduction

PHP-FoundationDB

Build Status

FoundationDB is a distributed database designed to handle large volumes of structured data across clusters of commodity servers. It organizes data as an ordered key-value store and employs ACID transactions for all operations. It is especially well-suited for read/write workloads but also has excellent performance for write-intensive workloads.

Open Database

$foundationClient = new \Foundation\Client();

$database = $foundationClient
    ->connection('/usr/local/etc/foundationdb/fdb.cluster')
    ->database('DB');

Insert

Grammar

bool set(string $key, string $value);

Example

$database->set('viest', json_encode([
    'name' => 'JiexinWang',
    'age' => 22
]));

Find

Grammar

string get(string $key);

Example

$user = $database->get('viest');

Delete

Grammar

bool clear(string $key);

Example

$database->clear('viest')

Range

Grammar

array range(int $startIndex, int $endIndex);

Example

$rangeArray = $database->range(0, 2);

php-foundationdb's People

Contributors

viest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

php-foundationdb's Issues

PECL support

Do you have plans to make it a PECL extension?

Api version and/or network error

This code intermittently works (only once in about 5 minutes). I am running Centos 7 and PHP 7.3

$foundationClient = new \Foundation\Client();
$database = $foundationClient
    ->connection('/etc/foundationdb/fdb.cluster')
    ->database('DB');
$database->set('test', 'testing123');
echo $database->get('test');

The error when it is not working is

Fatal error: Uncaught Foundation\Exception: API version may be set only once in /usr/local/lsws/domain.com/html/test.php:12 Stack trace: #0 /usr/local/lsws/domain.com/html/test.php(12): Foundation\Client->connection('/etc/foundation...') #1 {main} Next Foundation\Exception: Network can be configured only once in /usr/local/lsws/domain.com/html/test.php:12 Stack trace: #0 /usr/local/lsws/domain.com/html/test.php(12): Foundation\Client->connection('/etc/foundation...') #1 {main} thrown in /usr/local/lsws/domain.com/html/test.php on line 12

My fdbcli status is

fdb> status

Using cluster file `/etc/foundationdb/fdb.cluster'.

Configuration:
  Redundancy mode        - double
  Storage engine         - memory-2
  Coordinators           - 3

Cluster:
  FoundationDB processes - 3
  Zones                  - 3
  Machines               - 3
  Memory availability    - 0.6 GB per process on machine with least available
                           >>>>> (WARNING: 4.0 GB recommended) <<<<<
  Fault Tolerance        - 1 machine
  Server time            - 04/03/20 03:12:21

Data:
  Replication health     - Healthy
  Moving data            - 0.000 GB
  Sum of key-value sizes - 0 MB
  Disk space used        - 337 MB

Operating space:
  Storage server         - 1.0 GB free on most full server
  Log server             - 7.2 GB free on most full server

Workload:
  Read rate              - 18 Hz
  Write rate             - 0 Hz
  Transactions started   - 8 Hz
  Transactions committed - 0 Hz
  Conflict rate          - 0 Hz

Backup and DR:
  Running backups        - 0
  Running DRs            - 0

Client time: 04/03/20 03:12:21
fdb> 

My local IP is 10.148.0.7
My fdb.cluster is
rsVDreX2:[email protected]:4500,10.148.0.12:4500,10.148.0.13:4500

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.