The Store-to-Layer Model

GeoServer decouples data sourcing from data publishing. A Store represents a configured connection to a data source (database, file, or stream). Layers are the individual datasets extracted from a store, styled, and exposed via WMS, WFS, or WCS protocols.

Data Source
PostGIS / S3 / MongoDB
Configuration
Data Store
Publication
Layers (1:N)
Output
WMS / WFS / WCS

This 1:N relationship allows multiple feature classes from a single database to share connection pooling, credentials, and spatial reference handling while maintaining independent styling, caching, and access control policies.

Configuring Stores

Stores handle connection management, dialect translation, and stream processing. Choose a store type based on your data format and performance requirements.

Store Type Best For Streaming Support Max Concurrent Connections
PostgreSQL/PostGIS Relational vector data, complex queries Native Connection Pool (configurable)
GeoTIFF / NetCDF High-resolution raster, satellite imagery Yes Single-threaded, tile-optimized
Shapefile / GeoJSON Static datasets, migration/testing Read-only Limited (file lock constraints)
MongoDB / Elasticsearch Document stores, geospatial indices Native Connection Pool
# REST API: Create a PostGIS Store POST /geoserver/rest/workspaces/myws/datastores Content-Type: application/xml
<dataStore> <name>production_postgis</name> <connectionParameters> <host>db.geo.local</host> <port>5432</port> <database>spatial_prod</database> <user>gis_reader</user> <passwd>encrypted_ref</passwd> </connectionParameters> </dataStore>

Layer Configuration

Each layer defines how a dataset is served. Key properties include native/declared SRS, bounding boxes, attribute indexing, and style references.

Vector Layers

Point, Line, and Polygon features. Supports SLD/SE styling, WFS-T transactions, and feature filtering via CQL/ECQL.

  • Index-based query optimization
  • Attribute table mapping
  • FeatureInfo format (HTML, GeoJSON, XML)

Raster Layers

Continuous surfaces and imagery. Optimized for tile requests, overviews, and band math expressions.

  • Automatic overview generation
  • Resampling filters (Bilinear, Nearest, Cubic)
  • WCS Coverage access

Performance & Caching

Raw database queries scale poorly at high zoom levels. GeoServer integrates with GeoWebCache (GWC) and supports inline query optimization.

# Recommended layer settings for production MaxFeatures: 1000 (WFS safety limit) NumDecimals: 6 (EPSG:4326 precision) Expose Primary Keys: false (security) Enabled: true GWC Cache: enabled (TMS / WMTS)

Query Bounds Optimization: Enable Expand to envelope for complex geometries to reduce WKT serialization overhead. For PostGIS, ensure spatial_index exists and set native bbox to Use Spatial Index.

Layer-Level Security

Credentials are stored at the Store level, while visibility and transaction permissions are enforced at the Layer level. GeoServer supports role-based ACLs, IP filtering, and request signing.

Permission Scope Controls Enforcement Level
Store Credentials DB authentication, connection pooling Backend (encrypted vault)
Layer Visibility WMS/WFS publishing toggle Request routing layer
Transaction (WFS-T) INSERT, UPDATE, DELETE Role-based ACL mapping
Attribute Filtering Column-level redaction Feature type schema mapping

Ready to Deploy?

Configure your first store, publish layers, and enable caching through the Admin Console or automate via the REST Configuration API.

Open Admin Console REST API Docs

Need Architectural Review?

Our geospatial engineering team can audit your store configuration, optimize query performance, and implement enterprise ACL policies.

Schedule a consultation →