tarantool-php icon indicating copy to clipboard operation
tarantool-php copied to clipboard

Tarantool-C powered PHP connector

Open bigbes opened this issue 6 years ago • 8 comments

Right now driver implementation consists of written in C parts of code (duplicates of tarantool-c driver) and uses tp.h that's not supported anymore.

The better way is to replace all this code with Tarantool-C (probably this path'll be hard, will need to rewrite part by part with workind driver on every step and tarantool-c/tp/raw php side by side)

bigbes avatar Sep 12 '18 00:09 bigbes

Hi, what is the status for this one? Right now, the php7-v2 connector seems to be a bit slow, took one second to select an empty table.

jobs-git avatar Dec 28 '18 01:12 jobs-git

@jobs-git seems like the problem is not in the connector, i've got 1ms for my requests. Are you sure that problem is in connector?

bigbes avatar Dec 28 '18 10:12 bigbes

My tarantool lua startup is the problem, fixed now. I am able to pull information from tarantool db. However, I still get a low request per second. Its just 900 req/s while those implemented in https://gist.github.com/danikin/a5ddc6fe0cedc6257853, I get around 2M req/s per core.

Here is the snippet of the code

$tnt = new Tarantool('127.0.0.101', 3301,'guest');
$val = $tnt->select('s_spacers',8);

I also tried to use connection pool but just the same. To compare, a mysql connection got me around 7k reqs/s.

jobs-git avatar Feb 10 '19 14:02 jobs-git

Could anybody explain me, is this extension able be used as base for Tarantool PDO? For example, many ORM have PDO as underlayer for connection to different DB. If there was an PDO extension for Tarantool, many projects would be able to use Tarantool almost immediately.

Is it good idea? May be another issue should be created, but I don't know which project I should use for it (tarantool/tarantool-php, tarantool-php/client, php/php-src or something else). Could anybody help me with this issue?

titch-ane avatar Aug 01 '19 08:08 titch-ane

is this extension able be used as base for Tarantool PDO?

Сonsidering that PDO is not a standalone Pecl extension but bundled with PHP sources, I don't think that there is any chance for that to happen. But even if it does, the earliest version it can be added in is PHP 8, which will be released no earlier than 2021, so this is probably not what you want.

For example, many ORM have PDO as underlayer for connection to different DB.

For example, Doctrine is one of the most popular ORMs allows to extend itself with new DB drivers without requiring them to be PDO-based. I think, right now, this is the most reasonable way to adapt projects to use Tarantool without rewriting everything.

rybakit avatar Aug 01 '19 19:08 rybakit

But even if it does, the earliest version it can be added in is PHP 8, which will be released no earlier than 2021, so this is probably not what you want.

The PDO-way is still desired. Is it possible to expect that the PDO driver will appear in PHP v8?

titch-ane avatar Jun 07 '20 16:06 titch-ane

@titch-ane unless somebody from php team adds it or maybe you add it to their source, else tarantool team has no full control on whichever is implemented in PDO.

Anyway, the tarantool team already provided a connector, you just download the source, compile it then add it to your php extensions.

jobs-git avatar Jun 07 '20 17:06 jobs-git

If there was an PDO extension for Tarantool, many projects would be able to use Tarantool almost immediately.

@titch-ane Do you have any specific projects in mind that you think would benefit from using PDO-based Tarantool driver? I think the only feasible option for them to use Tarantool is to implement a non-PDO adapter.

rybakit avatar Jun 07 '20 19:06 rybakit