Programming Considerationsand BestPractices
Thischapter provides considerations and practices that can help you create ecient 5800
systemapplications.
Thefollowing topics are discussed:
“Retriesand Timeouts” on page 127
“QuerySize Limit” on page 127
“Limitthe Size of Schema Query Parameters and Literals” on page 128
“LimitResults Per Fetch” on page 128

Retries and Timeouts

Clientapplications should place API calls within retry loops to handle cases such as storage
nodefailover. One immediate retry should be sucient in the great majority of cases. In some
casesof node failover, retries should be pursued for up to 30 seconds.
Whenthe 5800 system server is suciently loaded, client timeouts may occur. To avoid this,
maximumclient threads should no greater than 25 times the number of nodes. For example, on
afull-cell with 16 storage nodes, the maximum client threads should be less than or equal to 25
times16, or 400 client threads.

Query Size Limit

Thereis a hard limit when querying a live 5800 system or hive on the combined size of query
parametersand literal values that can be processed in one query. The limit is slightly over 8000
bytes.The query string itself does not count against this limit, just the parameter and literal
valuesin the query.
Eachadditional parameter or literal in the query contributes 2 bytes of overhead plus the
numberof bytes to represent the query value. For this calculation, each date or time value
consumes4 bytes. Each long, double, or timestamp value consumes 8 bytes. A binary or char
5
CHAPTER 5
127