[id='server-hinting_{context}']
= Server hinting

Server hinting increases availability of data in distributed caches by replicating entries across as many servers, racks, and data centers as possible.

NOTE: Server hinting applies only to distributed caches.

When {brandname} distributes the copies of your data, it follows the order of precedence: site, rack, machine, and node.
All of the configuration attributes are optional.
For example, when you specify only the rack IDs, then {brandname} distributes the copies across different racks and nodes.

Server hinting can impact cluster rebalancing operations by moving more segments than necessary if the number of segments for the cache is too low.

TIP: An alternative for clusters in multiple data centers is cross-site replication.

[discrete]
== Server hinting configuration

.XML
[source,xml,options="nowrap",subs=attributes+,role="primary"]
----
include::xml/server_hinting.xml[]
----

.JSON
[source,json,options="nowrap",subs=attributes+,role="secondary"]
----
include::json/server_hinting.json[]
----

.YAML
[source,yaml,options="nowrap",subs=attributes+,role="secondary"]
----
include::yaml/server_hinting.yaml[]
----

.GlobalConfigurationBuilder
[source,java,options="nowrap",subs=attributes+,role="secondary"]
----
include::code_examples/ServerHinting.java[]
----

[role="_additional-resources"]
.Additional resources
* link:{javadocroot}/org/infinispan/configuration/global/TransportConfigurationBuilder.html[org.infinispan.configuration.global.TransportConfigurationBuilder]
