# Multiple services or multiple files?

**URL:** <https://forum.serverless.com/t/multiple-services-or-multiple-files/6803>\
**Category:** Serverless Framework\
**Created:** [December 24, 2018, 1:28pm UTC](https://forum.serverless.com/t/multiple-services-or-multiple-files/6803 "2018-12-24T13:28:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hpatoio](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/hpatoio/32/2870_2.png) [@hpatoio](https://forum.serverless.com/u/hpatoio)\
**Post date:** [December 24, 2018, 1:28pm UTC](https://forum.serverless.com/t/multiple-services-or-multiple-files/6803/1 "2018-12-24T13:28:09Z")

</div>

In the doc I see :

> … as your application grows, you can break it out into multiple services.

and later this

```auto
users/
  serverless.yml # Contains 4 functions that do Users CRUD operations and the Users database

posts/
  serverless.yml # Contains 4 functions that do Posts CRUD operations and the Posts database

comments/
  serverless.yml # Contains 4 functions that do Comments CRUD operations and the Comments database

```

Why is this setup/organization better than this :

```auto
# services.yml
[..]
functions:
  orderFunction1
    handler: orders.orderFunction1
  orderFunction2:
    handler: orders.orderFunction12
  cartFunction1
    handler: carts.orderFunction1
  cartFunction2:
    handler: carts.orderFunction12

```

and then

- `orders.js` that contains `orderFunction1` and `orderFunction2`
- `carts.js` that contains `cartFunction1` and `cartFunction2`

–  
Simone

---

<div class="post-metadata">

**Author:** ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)\
**Post date:** [December 26, 2018, 3:08am UTC](https://forum.serverless.com/t/multiple-services-or-multiple-files/6803/2 "2018-12-26T03:08:04Z")

</div>

Each Serverless project is deployed as a single CloudFormation stack. CloudFormation has a limit of 200 resources in a stack. Once you hit that limit you need to split your project into multiple projects. If there’s even a slim chance your project is going to exceed the 200 resource limit it’s be better to plan for it now instead of being forced into a restructure after you’ve hit the limit.

PS: I know 200 sounds like a lot but depending on how you have your functions wired up you’re looking at 20-40 functions per project.
