Design Constraint: Salesforce Development is Metadata-Driven

What is metadata? Metadata is simply data that describes other data – metadata is what gives your data context, whether it’s data about your customers or data used for application configuration.

The Salesforce metadata-driven architecture is what enables abstraction of the underlying infrastructure and database.

The abstraction of the infrastructure and database is what enables the multitenant architecture, which in turn enables the tens of  thousands of Salesforce orgs to be running on the same version of the Salesforce application yet support the unique customization needs of each individual customer.

For example, if  you were to look at a detail page for an Account record, you would see field labels that describe the data stored in that field, and the user interface would render HTML elements such as date pickers or dropdown lists based on the data type of the field.

Even the data to describe the sections that appear and the placement of each of the fields on the page layout is stored as metadata.

The metadata-driven architecture of the Lightning Platform allows Salesforce developers to reuse common pieces of functionality provided by the platform to create new applications.

The data that describes how each of these “building blocks” of functionality should work is stored as metadata in the same database that stores all of our business data.

Taking a metadata-driven approach to application development means having to write and maintain less code.

While it may seem paradoxical to developers new to the Lightning platform, the goal of every Salesforce developer should be to use “clicks” instead code and develop applications declaratively wherever possible, with the metadata for these declarative customizations stored in the Lightning Platform database.

When declarative development options have been exhausted and Apex code needs to be written, the Apex language itself provides built-in capabilities to assist developers with working with metadata.

Learning how to use metadata to describe the schema and configuration of a given Salesforce instance is a key skill to master.

Apex provides many system classes to help developers ask the Lightning Platform about itself for the purpose of creating further abstractions of the platform in our own code to promote reusability and reduce hard-coding to specific instances of the platform.