The data can be loaded from remote server one page at a time.

Grid sends pq_curpage and pq_rpp parameters to remote script.

In this case grid can't calculate the total records, so it's important to return totalRecords as json response from remote script.

{
    totalRecords: count of total records
    curPage: current page no,
    data: data of current page
}    
If the key names are named differently in json response, they can be mapped to required key names in dataModel.getData method.