# Could I partition existed collection?

**URL:** <https://forums.percona.com/t/could-i-partition-existed-collection/4820>\
**Category:** Percona Server for MongoDB\
**Created:** [April 1, 2016, 5:14am UTC](https://forums.percona.com/t/could-i-partition-existed-collection/4820 "2016-04-01T05:14:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alterpub](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@alterpub](https://forums.percona.com/u/alterpub)\
**Post date:** [April 1, 2016, 5:14am UTC](https://forums.percona.com/t/could-i-partition-existed-collection/4820/1 "2016-04-01T05:14:43Z")

</div>

Hi,  
I’ve collection with 15gb of data, could I partition it now?

I’m interested in 2 options:

1. I’ve timestamp field in collection, so could I partition current data?
2. Could I just add new partitions daily and remove old one(30 days rotation)?

---

<div class="post-metadata">

**Author:** ![radoslaw.szulgo](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/radoslaw.szulgo/32/17315_2.png) [@radoslaw.szulgo](https://forums.percona.com/u/radoslaw.szulgo)\
**Post date:** [September 10, 2025, 7:33pm UTC](https://forums.percona.com/t/could-i-partition-existed-collection/4820/3 "2025-09-10T19:33:12Z")

</div>

Yes, you can absolutely partition your 15GB collection using both of the methods you’ve described.

1. This approach in MongoDB is called **sharding**. Sharding horizontally scales your database by distributing a single collection’s data across multiple servers (called shards). You can definitely shard your existing 15GB collection. However, choosing the right **shard key** is critical.

2. This is an excellent **design pattern** for managing time-series data and is often a better fit than sharding for managing data lifecycle. It doesn’t use the built-in sharding feature but rather a logical separation at the application level. Your application logic should determine the current date and writes new documents to the corresponding daily collection (e.g., `my_collection_2025_09_10`). When querying for a specific time range, your application may need to query multiple collections. For example, to get data for the last 3 days, you would query `my_collection_2025_09_10`, `my_collection_2025_09_09`, and `my_collection_2025_09_08`. MongoDB’s aggregation framework with `$unionWith` can make this easier. To remove data older than 30 days, you don’t run a slow, resource-intensive `deleteMany()` command. Instead, you simply run a `db.collection.drop()` command on the old collection (e.g., `db.my_collection_2025_08_11.drop()`). Dropping a collection is an extremely fast, metadata-only operation
