---
schema_version: "1"
id: 07bddb1eb5422b815664ed0fc1948535a4a90354cf76437d25c2c750927e17d4
title: Working with Salesforce Data
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/data-service/data.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/data.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 74660dffb7224229c561d2e22dc7869a36cfd75ed13603823a04dee0efb3933c
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# Working with Salesforce Data

To create, read, and update Salesforce data from an Aura component, use Lightning Data Service via `force:recordData` or the form-based components. To delete Salesforce data, use `force:recordData`.

-   **[Lightning Data Service](https://developer.salesforce.com/docs/platform/aura-platform/guide/data-service.md)**  


    Use Lightning Data Service to load, create, edit, or delete a record in your component without requiring Apex code. Lightning Data Service handles sharing rules and field-level security for you. In addition to simplifying access to Salesforce data, Lightning Data Service improves performance and user interface consistency.

-   **[Using Apex](https://developer.salesforce.com/docs/platform/aura-platform/apex/apex-intro.md)**  


    Use Apex to write server-side code, such as controllers and test classes. Use Apex only if you need to customize your user interface to do more than what Lightning Data Service allows, such as using a SOQL query to select certain records. Apex provisions data that’s not managed and you must handle data refresh on your own.


