# Large number of tables

**URL:** <https://community.cratedb.com/t/large-number-of-tables/1475>\
**Category:** CrateDB\
**Created:** [May 9, 2023, 6:28pm UTC](https://community.cratedb.com/t/large-number-of-tables/1475 "2023-05-09T18:28:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vincepell](https://avatars.discourse-cdn.com/v4/letter/v/a6a055/32.png) [@vincepell](https://community.cratedb.com/u/vincepell)\
**Post date:** [May 9, 2023, 6:28pm UTC](https://community.cratedb.com/t/large-number-of-tables/1475/1 "2023-05-09T18:28:21Z")

</div>

I have a use case where the customer requires data to be stored in separate tables. Each table is dynamically created and eventually deleted after a week or so. As a result, there are typically ~20000 tables in the system at any given time. I know that this is not good database design, but, for various reasons, it cannot be changed. My question is: If CrateDB is clustered and the data is not sharded or partitioned, will it spread the tables tables across the cluster rather than putting all the tables on the a single node. Each table is not that big ~100000 rows

---

<div class="post-metadata">

**Author:** ![hernanc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/hernanc/32/676_2.png) [@hernanc](https://community.cratedb.com/u/hernanc)\
**Post date:** [May 10, 2023, 7:16am UTC](https://community.cratedb.com/t/large-number-of-tables/1475/2 "2023-05-10T07:16:53Z")

</div>

Hi,  
Different tables will be on different shards, so CrateDB will spread the tables across the cluster,  
but please review [Sharding and partitioning guide for time-series data - Tutorials - CrateDB Community](https://community.cratedb.com/t/sharding-and-partitioning-guide-for-time-series-data/737)  
In particular we recommend a maximum of 1000 shards per node so for 20 thousand tables you would be looking at 20 nodes minimum.  
2 other approaches you may want to consider are:

- if the tables can be grouped in some way you may want to have multiple CrateDB clusters instead of a single one with so many tables
- perhaps you could combine data in less tables but present it as if it were on separate “tables” using views?
