Skip to main content

Server vs. Client

Understanding the distinction between the server and client sides in Google Earth Engine (GEE) is essential for efficient and effective use of the platform. The Developer's overview provides detailed insights into how GEE processes data on the Google Cloud Platform, but here's a simplified explanation:

Client Side

The client side refers to the code that runs locally on your machine or within your browser. This includes:

  • Writing and editing scripts in the GEE Code Editor or a local IDE.
  • Interacting with the GEE API via JavaScript (in the Code Editor) or Python (in local scripts or Jupyter notebooks).

When you execute code that involves standard programming constructs (such as creating variables, performing arithmetic operations, or running loops), this code is executed entirely on the client side. GEE does not process these operations; they are handled by your local environment. For example:

var x = 1; var y = 2;
var z = x + y;
print(z)

Server Side

The server side refers to operations that involve GEE’s cloud-based processing capabilities. When you use GEE functions to manipulate or analyze geospatial data, these operations are sent to Google’s servers for processing. This allows for efficient handling of large datasets and complex computations that would be impractical to perform locally. For example:

To begin using the cloud computing resources of GEE, we have to call upon the server side. Let's say we want to import an image collection. In the snippet below, there is an ee before the ImageCollection constructor. In simple terms, this signals to Earth Engine that we will be using its resources. Without that indicator, GEE does not play a role in operations.

var sentinelCollection = ee.ImageCollection('COPERNICUS/S2_SR');

Key Points to Remember

  • Client-Side Operations: These are operations that are executed locally on your machine. They include basic programming constructs and operations that do not require GEE’s processing power.
  • Server-Side Operations: These involve sending requests to GEE’s cloud servers to process geospatial data. This includes operations like filtering image collections, performing computations on large datasets, and retrieving data.
  • Efficiency: Utilizing server-side operations allows for efficient processing of large datasets that would be impractical to handle locally.
  • Integration: Effective use of GEE often involves a combination of client-side and server-side operations, leveraging local code execution for simple tasks and GEE’s cloud processing for complex geospatial analyses.

By understanding and leveraging the distinction between client-side and server-side operations, you can make the most of Google Earth Engine’s powerful capabilities.