Database Creation

Database Creation
You can connect to an existing database or, if you want to control schema (database) creation, you can add/edit tables/columns using the schema editing tools in
Layer7 Live API Creator
. To add/edit tables/columns, your database administrator must create an empty database that includes table create privileges.
Connecting to an existing database is part of the
Database-first
approach to creating APIs.
For more information about this approach to creating APIs, see Creating APIs.
This article introduces the concept of creating a database schema and explains the challenges for creating databases.
In this article:
Database Creation Challenges
The following diagram illustrates the flows for creating a database in API Creator:
API Creator workflow.png
In both workflows, the schema creates a default API, which your team can customize, define reactive logic, and create client applications. The upper workflow begins with an existing database. The lower workflow begins with a new database (or new tables in an existing database). The New Database workflow illustrates the common challenge of creating data servers and database coding. Creating data servers can be challenging even for experienced API developers. The administration obstacles alone are formidable. After you create your new database, you must code the schema using SQL syntax, possibly with common database tools. Database coding can be a blocker for business users, requiring mastery of SQL syntax and the complex concepts behind it, such as normalization and foreign keys.
The diagram suggests that you can reduce the time of bringing new ideas to market by accelerating and simplifying the steps to creating an API. And, just as important, if you can eliminate the complexities of schema syntax and concepts, a new class of people are empowered: business users.
The Core Idea: Your App is your Integrated Development Environment (IDE)
To offer the simplification of creating a database, the premise cannot be to teach database syntax and concepts to those who have other priorities. Rather, the approach must be to take well-known concepts that are already understood and create databases from these. That is, the application itself.
Virtually all business users can immediately recognize a master/detail form. The following image shows Data Explorer:CA Technologies
The idea is to build on this familiar and visual paradigm by creating a managed database and managing the content in a data source for a managed database using Data Explorer:
  • Create a table.
    Enter a name for the table and Data Explorer builds and runs the SQL to create the table.
  • Add a field.
    Enter a name and type for the field and Data Explorer builds and runs the SQL to add the field.
    Fields represent the columns in your database. The term
    field
    is used to stay within the metaphor of applications and screens, and not database terminology.
  • Create a related table.
    You can build tables that are related:
    • Create a child relationship.
      Creating a child table creates a managed child table and a relationship between the child and the parent table. This is, for example, how
      Layer7 Live API Creator
      created the
      LineItem
      table.
    • Create a parent relationship.
      Creating a related parent table relates a row to a specific parent record. This is, for example, how 
      Layer7 Live API Creator
      built the
      Product
      table, by way of the
      Name
      field, where you pick a
      Product
      for a
      LineItem
      .
For more information about how to create a managed database and how to manage the content in a data source for a managed database using Data Explorer, see Manage Tables and Fields using Data Explorer.
User Personas for Creating Managed Databases
In planning for creating managed databases, consider the following user personas:
Persona
Value
API developer
  • Eliminate delay in server creation.
  • Reduce tedious SQL syntax.
  • Retain extensibility and customization.
Business user
  • Create applications from the following simple familiar visual metaphors:
    • Master/detail
    • Lookup
  • Business logic by way of spreadsheet-like reactive logic.
Manager
  • Deliver projects much faster.
  • Empower business users to create their own systems.
Architect
Systems created by business users are supportable. They:
  • Run on standard servers.
  • Include business logic for integrity.
  • Include scalable performance.
  • Are pre-integrated, with automatic RESTful APIs.
  • Are extensible, with standards-based metaphors and languages.