Menu

React, etc. Tech Stack

React, Flux, GraphQL, Hack, HHVM...? All of this and more!

Cockroach DB and PHP/Hack support

CockroachDB is a Scalable, Geo-Replicated, Transactional Datastore. Like the cockroach it is designed to be distributed and survive a proverbial nuclear war on the web. It could be a very viable technology for deploying global online services with minimal latency and overhead.

While the technology is impressive (read how CockroachDB accomplishes distributed atomic transactions), a technology needs to be sufficiently popular and accessible to gain widespread use. The application itself is written in Go, an increasingly popular systems programming language.

Web applications are the most wide spread uses of databases and there are multiple interesting practical options an uses cases at developers' disposal, such as Graph Databases as CMS storage engines.

For CockroachDB there are no hits on the PHP package search site Packagist at the time of writing. While this does not block the use it does block not developers using CockroachDB as an alternative storage driver for a Content Repository, for example, it does add initial work significantly.

If this work is not released as open source, it will be repeated time and time again. To provide access to data drivers PHP developers can use either wrappers written in PHP or separate C extensions. C extensions have higher performance, but also higher complexity of development and installation (Pickle aims to improve this).

Like many database products Cockroach exposes a robust RESTful API which is a first class citizen. By creating a wrapper for communications with this API has more performance overhead (HTTP vs. application specific protocols, etc.), but it will likely be a more complete and mature implementation right off the bat.

PHP deployments of search engines like Solr and ElasticSearch rely purely on HTTP wrappers and there are plenty of implementations available on Packagist. For document databases and key-value stores such as Redis and MongoDB are used.

For graph databases the situation is as follows:

I recommend the Cockroach DB and the PHP communities to work together and to look into building a REST wrapper and publishing it on Packagist. PHP is not sexy, but widely deployed and damn reliable.

Written by Jorgé on Friday September 4, 2015

Permalink - Tags: cockroachdb, php, hack, hhvm

« HHVM and H2O available via Brew - get started with Hack, HTTP/2 on OS X - Stateless components in React.js »