Native Erlang client for CQL3 over Cassandra's binary protocol v2 (a.k.a. what you want as a client for Cassandra).
Usage · Connecting · Performing queries · Query options · Batched queries · Reusable queries · Data types
Installation · Compatibility · Tests · License
This project is still relatively new, so you are welcome to contribute to it with improvements, suggestions and any issues you encounter.
CQErl offers a simple Erlang interface to Cassandra using the latest CQL version (v3). The main features include:
- Automatic (and configurable) connection pools using pooler
- Batched queries
- Variable bindings in CQL queries (named or not)
- Automatic query reuse when including variable bindings
- Collection types support
- Tunable consistency level
- Synchronous or asynchronous queries
- Automatic compression (using lz4 or snappy if available)
- SSL support
- Pluggable authentication (as long as it's SASL-based)
CQErl was designed to be as simple as possible on your side. You just provide the configuration you want as environment variables, and ask for a new client everytime you need to perform a transient piece of work (e.g. handle a web request). You do not need to (and should not) keep a client in state for a long time. Under the hood, CQErl maintains a pool of persistent connections with Cassandra and this pattern is the best way to ensure proper load balancing of requests across the pool.