Howdah - An Application using Pylons, PostgreSQL, Simpycity and Exceptable

1,748 views 54 slides Oct 08, 2010
Slide 1
Slide 1 of 54
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54

About This Presentation

Aurynn Shaw

This mini-tutorial covers building a small application on Howdah, an open source, Python based web development framework by Commandprompt, Inc. We will cover the full process of designing a vertically coherent application on Howdah, integrating DB-level stored procedures, DB exception p...


Slide Content

HOWDAH
A tutorial
Tuesday, October 20, 2009

Why?
Howdah is for people who really “get” databases
Howdah treats your database as code. Procedures,
and hand-written SQL.
Would you automate python generation? Then why
SQL?
Just because it’s not code you’re comfortable with,
doesn’t make it any less code.
2
Tuesday, October 20, 2009

What shall we build?
Today, we’ll be talking about designing and
implementing a Wiki.
3
Tuesday, October 20, 2009

Why a Wiki?
Canonical example
Simple enough to define in an afternoon
Complex enough to require in-depth exploration
4
Tuesday, October 20, 2009

Why a Wiki?
Public and Private permissions/users
Read/write collaborative model
5
Tuesday, October 20, 2009

Design vs. Code
Speaking more on Design than on Code
Why is more important than How.
How is still important
6
Tuesday, October 20, 2009

STEP 1:
DESIGN
7
Tuesday, October 20, 2009

Database
What do we need?
8
Tuesday, October 20, 2009

Application
What do we need?
9
Tuesday, October 20, 2009

Application
What do we need?
Anything else? Did we miss anything?
10
Tuesday, October 20, 2009

STEP 2:
REVISIT
11
Tuesday, October 20, 2009

Database
Based on our Application design, what expansions do
we need?
12
Tuesday, October 20, 2009

Database
Based on our Application design, what expansions do
we need?
Why do we need them?
13
Tuesday, October 20, 2009

Application
With the new DB features, what changes?
14
Tuesday, October 20, 2009

Application
With the new DB features, what changes?
What new ideas are evident?
15
Tuesday, October 20, 2009

Application
With the new DB features, what changes?
What new ideas are evident?
Do the changes make things easier?
16
Tuesday, October 20, 2009

STEP 3:
API CONTRACTS
17
Tuesday, October 20, 2009

Database
Defining our API
What stored procedures do we need?
18
Tuesday, October 20, 2009

Database
Defining our API
What stored procedures do we need?
What should they do?
19
Tuesday, October 20, 2009

Database
Defining our API
What exceptions do we need?
20
Tuesday, October 20, 2009

Database
Defining our API
What exceptions do we need?
Null data
Bad data
No such record
21
Tuesday, October 20, 2009

Application
Defining our API
What models do we need?
22
Tuesday, October 20, 2009

Application
Defining our API
What exceptions do we need?
23
Tuesday, October 20, 2009

Application
Defining our API
What exceptions do we need?
What do DB exceptions become?
What HTTP responses should the exceptions
raise?
24
Tuesday, October 20, 2009

Application
Defining our API
What views do we need?
25
Tuesday, October 20, 2009

Application
Defining our API
What views do we need?
What views are read-only? Read-write? Write-only?
26
Tuesday, October 20, 2009

STEP 4:
FIRST EXPANSION
USERS
27
Tuesday, October 20, 2009

Database
Users
User system!
28
Tuesday, October 20, 2009

Database
Users
User system!
VerticallyChallenged for users
29
Tuesday, October 20, 2009

Database
Users
User system!
VerticallyChallenged for users
How to set up VC
30
Tuesday, October 20, 2009

Database
Users
Stored Procedures - How do we adapt them?
How does this affect our API contract?
31
Tuesday, October 20, 2009

Application
Users
Using @needs to define permissions
How should views be protected?
32
Tuesday, October 20, 2009

Application
Users
Using @needs to define permissions
How should views be protected?
Should anonymous users have write permission?
33
Tuesday, October 20, 2009

Application
Users
Permissions violations
What should no user return?
What should a bad user return?
What should insufficient permissions return?
34
Tuesday, October 20, 2009

Application
Users
Why - Are there better mechanisms?
35
Tuesday, October 20, 2009

STEP 5:
ADMINISTRATIVE
USERS
36
Tuesday, October 20, 2009

Database
Administrators
What delineates an admin?
What special things can an admin do?
Should admins be otherwise normal users?
37
Tuesday, October 20, 2009

Database
Administrators
Root-level permissions:
Should the database superuser ever be allowed to log
in from the web app?
38
Tuesday, October 20, 2009

Database
Administrators
Root-level permissions:
Should the database superuser ever be allowed to log
in from the web app?
Why?
39
Tuesday, October 20, 2009

Application
Administrators
What delineates an Admin?
40
Tuesday, October 20, 2009

Application
Administrators
Design
Are there special admin-only views?
How do we protect admin privileges?
Are there user-specific views? Do admins have
permission to access those?
Is anything changed by the DB layer?
41
Tuesday, October 20, 2009

Application
Administrators
Should administrators be able to view everything?
42
Tuesday, October 20, 2009

Application
Administrators
Should administrators be able to view everything?
What about privileged information?
HIPAA, lawyer confidentiality
43
Tuesday, October 20, 2009

Application
Administrators
Should administrators be able to view everything?
What about privileged information?
HIPAA, lawyer confidentiality
How can we protect privileged information like this?
Can we ever guarantee protection? How?
44
Tuesday, October 20, 2009

STEP 6:
A NEW FEATURE
45
Tuesday, October 20, 2009

A New Feature
Let’s add a user profile page
Specifically list the pages that a user has edited
46
Tuesday, October 20, 2009

Database
A New Feature
Design first!
47
Tuesday, October 20, 2009

Database
A New Feature
Design first!
Do we need new stored procedures?
What are they?
Who has access to them?
Does this require write access?
48
Tuesday, October 20, 2009

Application
A New Feature
What does the app need to support this?
49
Tuesday, October 20, 2009

Application
A New Feature
What does the app need to support this?
What views do we need?
50
Tuesday, October 20, 2009

Application
A New Feature
What does the app need to support this?
What views do we need?
Who has access to the views?
Logged-in users only?
51
Tuesday, October 20, 2009

Application
A New Feature
What about security and data confidentiality?
What security issues could be present?
52
Tuesday, October 20, 2009

Application
A New Feature
What about security and data confidentiality?
What security issues could be present?
Do we list entries that a user may not have read
access to?
53
Tuesday, October 20, 2009

Application
A New Feature
What about security and data confidentiality?
What security issues could be present?
Do we list entries that a user may not have read
access to?
Should we list nothing, instead?
Why do it like this? Are there better solutions?
54
Tuesday, October 20, 2009