Skip to content

Bin policy

The bin-policy configuration determines which bins are shipped to a destination datacenter (DC). The available options include shipping all bins, no bins, only changed bins, only specified bins, changed and specified bins, or changed or specified bins. Each option has specific use cases and impacts on overhead.

Values

Configuration ValueExplanation
all (default)This is the default mode. The entire record is always shipped to the destination.
no-bins[Introduced in Database 6.0]. Only allowed for connector type DCs. Bins are not shipped, only the record’s metadata.
only-changedOnly the changed bins in a write are shipped. Bins that did not change are not shipped.
only-specifiedRemoved as of Database 5.3. Only the bins specified using the ship-bin configuration are shipped, regardless of which bins were changed as part of the write.
changed-and-specifiedSimilar to the && operator, the intersection of changed and specified bins. A bin is shipped if it was changed and also is specified using the ship-bin configuration. Bins that are changed but not specified using ship-bin are not shipped.
changed-or-specifiedSimilar to the || operator, the union of changed and specified bins. Both the changed bins in a write and the list of bins specified using the ship-bin configuration are shipped.

Overhead

If the XDR bin-policy is set to only-changed, changed-and-specified or changed-or-specified, there is extra overhead.

The overhead is:

  1. 6 bytes for each bin to maintain last update time (LUT), xdr-write flag (boolean value, 1 means request was by XDR client, 0 means by non-XDR client) and some spare bits.
  2. Deleted bins become bin tombstones. A bin tombstone requires the same resources as a regular bin with no data. These bin tombstones are cleaned up only on a subsequent write based on the xdr-bin-tombstone-ttl configuration.

Refer to the Capacity Planning Guide for further details.

Interactions

The bin-policy configuration interacts with other configurations like ignore-bins, write-policy and connector.

Some combinations of these are restricted:

  • If you choose a bin-policy that picks specified bins using ship-bin, ignore-bin is ignored.
  • If you choose a bin-policy that ships changed bins, you cannot set write-policy to replace.
  • If you choose the no-bins bin-policy, it is allowed only if connector is set to true.
Configuration Valueignore-bin honored?write-policy=replace allowed?connector
all (default)yesyesany
no-binsN/Anotrue
only-changedyesnoany
changed-and-specifiednonoany
changed-or-specifiednonoany

Examples

The following examples demonstrate the rules and the interactions between bin-policy, ship-bin, and ignore-bin. In both cases, the record state and configuration are as follows:

  • The record contains eight bins: bin1, bin2, bin3, bin4, bin5, bin6, bin7, and bin8
  • bin1 and bin5 are configured (specified) using ship-bin
  • bin2 and bin6 are configured (ignored) using ignore-bin

Case 1

Assume a write comes for bin1, bin2, and bin3. Bins are shipped as follows under different policies.

Bin policy interactions example, case 1

Case 2

Assume a write comes for bin6, bin7, and bin8. Bins are shipped as follows under different policies.

Bin policy interactions example, case 2

Use cases

The following example configurations apply to some common use cases.

Shipping specific bins if they changed

In this example, for namespace someNameSpaceName, only binName1 and binName2 are shipped.

Terminal window
xdr {
dc dataCenter1 {
node-address-port someIpAdress1 somePort1
namespace someNameSpaceName {
bin-policy changed-and-specified
ship-bin binName1
ship-bin binName2
}
}
}

Excluding specific bins

In this example, for namespace someNameSpaceName, all bins are shipped except binName1 and binName2.

Terminal window
xdr {
dc dataCenter1 {
node-address-port someIpAdress1 somePort1
namespace someNameSpaceName {
ignore-bin binName1
ignore-bin binName2
}
}
}

Ship changed bins

In this example, for namespace someNameSpaceName, all bins that are modified by a write are shipped.

Terminal window
xdr {
dc dataCenter1 {
node-address-port someIpAdress1 somePort1
namespace someNameSpaceName {
bin-policy only-changed
}
}
}

Ship changed bins plus some additional bins

In this example, for namespace someNameSpaceName, all bins that are modified by a write plus binName1 and binName2 are shipped.

Terminal window
xdr {
dc dataCenter1 {
node-address-port someIpAdress1 somePort1
namespace someNameSpaceName {
bin-policy changed-or-specified
ship-bin binName1
ship-bin binName2
}
}
}

Ship changed bins but not some bins

In this example, for namespace someNameSpaceName, all bins that are modified by a write except binName1 and binName2 are shipped.

Terminal window
xdr {
dc dataCenter1 {
node-address-port someIpAdress1 somePort1
namespace someNameSpaceName {
bin-policy only-changed
ignore-bin binName1
ignore-bin binName2
}
}
}
Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?