rahul
rahul

Reputation: 6487

Cassandra: One big table or many small tables?

I have several tables each of the same schema. Each of the tables belong to a different API but all return the same structure. So, should I use one table for all APIs with API id as a key or should I create a separate table for each API?

Upvotes: 1

Views: 425

Answers (1)

xmas79
xmas79

Reputation: 5180

I'm not sure about your data model, but the usual approach with Cassandra is to have model query-driven, that is one table per query. In your case I'd stick with one table (how many APIs? A table has a memory overhead, you really can't go past a few... hundred).

That being said, having only the API id as a key would probably kill your cluster due to wide partitions. You should carefully model the table in order to satisfy one query, and if you have more query you should add more tables (or materialized views).

Upvotes: 2

Related Questions