You need to sign in to do that
Don't have an account?
lightning data service vs APEX?
I'm trying to understand the efficiencies of Lightning Data Service versus using APEX. I DO understand that many people have a phobia regarding APEX, but I don't, so that's not a benefit to me. I'm really asking about things like performance (responsiveness), demands on the server, governor limits, etc.
Here's a specific example:
I'm building a Lightning Component (list.cmp) that iterates through 20 message__c records, using a tile.cmp to display 5 fields from message__c on each of the record tiles in the scrollable list. I can accomplish this 2 ways.
I have actually already built this using the first method and it works fine, but I'm really trying to drink the LDS Kool-Aid and use it wherever it makes sense. I just need more info to understand whether it makes sense.
Same question for saving a new record via LDS vs APEX. Is LDS faster? easier on the server? better with regard to governor limits?
Here's a specific example:
I'm building a Lightning Component (list.cmp) that iterates through 20 message__c records, using a tile.cmp to display 5 fields from message__c on each of the record tiles in the scrollable list. I can accomplish this 2 ways.
- listController calls APEX, returning a list<message__c> of the 20 records with 5 fields per record. I aura:iterate through the list, passing a message__c object as the parameter. The tile.cmp receives the full message__c object and builds the tile. Or...
- listController calls APEX, returning a list of message__c Id numbers. I aura:iterate through the list passing only the recordId to tile.cmp, which uses force:recordData to pull the record data using LDS, then builds the tile.
I have actually already built this using the first method and it works fine, but I'm really trying to drink the LDS Kool-Aid and use it wherever it makes sense. I just need more info to understand whether it makes sense.
Same question for saving a new record via LDS vs APEX. Is LDS faster? easier on the server? better with regard to governor limits?