database

Intro to databases

Updated: September 19, 2021

A database allows you to save, organize, and re-use data.

By default, Afterpattern apps do not save data. If you want to save app data, you must build a database and then send data from your app to that database.

Saving app data is the minimal use-case for a database. You will get the most out of Afterpattern when you recognize that databases allow you to create a system of connected apps. For example, an intake app, which collects data from the end-user and saves it in your database is great, but an intake system is even better. An intake system may look like this:

  • App 1: Collect data from the end-user and save it in your database;
  • (Time passes) You recognize that your data is outdated, so you use App 2 to send the end-user a request to review and update their information;
  • You use App 3 to automate documents based on the updated information in your database.

Databases are also an essential part of building portals.

Basic

Building a database schema

A database's schema is its structure. It reflects how you categorize data.

How to build a schema

In Afterpattern, you build a schema by adding tables and columns to your project's database.

For example, this database organizes data into the following categories (i.e. tables): Matters, People, Companies, Tasks, and Documents: 

In the Matters table, there is a column for each of following pieces of data: Matter ID, Name, Person, Company, etc...

data types

Intro to data types

Every column in your database has a specific data type that determines what kind of data can be stored in it. You specify the data type when you create the column (you can't edit this later):

The remainder of this lesson explores each column data type, including how you send data to, and pull data from, these columns.

The lesson concludes by introducing you to the concept of relational data and how you can use relational data to create complex data models.

data types

Key column

Work in progress

data types

Plain text

Work in progress

data types

Number

Work in progress

data types

True / False

Work in progress

data types

Date

Work in progress

data types

File

Work in progress

data types

Rich text

Work in progress

data types

Belongs to

Work in progress

data types

Has many

Work in progress

Advanced

Intro to relational data

One of the most powerful features is the ability to create relational tables.

Relational tables are 2+ tables that are linked together with "has many" or "belongs to" datatype columns. For example, you can have a table with client data that is linked to a table with data about each client's respective children:

Creating relational tables is easy, just add a "has many" or "belong to" datatype column to a table (this will prompt to select a second table to connect it to). Using relational data in your apps is a bit more advanced. This topic is covered in the relational data lesson.

On this page

basic
data types
Advanced

Hire an Afterpattern expert

Go from idea to launch in weeks.

View services