PHPackages                             konstantin-kuklin/handlersocket-library - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. konstantin-kuklin/handlersocket-library

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

konstantin-kuklin/handlersocket-library
=======================================

HandlerSocket protocol wrapper on native PHP

0.1.0(11y ago)451826[9 issues](https://github.com/KonstantinKuklin/HandlerSocketLibrary/issues)[1 PRs](https://github.com/KonstantinKuklin/HandlerSocketLibrary/pulls)1MITPHP

Since Jul 29Pushed 7y ago8 watchersCompare

[ Source](https://github.com/KonstantinKuklin/HandlerSocketLibrary)[ Packagist](https://packagist.org/packages/konstantin-kuklin/handlersocket-library)[ Docs](https://github.com/KonstantinKuklin/HandlerSocketLibrary)[ RSS](/packages/konstantin-kuklin-handlersocket-library/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (9)Used By (1)

[![Build Status](https://camo.githubusercontent.com/bdd7e4e3eff1520e9da146098c69eb16955f55791a3e2605ba464d687a61d729/68747470733a2f2f7472617669732d63692e6f72672f4b6f6e7374616e74696e4b756b6c696e2f48616e646c6572536f636b65744c6962726172792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/KonstantinKuklin/HandlerSocketLibrary)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/68d9f21a404be2112bd0d41a6a707b52c63d27d00ebf517a0404987961a9cc78/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4b6f6e7374616e74696e4b756b6c696e2f48616e646c6572536f636b65744c6962726172792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/KonstantinKuklin/HandlerSocketLibrary/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/000e1dd0711dc9164fc778fac92c95e513fa768d5b799bd322e62223920d02de/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4b6f6e7374616e74696e4b756b6c696e2f48616e646c6572536f636b65744c6962726172792f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/KonstantinKuklin/HandlerSocketLibrary/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/e36d44d1d4948d5e83be9c90e622c75d59c3581d99ba27dc8a683d09f024b309/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6e7374616e74696e2d6b756b6c696e2f68616e646c6572736f636b65742d6c6962726172792f762f737461626c652e706e67)](https://packagist.org/packages/konstantin-kuklin/handlersocket-library)[![Total Downloads](https://camo.githubusercontent.com/8981b6bcfe8212153e39272c3f0ecd757799251ff883be960010fa4bfbf5cc04/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6e7374616e74696e2d6b756b6c696e2f68616e646c6572736f636b65742d6c6962726172792f646f776e6c6f6164732e706e67)](https://packagist.org/packages/konstantin-kuklin/handlersocket-library)

[Rus docs](README.rus.md)

Introduction
------------

[](#introduction)

HandlerSocket plugin for MySQL has been presented in 2010.

Plugin greatly speeds up the data stored in MySQL, and allowed to use this database as a NoSQL storage without the overhead associated with using SQL.

This library is an implementation of the protocol HandlerSocket completely written in PHP.

As a result, using HandlerSocket can provide much better performance for certain applications that using normal SQL application protocols.

Motivation
----------

[](#motivation)

In the yard in 2014, and is still the tool and manuals on the use HandlerSocket similar to the experimental or under development.

I had not liked a ready-made solution, so I decided to write my bike and ride it.

Why you should use HandlerSocket:

- data consistency;
- high performance;
- сompact protocol;
- сompatible with MySQL replication;
- comes out of the box in PerconaServer, MariaDB.

The table below shows a comparison of the performance of different programs allow you to save or to load data.

approx qpsUser CPU utilSystem CPU utilMySQL via SQL105,00060%28%Memcached420,008%88%MySQL via HandlerSocket750,00045%53%How to install
--------------

[](#how-to-install)

How to install HandlerSocket can be found on the internet or just download PerconaServer or MariaDB.

Start using HandlerSocketLibrary is very simple.

Add to composer.json:

`konstantin-kuklin/handlersocket-library": "dev-master" `

How to connect
--------------

[](#how-to-connect)

Open connection to the read only socket and to authorize the password 'passwordRead'.

```
$reader = new \HS\Reader('localhost', 9998, 'passwordRead');
```

Open connection to the write socket, no password is specified.

```
$writer = new \HS\Writer('localhost', 9999);
```

Queries
-------

[](#queries)

- [Open Index](docs/eng/OpenIndex.md)
- [Select](docs/eng/Select.md)
- [Insert](docs/eng/Insert.md)
- [Update](docs/eng/Update.md)
- [Delete](docs/eng/Delete.md)
- [Increment](docs/eng/Increment.md)
- [Decrement](docs/eng/Decrement.md)

Benchmarks
----------

[](#benchmarks)

Comparison with the basic libraries for PHP.

The list will participate HSPHP, written in PHP, HandlerSocket, written in C.

HSPHP (PHP) HandlerSocket (c-extension) HandlerSocketLibrary (PHP)

How to help
-----------

[](#how-to-help)

I would be glad to see your suggestions, feedback and reports of bugs found.

If the program is interesting, it'll expand its functionality.

License
-------

[](#license)

This library is available under the [MIT license](docs/LICENSE).

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~49 days

Recently: every ~65 days

Total

7

Last Release

4062d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/14bf2bc19526615387e37a0e04bb5110ec344663a6bc8e95c3b9947cd5b9808c?d=identicon)[KonstantinKuklin](/maintainers/KonstantinKuklin)

---

Top Contributors

[![KonstantinKuklin](https://avatars.githubusercontent.com/u/573586?v=4)](https://github.com/KonstantinKuklin "KonstantinKuklin (60 commits)")[![randigrace](https://avatars.githubusercontent.com/u/8811585?v=4)](https://github.com/randigrace "randigrace (4 commits)")[![oucil](https://avatars.githubusercontent.com/u/3843802?v=4)](https://github.com/oucil "oucil (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

phplibraryhandler socketHandlerSocket

### Embed Badge

![Health badge](/badges/konstantin-kuklin-handlersocket-library/health.svg)

```
[![Health](https://phpackages.com/badges/konstantin-kuklin-handlersocket-library/health.svg)](https://phpackages.com/packages/konstantin-kuklin-handlersocket-library)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
