JSON model or OData model: what is the difference in SAPUI5, and when do you use each? Which other models does an app usually have?
Say your answer out loud first.
Practise another way
A JSON model is a client-side model: all data sits in the browser, and sorting and filtering run in JavaScript.
It has no built-in way to send changes back, so I use it for small view state like busy flags or a selected tab.
The OData V2 and V4 models are server-side: they load data on demand, and filtering, sorting and paging run on the server. Every app also has a resource model for i18n texts, often a device model too.
The real difference is where the data lives and who does the work.
Client-side: JSON model
SAP's documentation calls the JSON model a client-side model for small data sets that are completely on the client. It has:
- no server paging and no delta loading;
- sorting and filtering done in JavaScript;
- two-way binding (its default mode);
- no built-in way to send changes to a server: you call
getData()and your own request.
Typical uses: a view model for UI state (busy, editable, selected filter), a small list loaded once with loadData, mock data.
Server-side: OData models
The OData V2 and V4 models are server-side: data comes from the back end on demand, and filtering, sorting and paging run on the server.
So you never load a full table to sort it. They also handle CSRF tokens, $batch, messages and pending changes.
- OData V4 model (
sap.ui.model.odata.v4.ODataModel): SAP's recommendation for new apps with remote data. Default binding mode two-way; noread/createmethods on the model, everything goes through bindings and contexts. - OData V2 model (
sap.ui.model.odata.v2.ODataModel): still common with SEGW services; default binding mode one-way; hasread,create,update,remove,callFunction.
Other models in a normal app
- Resource model for translatable texts from
i18n.properties. - Device model (a JSON model filled from
sap/ui/Device) for phone or desktop decisions. - XML model exists but is rare.
"sap.ui5": {
"models": {
"": { "dataSource": "mainService", "settings": { "operationMode": "Server" } },
"i18n": { "type": "sap.ui.model.resource.ResourceModel",
"settings": { "bundleName": "zapp.i18n.i18n" } },
"view": { "type": "sap.ui.model.json.JSONModel" }
}
}
Practical rule
Business data from S/4HANA goes through an OData model bound to your RAP or SEGW service. Copying a whole OData entity set into a JSON model "to make it easier" loses paging, server filtering and change tracking, and is a common performance problem in reviews.
Explains client-side versus server-side with concrete consequences (paging, filtering, sending changes) and names the resource and view models.
Says 'JSON is for local data and OData is for back-end data' and stops, or copies OData results into a JSON model by habit.
Loading a full OData entity set into a JSON model and filtering it in the browser: it breaks paging and draft and makes the app slow with real data volumes.
- How do you save changes made in a JSON model?
- Why does the V4 model have no read() method?
- What is the default size limit of a list binding, and how do you change it?
1 candidate write-up and 3 official pages. Confidence: high. Checked 1 Dec 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Candidate write-up Gives the question.