Python with Cassandra resources
- DataStax’s Python Cassandra driver can be installed as an application dependency to make it easier to access and work with Cassandra in your Python applications.
- Async Python and Cassandra with Gevent explains how you monkeypatch gevent into a Python 2.7 application and work with Cassandra using gevent’s coroutines. Note that this post could have instead been written with asycnio if it were coded with Python 3.
- How to Install and Use Cassandra on Django instructs how to use Cassandra with Django 1.8 but it should still be relevant for newer Django versions as well.
- Using Cassandra with Python and uWSGI gives some short example code for connecting to a Cassandra cluster outside the HTTP request-response cycle to prevent timeouts and blocking issues with WSGI servers.
General Cassandra resources
Apache Cassandra can be used independently of Python applications for data storage and querying. The learning curve for getting started is similar to other NoSQL data stores but scaling, performance and monitoring can be challenging. The following resources focus on addressing those issues based on teams that have felt the pain and often released their resulting tools as open source projects.
- The official getting started documentation for Cassandra provides installation, configuration, and basic querying information.
- Monitoring Cassandra at Scale explains how the Yelp engineering team uses Cassandra to complement their MySQL and ElasticSearch instances. The post does a nice job of enumerating the warning signs to monitor and provides a short example of an issue with replication that could be caught by their approach.
- How Not To Use Cassandra Like An RDBMS (and what will happen if you do) gives examples in Cassandra’s query language CQL of operations that are typical with relational databases but go terribly wrong with Cassandra, due to its NoSQL architecture that is optimized for other types of operations.
- Backup and Recovery for Apache Cassandra and Scale-Out Databases covers issues encountered when trying to take snapshot backups of Cassandra due to partitions and consistency lag time that occur with just about every Cassandra setup.