Can anyone help me understand what is the Schema, the namespace and consequently the Schema namespace ?

  • 2
    can you provide some examples of where you're seeing these terms? as they can be interpreted differently depending on context it helps alot to have your context Commented Nov 3, 2018 at 9:39

2 Answers 2


"Schema", generically, refers to the structure of the database. In Salesforce terms, that means the set of objects you have, the fields on those objects, and the relationships between them. You'll see this usage, for example, in the Schema Builder tool in Setup.

Apex provides a Schema class, which includes top-level methods to get Describe API information about the schema (and associated metadata, like available tabs). The Schema class is in the System namespace.

Apex also has a Schema namespace. The Schema namespace hosts a variety of classes that are used by the Describe API, like DescribeFieldResult. It's also the namespace for static references into Describe metadata, like Schema.sObjectType.Account.


Adding on top of what David has already answered.


By Definition:

Schema is just pictorial representation of relationship between the database created.

In Salesforce, it's a representation of Objects related to each other using relationships as defined when you see it pictorially from Schema Builder


By Definition:

A namespace is a one to 15-character alphanumeric identifier that distinguishes your package and its contents from packages of other developers. A namespace is assigned to a package at the time that it’s created, and can’t be changed.

Salesforce has namespaces defined across the platform to group contents as those are offered. E.g.,

Apex classes and interfaces are grouped by the namespaces they’re contained in. For example, the Database class is in the System namespace.

Schema Namespace

By Definition:

The Schema namespace provides classes and methods for schema metadata information.

Based on the above reference of the namespace as utilized in Apex Language Reference, Schema Namespace is a package where it consists of all the classes grouped together which specifically operate on Schema metadata related operations.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .