Company
Date Published
Author
Steve Yen, Co-Founder, Couchbase
Word count
527
Language
English
Hacker News points
None

Summary

The author has discovered an efficient way to combine their tasks into a single project involving Membase and nodejs, aiming to enhance their knowledge of nodejs while providing insights into Membase. The project involves building a Membase cluster exerciser using nodejs and sharing the process through blogging. Membase supports ASCII and binary protocols, with TAP streams available only in the binary format, necessitating that nodejs handle raw binary TCP communication, which it can achieve through binary buffer encodings. However, nodejs lacks built-in functions like ntohl and htonl for binary protocol manipulations, prompting the author to contribute a nodejs implementation of these functions. The code provided offers functions for converting data between host and network byte orders and is intended for arrays, nodejs buffers, or strings. The author plans to continue by demonstrating how to establish a connection to Membase and handle binary protocol messages in nodejs.