In I.T., what is a Schema?

Question
In computing, what is the definition of a schema?

Answer / schema disambiguation
Outside of the I.T. realm, Merriam-Webster's Dictionary (11th Edition, on page 1110) defines schema as "a diagrammatic presentation; broadly: a structured framework or plan: outline." This definition must have influenced the appropriation of the word to refer to concepts in I.T..

For Kubernetes
"Schemas are the set of JSON files for various Kubernetes versions, extracted from the OpenAPI definitions." (Taken from https://medium.com/trendyol-tech/how-can-we-accomplish-our-kubernetes-schemas-validation-against-our-clusters-e521af390322 .) Schemas can be downloaded from GitHub (e.g., in the form of a .tar.gz file) and uncompressed on to a server or pod.

For relational databases
In relational databases a schema defines relationships and the inner configurations of the database such as foreign key constraints between tables (per this posting https://stackoverflow.com/questions/29155012/referencing-the-foreign-key-of-another-schema).

A schema can be thought of a blueprint inside the database (per
https://techmonitor.ai/what-is/what-is-schema-4944519).

As there are many different types of relational databases, each one tends to have a different type of schema. For example, there are details about Oracle, PostgreSQL and SQL Server schemas that vary from product to product. Schemas can be specific to users, tables or other objects.

In some contexts, different types of schemas become important such as logical or physical schemas; to read about the differences of these types of schemas, see this https://stackoverflow.com/questions/22067378/what-is-the-difference-between-logical-schema-and-physical-schema/22069941#22069941

To learn about a user's schema in Oracle, see this: https://docs.oracle.com/cd/B19306_01/server.102/b14220/schema.htm

In SQL databases the DROP SCHEMA command (note that "DROP" is a DDL, not a DML, command) will remove the schema and the objects related to that schema.

To view the schema that governs a table in MySQL, use the "DESCRIBE" command like this (but replace "foo" with the database name and "bar" with the table name):

DESCRIBE foo.bar

(This was adapted from https://www.tutorialspoint.com/how-do-i-show-the-schema-of-a-table-in-a-mysql-database .)

For XML

An XML schema will define the elements of one or more XML files. Here is an example:


 <?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="note">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="to" type="xs:string"/>
      <xs:element name="from" type="xs:string"/>
      <xs:element name="heading" type="xs:string"/>
      <xs:element name="body" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

</xs:schema> 

It was taken from https://www.w3schools.com/xml/schema_intro.asp

Another definition (with a very similar example) can be found here: https://techterms.com/definition/schema

XSD stands for XML Schema Definition. A pom.xml file for Maven may refer to an .xsd file. To see an XML, click here.

For Terraform
See this internal posting.

For Pulumi
See this internal posting.

Leave a comment

Your email address will not be published. Required fields are marked *