// Module included in the following assemblies:
//
// assembly-configuring.adoc

[id='con-address-plans-{context}']
= Address plans

Address plans specify the expected resource usage of a given address. The sum of the resource usage for all resource types determines the amount of infrastructure provisioned for an address space. A single router and broker pod has a maximum usage of one. If a new address requires additional resources and the resource consumption is within the address space plan limits, a new pod will be created automatically to handle the increased load.

Address plans are configured by the {ProductName} service operator and are selected when creating an address.

{ProductName} includes a default set of address plans that are sufficient for most use cases.

In the link:{BookUrlBase}{BaseProductVersion}{BookNameUrl}#con-address-space-plans-messaging[Address space plans] section, the address space plan references two address plans: `small-queue` and `small-anycast`. These address plans are stored as custom resources and are defined as follows:

[source,yaml,options="nowrap"]
----
include::../common/small-queue-plan.yaml[]
----

The following fields are required:

* `metadata.name`
* `requiredResources`
* `addressType`

A single router can support five instances of addresses and broker can support three instances of addresses with this plan. If the number of addresses with this plan increases to four, another broker is created. If it increases further to six, another router is created as well.

In the `standard` address space, address plans for the `queue` address type may contain a field
`partitions`, which allows a queue to be sharded accross multiple brokers for HA and improved performance. Specifying an amount of `broker` resource above 1 will automatically cause a queue to be partitioned. 

NOTE: A sharded queue no longer guarantees message ordering.

Although the example address space plan in link:{BookUrlBase}{BaseProductVersion}{BookNameUrl}#con-address-space-plans-messaging[Address space plans] allows two routers and two brokers to be deployed, it only allows two pods to be deployed in total. This means that the address space is restricted to three addresses with the `small-queue` plan.

The `small-anycast` plan does not consume any broker resources, and can provision two routers at the expense of not being able to create any brokers:

[source,yaml,options="nowrap"]
----
include::../common/small-anycast-plan.yaml[]
----

With this plan, up to 10 addresses can be created.

