Download the PHP package jrsaunders/shard-matrix without Composer

On this page you can find all versions of the php package jrsaunders/shard-matrix. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?
jrsaunders/shard-matrix
Rate from 1 - 5
Rated 5.00 based on 1 reviews

Informations about the package shard-matrix

Latest Stable Version Total Downloads Latest Unstable Version License

ShardMatrix for PHP

Database Sharding system for MYSQL and Postgres

Quick Usage

Once you have initiated it as outlined in the INSTALLATION section below - here are some quick examples of usage.

If you are familiar with the ORM in Laravel - this is just an extension of that.

Create Table

Insert Record

Inserted Data

Get Record By UUID and Update Record

Query Data and Conditionally Delete a Record

Pagination

Pagination of Data from all shards

Pagination of Data from one shard defined by the UUID location

Installation

Installing ShardMatrix for PHP

Use Composer to install ShardMatrix, or pull the repo from github.

Preparing the YAML config file

ShardMatrix needs to know how your tables and columns and databases interact, so this config file will define this in a simple yaml file.

Example

This is a full example of how a configuration file should look.

Anatomy of the Configuration File

Version

Define the version. The most recent version is 1.

Table Groups

Define the table groups. As you add tables to your Application you will need to explicitly add them here to.

The group name is only used in ShardMatrix.

The table names are attributed to the groups. A table can only be in one group at a time and once you have written to the Databases, it is best not to change any table assigned to a group.

This section as it may appear.

Unique Columns in Tables

Unique Columns can be defined here. So in the users table email and username must be unique across all Nodes (shard databases).

Nodes

This is where you define your database connections, credentials, and what table groups and geos the node maybe using.

Nodes can be extended and added to as you go.

Node names must remain the same though as must the table groups they correspond to.

The anatomy of the node section.

The Node Section as it may appear in the config yaml.

Once Yaml Config File is Complete

Save the file to where the application is, in either a protected directory or externally inaccessible directory.

Alternatively it can be made into a Kubernetes Secret and given to your application that way.

Initiate in PHP

In these examples we have saved our Config file as shard_matrix.yaml and placed it in the same directory as our applications index php.

Basic Setup Using Only PHP and Webserver Resources

Setup Using Only GoThreaded and Redis


All versions of shard-matrix with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4
symfony/yaml Version ^5.0
ramsey/uuid Version ^4.0
laravel/framework Version 7.13
doctrine/dbal Version ^2.10
predis/predis Version ^1.1
ext-zlib Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jrsaunders/shard-matrix contains the following files

Loading the files please wait ....