All Projects → Crowdstar → vertica-swoole-adapter

Crowdstar / vertica-swoole-adapter

Licence: Apache-2.0 license
Provides a DB layer for Swoole-based applications to communicate to HP Vertica databases.

Programming Languages

PHP
23972 projects - #3 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to vertica-swoole-adapter

swoole-postgresql-doctrine-driver
🔌 A Doctrine DBAL Driver implementation on top of Swoole Coroutine PostgreSQL client
Stars: ✭ 15 (+7.14%)
Mutual labels:  swoole, connection-pool
Smproxy
Swoole MySQL Proxy 一个基于 MySQL 协议,Swoole 开发的MySQL数据库连接池。 A MySQL database connection pool based on MySQL protocol and Swoole.
Stars: ✭ 1,665 (+11792.86%)
Mutual labels:  swoole, connection-pool
Connection Pool
A common connection pool based on Swoole is usually used as a database connection pool.
Stars: ✭ 164 (+1071.43%)
Mutual labels:  swoole, connection-pool
swoole
Swoole Api references
Stars: ✭ 14 (+0%)
Mutual labels:  swoole
awesome-swoole
💎 A curated list of awesome things related to Swoole.
Stars: ✭ 129 (+821.43%)
Mutual labels:  swoole
framework
🦋The PHP Framework For Code Poem As Free As Wind.
Stars: ✭ 65 (+364.29%)
Mutual labels:  swoole
conn
netpoll事件驱动,goroutine协程池化,降低无效协程的资源占用,适用于高连接数(对于低频数据传输的场景,可以大幅降低协程数,提升资源利用率)
Stars: ✭ 28 (+100%)
Mutual labels:  connection-pool
http
Support Swoole Implement PSR7
Stars: ✭ 28 (+100%)
Mutual labels:  swoole
pool
Go library that wraps http.Client to provide seamless higher-level connection pooling features
Stars: ✭ 39 (+178.57%)
Mutual labels:  connection-pool
app
Buggregator is a beautiful, lightweight debug server build on Laravel that helps you catch your smpt, sentry, var-dump, monolog, ray outputs. It runs without installation on multiple platforms.
Stars: ✭ 259 (+1750%)
Mutual labels:  swoole
gotask
⚡️ A lightning speed replacement for Swoole TaskWorker in Go
Stars: ✭ 164 (+1071.43%)
Mutual labels:  swoole
static-php-cli
Build single static PHP binary in linux, build with PHP project together, with Swoole and other popular extensions included.
Stars: ✭ 129 (+821.43%)
Mutual labels:  swoole
Polyel-Framework
⚡️ Voltis Core: A PHP framework based on Swoole from the ground up
Stars: ✭ 22 (+57.14%)
Mutual labels:  connection-pool
docs
Lawoole documentation
Stars: ✭ 12 (-14.29%)
Mutual labels:  swoole
homebrew-extensions
🍻 Homebrew tap for PHP extensions
Stars: ✭ 264 (+1785.71%)
Mutual labels:  swoole
PyMySQLPool
PyMySQL-based database connection pool.
Stars: ✭ 52 (+271.43%)
Mutual labels:  connection-pool
skeleton
基于Swoole的轻量、高效、全异步开源框架。
Stars: ✭ 71 (+407.14%)
Mutual labels:  swoole
swoole-laravel-chat
Simple stateless chat board [Swoole + SocketIO + Laravel]
Stars: ✭ 16 (+14.29%)
Mutual labels:  swoole
MineAdmin
🎉🌈🔥MineAdmin是基于Hyperf框架 和 Vue3+Vite3 开发的前后端分离权限管理系统,自适应多终端。特色:crud生成 + json配置化开发一把梭
Stars: ✭ 142 (+914.29%)
Mutual labels:  swoole
RidPT
A Private Tracker System
Stars: ✭ 102 (+628.57%)
Mutual labels:  swoole

Tests Latest Stable Version Latest Unstable Version License

Summary

This library provides a DB layer to communicate to HP Vertica databases for Swoole based applications.

Features supported:

  • Connection pool.
  • Auto-reconnect.
  • Retry with exponential backoff (for failed operations).
  • Logging support.

Vertica connections are made through package skatrych/vertica-php-adapter, which is implemented using ODBC. It is not coroutine-friendly, and works in blocking mode only.

This package was derived from our work at Glu Mobile. It has been used in one of our internal microservices talking to Vertica 7.2.0 and 9.3.0 servers, and ran smoothly for months.

Installation

composer require crowdstar/vertica-swoole-adapter

Sample Usage

Following example creates a Vertica connection pool, gets a connection from the pool, makes a database query, then puts the connection back to the pool:

<?php
use CrowdStar\VerticaSwooleAdapter\VerticaAdapter;
use CrowdStar\VerticaSwooleAdapter\VerticaProxy;
use Swoole\ConnectionPool;

$pool = new ConnectionPool(
    function () {
        return new VerticaAdapter($config);
    },
    ConnectionPool::DEFAULT_SIZE,
    VerticaProxy::class
);
/** @var VerticaAdapter $conn */
$conn = $pool->get();
$data = $conn->fetchAll($conn->query($sql)) ?: [];
$pool->put($conn);
?>

For more examples, please check source code under folder examples/. To run the examples, you will need to run following two commands first to install Composer packages and start Docker containers:

docker run --rm -v $(pwd):/var/www -ti phpswoole/swoole:latest-dev composer update -n
docker-compose up --build -d # or "docker-compose up -d" if you don't need to rebuild the image.

Once done, you can run the example(s) using following command(s):

docker exec -ti $(docker ps -qf "name=app") ./examples/example.php
docker exec -ti $(docker ps -qf "name=app") ./examples/benchmark.php
docker exec -ti $(docker ps -qf "name=app") ./examples/test-coroutine-capability.php
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].