52
Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Appahost Model Model

Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Embed Size (px)

Citation preview

Page 1: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Cloudacus = LAMP + Appaserver

©Tim Riley

Appahost ModelAppahost Model

Page 2: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Why LAMP?

©Tim Riley

Why Linux?Why Apache?

Why MySQL?Which Programming

Language?

Page 3: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

What is a structured database?

©Tim Riley

Cloudacus = LAMP + Appaserver

Appahost ModelAppahost Model

Page 4: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

What is a structured database?

Set Name

©Tim Riley

Database sets are also known as:* categories* tables* folders* collections

Page 5: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

What is a structured database?

Set Name

Attribute 1 datatypeAttribute 2 datatype …Attribute n datatype

Attributes are also known as:* columns* fields* properties

©Tim Riley

Page 6: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

What is a structured database?

Set Name

Attribute 1 datatypeAttribute 2 datatype …Attribute n datatype

Examples of datatypes:* Integer number* Floating point (real) number* Date* Time* Line of text* Notepad of text

©Tim Riley

Page 7: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Example Set

Personfull_name textskin_color textreligion textheight_inches integerweight_pounds integerbirth_date dateannual_income floatgeneral_characterists notepad

©Tim Riley

Page 8: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Set Elements

PersonFull Name

Linus Torvalds

Guido van Rossum

Bill Henry Gates III

Sets contain elements

©Tim Riley

Elements are also known as:* members* records* rows* tuples

Page 9: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Making Subsets

Personfull_name textskin_color textreligion textheight_inches integerweight_pounds integerbirth_date dateannual_income floatgeneral_characterists notepad

©Tim Riley

Page 10: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Set Relationships

©Tim Riley

Set 1 Set 2Verb phrase

Page 11: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Set Relationships

Person StateReside in

©Tim Riley

Page 12: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Many Set Relationships

©Tim Riley

Person StateReside in

School

Attend

Page 13: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Many Set Relationships

Person StateReside in

Born in

©Tim Riley

Page 14: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Set Relationship TypesSet 1

There are 5 types of set relationships:1) many-to-one2) one-to-many3) many-to-many4) one-to-one5) is-a

Set 2Verb phrase

©Tim Riley

Page 15: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Many-to-one RelationshipPerson

”Many persons

StateReside in

many one

one state.”reside in

©Tim Riley

Page 16: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

One-to-many RelationshipPerson

Reverse the arrow to reverse the relationship. ”One state has as residents many persons.”

StateHas resident

many one

©Tim Riley

Page 17: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Many-to-many RelationshipPerson

”One person can visit many states. And one state can have as visitors many persons.”

StateVisit

many many

©Tim Riley

Page 18: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

One-to-one RelationshipOffice

”One office has one phone.”

PhoneHas

one one

©Tim Riley

Page 19: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Is-a RelationshipAccountant

”An accountant is a person.”

PersonIs a

one one

©Tim Riley

Page 20: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Enforcing Business Rules

Two broad categories of business rule enforcement are:

1) Implementational restrictions (bad)2) Integrity constraints (good)

©Tim Riley

Page 21: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Enforcing Business Rules

Implementational restrictions are business rules the information system cannot enforce.

Person StateReside in

many one

©Tim Riley

Page 22: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Implementational Restrictions

©Tim Riley

Person StateVisit

many many

Page 23: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

one one

many

Implementational Restrictions

©Tim Riley

Person State

many

Person Visit

Page 24: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Enforcing Business RulesIntegrity constraints are business rules the information system succeeds at enforcing. Two imperative integrity constraints are:

1) Relational integrity2) Element uniqueness

©Tim Riley

Page 25: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Enforcing Business RulesRelational integrity is the constraint that an element in each set must exist in order for a relationship to exist between them.

Person StateReside in

many one

A state element can exist without any persons residing in it.

A person element can exist without residing in a state.

©Tim Riley

Page 26: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Enforcing Business RulesElement uniqueness is the constraint that an element cannot exist more than once in a set.

Personfull_name text *

Only one person named Bill Henry Gates III can belong to the person set.

The set of attributes enforcing uniqueness is called the primary key.

©Tim Riley

Page 27: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Element UniquenessNatural primary key: the set of attributes that naturally enforce uniqueness.

Personfull_name text *street_address text *

Names are likely to be naturally duplicated.

If a set has more than one attribute assigned to its primary key, then it's called a multi-attribute primary key.

©Tim Riley

Page 28: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Element Uniqueness

Primary keys naturally occur.

To identify the natural primary key, always consider the four dimensions. Uniqueness can always be naturally identified with:

1) Longitude2) Latitude3) Elevation4) Time

All of the organization's places should be categorized.

All events need a date/time stamp.

©Tim Riley

Page 29: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Foreign key: in a many-to-one relationship, the many table needs to have as attributes the primary key of the one table.

Personfull_name text *street_address text *state text

Statestate text *

Reside in

many one

Foreign key is the primary key of the one table.

Primary key of the one table.

©Tim Riley

Element Uniqueness

Page 30: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Element UniquenessMutable primary keys: The value of primary keys can change when using Appaserver.

Personfull_name text *street_address text *

©Tim Riley

You can change the person's name if she gets married or change the street address if he moves.

Page 31: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Story Telling: Seabed Study

©Tim Riley

Page 32: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

©Tim Riley

Cloudacus = LAMP + Appaserver

Appahost ModelAppahost Model

Page 33: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

©Tim Riley

Cloudacus = LAMP + Appaserver

Page 34: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Appaserver's Database Structure

Tabletable_name text *

Columncolumn_name text *

Is described

by

many many

Table is the relational database synonym for set.

Column is the relational database synonym for attribute.

©Tim Riley

Page 35: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Table ColumnIs

described by

many many

Appaserver's Database Structure

©Tim Riley

Page 36: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Appaserver's Database Structure

Folderfolder text *

Attributeattribute text *

many many

Appaserver stores tables in the table called ”Folder.”

Appaserver stores columns in the table called ”Attribute.”

©Tim Riley

Page 37: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

one one

manymany

Appaserver's Database StructureFolder

folder text *

Attributeattribute text *

Folder_Attributefolder text *attribute text *

©Tim Riley

Page 38: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Appaserver's Database Structure

Storing Relationships

Person

StateReside in

SchoolAttend

©Tim Riley

Page 39: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Appaserver's Database Structure

Storing Relationships

Person

Accountant Teacher

Is aIs a

©Tim Riley

Page 40: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Appaserver's Database Structure

Storing Relationships

Folder Has relationship

many

many

©Tim Riley

Page 41: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Appaserver's Database Structure

Storing Relationships

Folder Relation

©Tim Riley

Page 42: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Relational Database Operations

©Tim Riley

1) Select2) Insert3) Update4) Delete

Page 43: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Building Non-trivial Databases

©Tim Riley

Page 44: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Appaserver's Screen Types

©Tim Riley

1) Insert2) Lookup3) Update4) View5) Detail

Page 45: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Insert Screen

©Tim Riley

Page 46: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Insert Screen

©Tim Riley

Page 47: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Lookup Screen

©Tim Riley

Page 48: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Update Screen

©Tim Riley

Page 49: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

View Screen

©Tim Riley

Page 50: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

Detail Screen

©Tim Riley

Page 51: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

©Tim Riley

Cloudacus = LAMP + Appaserver

Appahost ModelAppahost Model

Page 52: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model

©Tim Riley

Cloudacus = LAMP + Appaserver

Appahost ModelAppahost Model

[email protected]