Introduction: What is LDS in a nutshell

Lightning Data Service (LDS) is a declarative service that allows you to access, modify or create data in Salesforce, most of the time without server-side code.

<aside> 👉 LDS does not support External objects, person accounts, and custom metadata types are not supported.

</aside>

Choosing the right tool for the job for accessing data

You have 3 different options to work with LDS:

  1. Using Base Components
  2. Using pre-configured adapters with @wiredecorator
  3. Using Apex with the @wire decorator

The full schema is:

**Acccesing Data from LWC**
|--- 1. Base Components
|--- 2. Preconfigured adapters with @wire
|       |--- 2.1 Decorating a property with @wire
|       |--- 2.2 Decorating a function with @wire
|--- 3. Custom Apex
        |--- 3.1 Wired to a property
        |--- 3.2 Wired to a function
        |--- 3.2 Call imperatively

1. Using Base Components

This is the easiest way to work with records. These components provide a UI to view, create, and edit recorda, similar to the record detail page in Salesforce.

<aside> 📢 Using the Base Components is explained in detail here: Using Base Components

</aside>

There are 3 base components: