Anydataset NoSQL standardize the access to non-relational databases/repositories and treat them as Key/Value. The implementation can work with:
- MongoDB
- Cloudflare KV
- S3
- DynamoDB
Anydataset is an agnostic data source abstraction layer in PHP. See more about Anydataset here.
- Access as Key/Value repositories different datasource
- Allow put and get data
- Simplified way to connect to the datasources
The connection string for databases is based on URL.
See below the current implemented drivers:
Datasource | Connection String |
---|---|
MongoDB | mongodb://username:password@hostname:port/database |
Cloudflare KV | kv://username:password@accountid/namespaceid |
S3 | s3://accesskey:secretkey@region/bucket?params |
AWS DynamoDB | dynamodb://accesskey:secretkey@hostname/tablename?params |
Check implementation examples on https://opensource.byjg.com/php/anydataset-nosql
Just type:
composer require "byjg/anydataset-nosql"
docker-compose up -d
export MONGODB_CONNECTION="mongodb://127.0.0.1/test"
export S3_CONNECTION="s3://aaa:12345678@us-east-1/mybucket?create=true&endpoint=http://127.0.0.1:4566"
export DYNAMODB_CONNECTION="dynamodb://accesskey:secretkey@us-east-1/tablename?endpoint=http://127.0.0.1:8000"
vendor/bin/phpunit
Set the environment variable:
- MONGODB_CONNECTION = "mongodb://127.0.0.1/test"
Set the environment variable:
- DYNAMODB_CONNECTION = "dynamodb://accesskey:secretkey@region/tablename"
Set the environment variable:
- S3_CONNECTION = "s3://accesskey:secretkey@region/bucketname"
Set the environment variable:
- CLOUDFLAREKV_CONNECTION = "kv://email:authkey@accountid/namespaceid"
flowchart TD
byjg/anydataset-nosql --> ext-curl
byjg/anydataset-nosql --> aws/aws-sdk-php
byjg/anydataset-nosql --> byjg/anydataset
byjg/anydataset-nosql --> byjg/anydataset-array
byjg/anydataset-nosql --> byjg/serializer
byjg/anydataset-nosql --> byjg/webrequest
byjg/anydataset-nosql --> ext-json