Search⌘ K

Class Hierarchies with SQL

Explore how to model class hierarchies and inheritance in databases for front-end apps using plain JavaScript. Understand SQL standards, key-value storage, and three common inheritance mapping approaches with practical examples.

We'll cover the following...

A standard DBMS stores information, such as objects, in the rows of the tables, conceived as set-theoretic relations in classical relational database systems. The relational database language SQL is used to define, populate, update, and query these kinds of databases. However, there are also simpler data storage techniques that don’t support SQL, but allow us to store data in table rows. For example, key-value storage systems, such as JavaScript’s Local Storage API, allow us to store a serialization of a JavaScript entity table as a key. This serialization, which is a map of entity records, is saved as a string value associated with the table name.

While there is no support for subtyping and inheritance in the classical version of SQL ...