Download the PHP package tarantool/mapper without Composer

On this page you can find all versions of the php package tarantool/mapper. 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?

Informations about the package mapper

Tarantool Mapper

License Testing Latest Version Total Downloads Telegram

Requirements

You need latest php major version (8.0 or 8.1), and tarantool latest major branch (2.6, 2.8, 2.10).

Installation

The recommended way to install the library is through Composer:

Create mapper

Usually, you manage dependencies in your service provider. To get started you should instantiate client instance and pass it to mapper constructor. In this example we use PurePacker and StreamConnection. It means you don't need any pecl extensions. To see other implementations please check client documentation

Existing types

You can start with your current configuration. Please, note - all instances are mapped to key-value objects.

Describe entities

To get started you should describe your types and fields using meta object.

Use migrations

Use fluent api

Working with the data

Now you can store and retreive data from tarantool storage using mapper instance.

Indexes

Array properties

You can store arrays as property without any serialization to string.

Sequence plugin

If you want you can use sequence plugin that generates next value based on sequence space. Or you can implement id generator using any other source, for example with raft protocol.

User-defined classes plugin

If you want you can specify classes to use for repository and entity instances. Entity and repository class implementation are ommited, but you should just extend base classes.

Annotation plugin

You can describe your entities using dobclock. Mapper will create space, format and indexes for you.

If you want to index fields, extend repository and define indexes property

Register plugin and all your classes:

Performance

Mapper overhead depends on amount of rows and operation type. Table contains overhead in milliseconds per entity. In some cases, overhead can't be calculated due float precision.

Operation Counter Client time Mapper time Total time Client RPS Mapper RPS Total RPS
create one 1 0.000 0.001 0.001 1,555.174 1,555.174
single read 1 0.000 0.001 0.001 1,634.569 1,634.569
mass read 1 0.000 0.000 0.000 8,774.695 8,774.695
create one 10 0.000 0.002 0.002 4,514.859 4,514.859
single read 10 0.000 0.002 0.002 6,177.178 6,177.178
mass read 10 0.000 0.000 0.000 75,166.738 75,166.738
create one 100 0.000 0.015 0.015 6,467.801 6,467.801
single read 100 0.000 0.012 0.012 8,208.192 8,208.192
mass read 100 0.000 0.000 0.000 314,415.592 314,415.592
create one 1000 0.000 0.141 0.141 7,078.098 7,078.098
single read 1000 0.001 0.116 0.117 1,000,000.000 8,650.659 8,576.467
mass read 1000 0.001 0.001 0.002 1,000,000.000 709,252.555 414,948.951
create one 10000 0.023 1.349 1.372 434,782.609 7,414.542 7,290.218
single read 10000 0.005 1.000 1.005 2,000,000.000 10,003.891 9,954.101
mass read 10000 0.007 0.014 0.021 1,428,571.429 727,699.315 482,114.991

Perfomance test was made on (intel i5-4670K), Ubuntu 23.10 using PHP 8.3.1 For example, when single select will produce 10 000 entites, you will get about 12s overhead.


All versions of mapper with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
tarantool/client Version >=0.10.0
psr/cache Version ^2.0
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 tarantool/mapper contains the following files

Loading the files please wait ....