3

Environment: Jruby, Rails 2.3.8, cassandra-gem, cassandra 1.1

We are creating a new keyspace per tenant in our cassandra backed multi-tenant application. While testing we found Cassandra fail

at 400 keyspaces on a 8GB RAM machine, 7200 RPM disk
at 700 keyspaces on a 24 GB RAM machine, 7200 RPM disk

Also found it run painfully slow after 100 or so keyspaces. It took ~7 hours to create 700 keyspaces and consumed ~35GB of disk space with no data entered into it.

We then switched our testing to validate the maximum number of column families in a keyspace, hoping to use <tenant id>_<columnfamily name> named CFs. This test also failed at ~3000 CFs.

Now we are looking at <tenant_id>_<key> for row keys and use the same CFs for all tenants. This is based on the notes at https://github.com/rantav/hector/wiki/Virtual-Keyspaces.

The question is, would prepending tenant_id to key work for the following CF, given the key validation class is LongType?.

ColumnFamily: monthly_unique_user_counts
"count of unique users per month"
  Key Validation Class: org.apache.cassandra.db.marshal.LongType
  Default column value validator: org.apache.cassandra.db.marshal.LongType
  Columns sorted by: org.apache.cassandra.db.marshal.LongType
  Row cache size / save period in seconds / keys to save : 0.0/0/all
  Row Cache Provider: org.apache.cassandra.cache.ConcurrentLinkedHashCacheProvider
  Key cache size / save period in seconds: 200000.0/14400

For a few other CFs, the Key Validation Class is

Key Validation Class: org.apache.cassandra.db.marshal.TimeUUIDType

Would the <tenant_id>_<key> concept work in that CF?.

so_mv
  • 3,939
  • 5
  • 29
  • 40

0 Answers0