Server-side vs. client-side
All widgets in CARTO offer the same core functionality: performant data calculations for large-scale data coming from your Data Warehouse, seamlessly synchronized with your CARTO + deck.gl map.
However, depending on the nature of the data source, the method to perform that calculation can vary:
Server-side calculation: The widget is calculated by performing SQL queries against your Data Warehouse. This is the most precise and preferred method, and CARTO uses it when available.
Client-side calculation: The widget is calculated locally, by filtering and aggregating the data that is available in the user's device. This is the fallback method.
Server-side widget calculation
All ...TableSource and ...QuerySource data source types will work with server-side widget calculation.
Client-side widget calculation
All ...TilesetSource and rasterSource data source types will work with client-side widget calculation. This type of calculation may have an impact on your application, depending on the following considerations:
const layers = [
new VectorTileLayer({
data: dataSource,
onViewportLoad(tiles) {
dataSource.widgetSource.loadTiles(tiles); // load tiles when new data is requested
renderWidgets(); // re-render the widgets with the new data
}
})
];Last updated
Was this helpful?
