SlideShare ist ein Scribd-Unternehmen logo
1 von 54
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Andere mochten auch

Not Just UNIQUE: Generalized Index Constraints
Not Just UNIQUE: Generalized Index ConstraintsNot Just UNIQUE: Generalized Index Constraints
Not Just UNIQUE: Generalized Index ConstraintsCommand Prompt., Inc
 
Pro PostgreSQL, OSCon 2008
Pro PostgreSQL, OSCon 2008Pro PostgreSQL, OSCon 2008
Pro PostgreSQL, OSCon 2008Robert Treat
 
Scaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsScaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsGavin Roy
 
2014.10.15 Сергей Бурладян, Avito.ru
2014.10.15 Сергей Бурладян, Avito.ru2014.10.15 Сергей Бурладян, Avito.ru
2014.10.15 Сергей Бурладян, Avito.ruNikolay Samokhvalov
 
Londiste Replication system for PostgreSQL
Londiste Replication system for PostgreSQLLondiste Replication system for PostgreSQL
Londiste Replication system for PostgreSQLelliando dias
 
Monitoreo tunning postgresql_2011
Monitoreo tunning postgresql_2011Monitoreo tunning postgresql_2011
Monitoreo tunning postgresql_2011Lennin Caro
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL AdministrationCommand Prompt., Inc
 
Building a Spatial Database in PostgreSQL
Building a Spatial Database in PostgreSQLBuilding a Spatial Database in PostgreSQL
Building a Spatial Database in PostgreSQLKudos S.A.S
 
PostgreSQL: Un motor Impulsado por una comunidad
PostgreSQL: Un motor Impulsado por una comunidadPostgreSQL: Un motor Impulsado por una comunidad
PostgreSQL: Un motor Impulsado por una comunidadSantiago Zarate
 
PostgreSQL High Availability via SLONY and PG POOL II
PostgreSQL High Availability via SLONY and PG POOL IIPostgreSQL High Availability via SLONY and PG POOL II
PostgreSQL High Availability via SLONY and PG POOL IICommand Prompt., Inc
 
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Command Prompt., Inc
 
PostgreSQL Scaling And Failover
PostgreSQL Scaling And FailoverPostgreSQL Scaling And Failover
PostgreSQL Scaling And FailoverJohn Paulett
 
CMD Command prompts
CMD Command promptsCMD Command prompts
CMD Command promptsAhmed Hesham
 
configuring a warm standby, the easy way
configuring a warm standby, the easy wayconfiguring a warm standby, the easy way
configuring a warm standby, the easy wayCommand Prompt., Inc
 
Implementing the Future of PostgreSQL Clustering with Tungsten
Implementing the Future of PostgreSQL Clustering with TungstenImplementing the Future of PostgreSQL Clustering with Tungsten
Implementing the Future of PostgreSQL Clustering with TungstenCommand Prompt., Inc
 

Andere mochten auch (20)

Bucardo
BucardoBucardo
Bucardo
 
Not Just UNIQUE: Generalized Index Constraints
Not Just UNIQUE: Generalized Index ConstraintsNot Just UNIQUE: Generalized Index Constraints
Not Just UNIQUE: Generalized Index Constraints
 
The PostgreSQL Query Planner
The PostgreSQL Query PlannerThe PostgreSQL Query Planner
The PostgreSQL Query Planner
 
Pro PostgreSQL, OSCon 2008
Pro PostgreSQL, OSCon 2008Pro PostgreSQL, OSCon 2008
Pro PostgreSQL, OSCon 2008
 
Scaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsScaling PostgreSQL with Skytools
Scaling PostgreSQL with Skytools
 
2014.10.15 Сергей Бурладян, Avito.ru
2014.10.15 Сергей Бурладян, Avito.ru2014.10.15 Сергей Бурладян, Avito.ru
2014.10.15 Сергей Бурладян, Avito.ru
 
Londiste Replication system for PostgreSQL
Londiste Replication system for PostgreSQLLondiste Replication system for PostgreSQL
Londiste Replication system for PostgreSQL
 
Monitoreo tunning postgresql_2011
Monitoreo tunning postgresql_2011Monitoreo tunning postgresql_2011
Monitoreo tunning postgresql_2011
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
 
Building a Spatial Database in PostgreSQL
Building a Spatial Database in PostgreSQLBuilding a Spatial Database in PostgreSQL
Building a Spatial Database in PostgreSQL
 
PostgreSQL: Un motor Impulsado por una comunidad
PostgreSQL: Un motor Impulsado por una comunidadPostgreSQL: Un motor Impulsado por una comunidad
PostgreSQL: Un motor Impulsado por una comunidad
 
PostgreSQL High Availability via SLONY and PG POOL II
PostgreSQL High Availability via SLONY and PG POOL IIPostgreSQL High Availability via SLONY and PG POOL II
PostgreSQL High Availability via SLONY and PG POOL II
 
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
 
PostgreSQL Scaling And Failover
PostgreSQL Scaling And FailoverPostgreSQL Scaling And Failover
PostgreSQL Scaling And Failover
 
CMD Command prompts
CMD Command promptsCMD Command prompts
CMD Command prompts
 
configuring a warm standby, the easy way
configuring a warm standby, the easy wayconfiguring a warm standby, the easy way
configuring a warm standby, the easy way
 
Implementing the Future of PostgreSQL Clustering with Tungsten
Implementing the Future of PostgreSQL Clustering with TungstenImplementing the Future of PostgreSQL Clustering with Tungsten
Implementing the Future of PostgreSQL Clustering with Tungsten
 
Pg migrator
Pg migratorPg migrator
Pg migrator
 
Go replicator
Go replicatorGo replicator
Go replicator
 
Backup and-recovery2
Backup and-recovery2Backup and-recovery2
Backup and-recovery2
 

Ähnlich wie Howdah - An Application using Pylons, PostgreSQL, Simpycity and Exceptable

Vertically Challenged
Vertically ChallengedVertically Challenged
Vertically ChallengedAurynn Shaw
 
Lowering IT Costs with a Standards-based Platform for Web 2.0 Initiatives: A...
Lowering IT Costs with a Standards-based Platform for Web 2.0 Initiatives:  A...Lowering IT Costs with a Standards-based Platform for Web 2.0 Initiatives:  A...
Lowering IT Costs with a Standards-based Platform for Web 2.0 Initiatives: A...Day Software
 
Webhooks - glue for the web
Webhooks - glue for the webWebhooks - glue for the web
Webhooks - glue for the webStoyan Zhekov
 
Investing in open source hw
Investing in open source hwInvesting in open source hw
Investing in open source hwbijansabet
 
Nanite (And An Introduction To Cloud Computing)
Nanite (And An Introduction To Cloud Computing)Nanite (And An Introduction To Cloud Computing)
Nanite (And An Introduction To Cloud Computing)will_j
 
Open Video And Metadata Presentation
Open Video And Metadata PresentationOpen Video And Metadata Presentation
Open Video And Metadata PresentationFred Benenson
 
Why Architecture Matters
Why Architecture MattersWhy Architecture Matters
Why Architecture MattersLars Jankowfsky
 
MATI 2009 Conference: CAT Tools
MATI 2009 Conference: CAT ToolsMATI 2009 Conference: CAT Tools
MATI 2009 Conference: CAT ToolsDierk Seeburg
 
Holland Exibition Promotion
Holland Exibition PromotionHolland Exibition Promotion
Holland Exibition PromotionVincent Everts
 
Content Management Selection and Strategy
Content Management Selection and StrategyContent Management Selection and Strategy
Content Management Selection and StrategyIvo Jansch
 
Ibuildings Cms Talk
Ibuildings Cms TalkIbuildings Cms Talk
Ibuildings Cms Talkdean1985
 
Joi's talk at the QRCE
Joi's talk at the QRCEJoi's talk at the QRCE
Joi's talk at the QRCEJoi Ito
 
Vincent Everts @rabobank RMIJ
Vincent Everts @rabobank RMIJVincent Everts @rabobank RMIJ
Vincent Everts @rabobank RMIJrenedebeer
 

Ähnlich wie Howdah - An Application using Pylons, PostgreSQL, Simpycity and Exceptable (20)

Vertically Challenged
Vertically ChallengedVertically Challenged
Vertically Challenged
 
Exceptable
ExceptableExceptable
Exceptable
 
Lowering IT Costs with a Standards-based Platform for Web 2.0 Initiatives: A...
Lowering IT Costs with a Standards-based Platform for Web 2.0 Initiatives:  A...Lowering IT Costs with a Standards-based Platform for Web 2.0 Initiatives:  A...
Lowering IT Costs with a Standards-based Platform for Web 2.0 Initiatives: A...
 
Webhooks - glue for the web
Webhooks - glue for the webWebhooks - glue for the web
Webhooks - glue for the web
 
Investing in open source hw
Investing in open source hwInvesting in open source hw
Investing in open source hw
 
The Future Of Dm
The Future Of DmThe Future Of Dm
The Future Of Dm
 
Nanite (And An Introduction To Cloud Computing)
Nanite (And An Introduction To Cloud Computing)Nanite (And An Introduction To Cloud Computing)
Nanite (And An Introduction To Cloud Computing)
 
Open Video And Metadata Presentation
Open Video And Metadata PresentationOpen Video And Metadata Presentation
Open Video And Metadata Presentation
 
Why Architecture Matters
Why Architecture MattersWhy Architecture Matters
Why Architecture Matters
 
Cloudera Desktop
Cloudera DesktopCloudera Desktop
Cloudera Desktop
 
MATI 2009 Conference: CAT Tools
MATI 2009 Conference: CAT ToolsMATI 2009 Conference: CAT Tools
MATI 2009 Conference: CAT Tools
 
Holland Exibition Promotion
Holland Exibition PromotionHolland Exibition Promotion
Holland Exibition Promotion
 
Don Schwarz App Engine Talk
Don Schwarz App Engine TalkDon Schwarz App Engine Talk
Don Schwarz App Engine Talk
 
Content Management Selection and Strategy
Content Management Selection and StrategyContent Management Selection and Strategy
Content Management Selection and Strategy
 
Ibuildings Cms Talk
Ibuildings Cms TalkIbuildings Cms Talk
Ibuildings Cms Talk
 
Why Web Projects Fail
Why Web Projects FailWhy Web Projects Fail
Why Web Projects Fail
 
Joi's talk at the QRCE
Joi's talk at the QRCEJoi's talk at the QRCE
Joi's talk at the QRCE
 
Spring Integration
Spring IntegrationSpring Integration
Spring Integration
 
Rabo Ridderkerk
Rabo RidderkerkRabo Ridderkerk
Rabo Ridderkerk
 
Vincent Everts @rabobank RMIJ
Vincent Everts @rabobank RMIJVincent Everts @rabobank RMIJ
Vincent Everts @rabobank RMIJ
 

Mehr von Command Prompt., Inc

Replication using PostgreSQL Replicator
Replication using PostgreSQL ReplicatorReplication using PostgreSQL Replicator
Replication using PostgreSQL ReplicatorCommand Prompt., Inc
 
Python utilities for data presentation
Python utilities for data presentationPython utilities for data presentation
Python utilities for data presentationCommand Prompt., Inc
 
Elephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksElephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksCommand Prompt., Inc
 
Normalization: A Workshop for Everybody Pt. 2
Normalization: A Workshop for Everybody Pt. 2Normalization: A Workshop for Everybody Pt. 2
Normalization: A Workshop for Everybody Pt. 2Command Prompt., Inc
 
Normalization: A Workshop for Everybody Pt. 1
Normalization: A Workshop for Everybody Pt. 1Normalization: A Workshop for Everybody Pt. 1
Normalization: A Workshop for Everybody Pt. 1Command Prompt., Inc
 
Integrating PostGIS in Web Applications
Integrating PostGIS in Web ApplicationsIntegrating PostGIS in Web Applications
Integrating PostGIS in Web ApplicationsCommand Prompt., Inc
 
Postgres for MySQL (and other database) people
Postgres for MySQL (and other database) peoplePostgres for MySQL (and other database) people
Postgres for MySQL (and other database) peopleCommand Prompt., Inc
 
Building Grails applications with PostgreSQL
Building Grails applications with PostgreSQLBuilding Grails applications with PostgreSQL
Building Grails applications with PostgreSQLCommand Prompt., Inc
 
Not Just UNIQUE: Exclusion Constraints
Not Just UNIQUE: Exclusion ConstraintsNot Just UNIQUE: Exclusion Constraints
Not Just UNIQUE: Exclusion ConstraintsCommand Prompt., Inc
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLCommand Prompt., Inc
 

Mehr von Command Prompt., Inc (16)

Temporal Data
Temporal DataTemporal Data
Temporal Data
 
Replication using PostgreSQL Replicator
Replication using PostgreSQL ReplicatorReplication using PostgreSQL Replicator
Replication using PostgreSQL Replicator
 
Python utilities for data presentation
Python utilities for data presentationPython utilities for data presentation
Python utilities for data presentation
 
Elephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksElephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forks
 
A Practical Multi-Tenant Cluster
A Practical Multi-Tenant ClusterA Practical Multi-Tenant Cluster
A Practical Multi-Tenant Cluster
 
Normalization: A Workshop for Everybody Pt. 2
Normalization: A Workshop for Everybody Pt. 2Normalization: A Workshop for Everybody Pt. 2
Normalization: A Workshop for Everybody Pt. 2
 
Normalization: A Workshop for Everybody Pt. 1
Normalization: A Workshop for Everybody Pt. 1Normalization: A Workshop for Everybody Pt. 1
Normalization: A Workshop for Everybody Pt. 1
 
Integrating PostGIS in Web Applications
Integrating PostGIS in Web ApplicationsIntegrating PostGIS in Web Applications
Integrating PostGIS in Web Applications
 
Postgres for MySQL (and other database) people
Postgres for MySQL (and other database) peoplePostgres for MySQL (and other database) people
Postgres for MySQL (and other database) people
 
Building Grails applications with PostgreSQL
Building Grails applications with PostgreSQLBuilding Grails applications with PostgreSQL
Building Grails applications with PostgreSQL
 
Pg amqp
Pg amqpPg amqp
Pg amqp
 
Not Just UNIQUE: Exclusion Constraints
Not Just UNIQUE: Exclusion ConstraintsNot Just UNIQUE: Exclusion Constraints
Not Just UNIQUE: Exclusion Constraints
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
Database Hardware Benchmarking
Database Hardware BenchmarkingDatabase Hardware Benchmarking
Database Hardware Benchmarking
 
Vertically Challenged
Vertically ChallengedVertically Challenged
Vertically Challenged
 
Simpycity and Exceptable
Simpycity and ExceptableSimpycity and Exceptable
Simpycity and Exceptable
 

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

  • 1. HOWDAH A tutorial Tuesday, October 20, 2009
  • 2. 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
  • 3. What shall we build? Today, we’ll be talking about designing and implementing a Wiki. 3 Tuesday, October 20, 2009
  • 4. Why a Wiki? Canonical example Simple enough to define in an afternoon Complex enough to require in-depth exploration 4 Tuesday, October 20, 2009
  • 5. Why a Wiki? Public and Private permissions/users Read/write collaborative model 5 Tuesday, October 20, 2009
  • 6. 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
  • 7. STEP 1: DESIGN 7 Tuesday, October 20, 2009
  • 8. Database What do we need? 8 Tuesday, October 20, 2009
  • 9. Application What do we need? 9 Tuesday, October 20, 2009
  • 10. Application What do we need? Anything else? Did we miss anything? 10 Tuesday, October 20, 2009
  • 11. STEP 2: REVISIT 11 Tuesday, October 20, 2009
  • 12. Database Based on our Application design, what expansions do we need? 12 Tuesday, October 20, 2009
  • 13. Database Based on our Application design, what expansions do we need? Why do we need them? 13 Tuesday, October 20, 2009
  • 14. Application With the new DB features, what changes? 14 Tuesday, October 20, 2009
  • 15. Application With the new DB features, what changes? What new ideas are evident? 15 Tuesday, October 20, 2009
  • 16. Application With the new DB features, what changes? What new ideas are evident? Do the changes make things easier? 16 Tuesday, October 20, 2009
  • 17. STEP 3: API CONTRACTS 17 Tuesday, October 20, 2009
  • 18. Database Defining our API What stored procedures do we need? 18 Tuesday, October 20, 2009
  • 19. Database Defining our API What stored procedures do we need? What should they do? 19 Tuesday, October 20, 2009
  • 20. Database Defining our API What exceptions do we need? 20 Tuesday, October 20, 2009
  • 21. Database Defining our API What exceptions do we need? Null data Bad data No such record 21 Tuesday, October 20, 2009
  • 22. Application Defining our API What models do we need? 22 Tuesday, October 20, 2009
  • 23. Application Defining our API What exceptions do we need? 23 Tuesday, October 20, 2009
  • 24. 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
  • 25. Application Defining our API What views do we need? 25 Tuesday, October 20, 2009
  • 26. Application Defining our API What views do we need? What views are read-only? Read-write? Write-only? 26 Tuesday, October 20, 2009
  • 27. STEP 4: FIRST EXPANSION USERS 27 Tuesday, October 20, 2009
  • 28. Database Users User system! 28 Tuesday, October 20, 2009
  • 29. Database Users User system! VerticallyChallenged for users 29 Tuesday, October 20, 2009
  • 30. Database Users User system! VerticallyChallenged for users How to set up VC 30 Tuesday, October 20, 2009
  • 31. Database Users Stored Procedures - How do we adapt them? How does this affect our API contract? 31 Tuesday, October 20, 2009
  • 32. Application Users Using @needs to define permissions How should views be protected? 32 Tuesday, October 20, 2009
  • 33. Application Users Using @needs to define permissions How should views be protected? Should anonymous users have write permission? 33 Tuesday, October 20, 2009
  • 34. 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
  • 35. Application Users Why - Are there better mechanisms? 35 Tuesday, October 20, 2009
  • 36. STEP 5: ADMINISTRATIVE USERS 36 Tuesday, October 20, 2009
  • 37. Database Administrators What delineates an admin? What special things can an admin do? Should admins be otherwise normal users? 37 Tuesday, October 20, 2009
  • 38. Database Administrators Root-level permissions: Should the database superuser ever be allowed to log in from the web app? 38 Tuesday, October 20, 2009
  • 39. 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
  • 40. Application Administrators What delineates an Admin? 40 Tuesday, October 20, 2009
  • 41. 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
  • 42. Application Administrators Should administrators be able to view everything? 42 Tuesday, October 20, 2009
  • 43. Application Administrators Should administrators be able to view everything? What about privileged information? HIPAA, lawyer confidentiality 43 Tuesday, October 20, 2009
  • 44. 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
  • 45. STEP 6: A NEW FEATURE 45 Tuesday, October 20, 2009
  • 46. A New Feature Let’s add a user profile page Specifically list the pages that a user has edited 46 Tuesday, October 20, 2009
  • 47. Database A New Feature Design first! 47 Tuesday, October 20, 2009
  • 48. 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
  • 49. Application A New Feature What does the app need to support this? 49 Tuesday, October 20, 2009
  • 50. Application A New Feature What does the app need to support this? What views do we need? 50 Tuesday, October 20, 2009
  • 51. 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
  • 52. Application A New Feature What about security and data confidentiality? What security issues could be present? 52 Tuesday, October 20, 2009
  • 53. 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
  • 54. 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