Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tarantool-C powered PHP connector #138

Open
bigbes opened this issue Sep 12, 2018 · 8 comments
Open

Tarantool-C powered PHP connector #138

bigbes opened this issue Sep 12, 2018 · 8 comments
Assignees
Labels
feature A new functionality php7 refactoring Code refactoring
Milestone

Comments

@bigbes
Copy link
Contributor

bigbes commented Sep 12, 2018

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 bigbes added feature A new functionality php7 labels Sep 12, 2018
@bigbes bigbes self-assigned this Sep 12, 2018
@jobs-git
Copy link

jobs-git commented Dec 28, 2018

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.

@bigbes
Copy link
Contributor Author

bigbes commented Dec 28, 2018

@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?

@jobs-git
Copy link

jobs-git commented Feb 10, 2019

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.

@titch-ane
Copy link

titch-ane commented Aug 1, 2019

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?

@rybakit
Copy link
Collaborator

rybakit commented Aug 1, 2019

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.

@Totktonada Totktonada added the refactoring Code refactoring label Mar 23, 2020
@Totktonada Totktonada added this to the wishlist milestone Mar 23, 2020
@titch-ane
Copy link

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?

@jobs-git
Copy link

jobs-git commented Jun 7, 2020

@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.

@rybakit
Copy link
Collaborator

rybakit commented Jun 7, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality php7 refactoring Code refactoring
Projects
None yet
Development

No branches or pull requests

5 participants