Installation details
#ScyllaDB version: planning ScyllaDB Cloud (latest GA) — greenfield, not yet deployed
#Cluster size: planned 3 nodes (32 vCPU each), RF=3, single region
os: ScyllaDB Cloud (managed) — Django app runs on Ubuntu 22.04
Hi! We are building a real-time chat on Django — this is our first ScyllaDB workload.
Scale target: ~30M messages/day, ~200k concurrent WebSocket users, ~1M DAU.
What we are doing today:
- Using
scylla-driverdirectly (shard-aware fork, NOTcassandra-driver) - One module-level registry of ~25 CQL strings (all with
?placeholders), prepared once at startup TokenAwarePolicy(DCAwareRoundRobinPolicy)+ConsistencyLevel.LOCAL_QUORUM+dict_factory- Four small caller helpers:
one(name, params),rows(name, params),all_pages(name, params),run(name, params)— nobody writes inline CQL - Bulk writes from Kafka consumers: group rows by full partition key
(room_id, bucket=YYYYMM), oneUNLOGGED BatchStatementper partition, fired withexecute_concurrent(concurrency=128) - Schema is query-driven:
messagesclusteredmsg_id DESCinside(room_id, bucket); two-table inbox =user_inboxUPDATE-in-place + skinnyuser_inbox_indexorder index
What we deliberately did NOT use:
django-cassandra-engine/django-scylla— dynamic ORM CQL seems to defeat prepared statements + token-aware routingcassandra.cqlengineObject Mapper — older versions miss shard-aware routing
My questions:
- Is this raw
scylla-driver+ prepared-statement registry the canonical pattern at chat scale, or is there a community-favored thin abstraction (typed wrappers / lightweight model layer) we should consider? - Anything Django-specific we should add or avoid (connection lifecycle across WSGI/ASGI workers, settings handling, migration tooling)? Django ORM still owns our Postgres tables (users, wallet); Scylla is for chat only.
- For bulk writes — is
concurrency=128reasonable for a 3-node, 32-shard-per-node cluster, or should we tune by per-shard throughput?
Thanks for any guidance — want to make sure we’re not missing a pattern that production Scylla shops standardly use.