Beyond application and service optimization, an equally important area for performance improvement is the storage and characteristics of the data behind a specific service. Most data used in web services is tabular in nature (with the exception of image services), and most often involves both:
Both geometry and attributes can be optimized to support improved service performance. Additional documentation in these areas is available in the ArcGIS Pro documentation for settings that affect data access performance.
You can optimize the use of attributes through attribute reduction. Put simply, this entails the process of removing or hiding columns or attributes that may exist in a table but are not needed for your application or use case. This can be accomplished by removing columns when they are not needed, or un-checking them for display in the map when authored for publishing, for example, for map image layers. Hosted feature layer views can also be configured to exclude attributes that are not needed for a specific use case.
Attribute indexing is another important consideration, primarily when columns will be used to either filter or query in an application. Indexing allows for faster, more efficient queries when the request filters are based on a known attribute or is querying for a text, numeric or date-based attribute, and adding attribute indices is an excellent way to make use of already-built optimization technology in relational databases. Attribute indices can be added at a geodatabase level for feature classes, and as a property of the service for hosted feature layers.
Geometry columns can also be optimized in several important ways – depending on the use case and requirements for the data. One option is spatial generalization, often also referred to as simplification, which is a process of simplifying, smoothing, or reducing the level of detail of a geometric representation, such as a line or polygon, to reduce the size of the feature and the storage and processing requirements. This process can be completed on a permanent basis, if the original data is overly precise or overly detailed in terms of the vertices included, or could be completed on a read-only copy of the data that is used for visualization, while retaining full detail in the origin data.
Closely related is the idea of reducing spatial precision, which refers to the geometric or geographic data type, which usually stores a decimal value for the actual coordinates of each vertex of a feature, such as 124999.24541512. This value represents a linear unit, which varies based on the coordinate system of the dataset, but could be as large as decimal degrees or as small as feet or meters. In any case, ensuring that the spatial precision captured reflects the actual use case of the data can be important for both functional and performance reasons.
For data in a coordinate system with a meter-based linear unit, a geometry stored as (123456.789101112, 234567.891011121) has 9 decimal digits of precision, equivalent to nanometer-level precision. If the data is captured by a GPS unit with one meter accuracy (on average), then this precision is overstating the actual precision of the measurement by a significant factor. Reducing the spatial precision of the dataset by removing the decimal portion is not only more accurate but will reduce the size of the geometry when it is transferred in a network request by 50%, which helps with everything from serialization processes to bandwidth constraints. Using appropriate spatial precision is especially important with highly detailed polygon features, as the number of vertices can quickly reach thousands of records, and the resulting impact on service performance is significant.
Beyond attribute and geometry adjustments, other higher-level data storage approaches may help to optimize performance, including: