concrete architecture of postgresql. overview – derivation process – conceptual architecture...

21
Concrete Architecture of PostgreSQL S-Queue-L Khurrum A Mujeeb, Adam Abu Hijleh, Adam Ali Stephen McDonald, Wisam Zaghal CISC 322 - Fall 2010

Upload: ellen-murphy

Post on 20-Jan-2016

224 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Concrete Architectureof PostgreSQL

S-Queue-LKhurrum A Mujeeb, Adam Abu Hijleh, Adam Ali

Stephen McDonald, Wisam Zaghal

CISC 322 - Fall 2010

Page 2: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Overview– Derivation Process – Conceptual Architecture Revisited– High Level Conceptual Dependencies– High Level Observed Dependencies (Concrete Architecture)

• Expose high level unexpected inter-dependencies

– Utilities• Intradependencies• Interdependencies

– Final Arcihtecture Style & Conceptual Modification– Use Case Revisted– Concurrency & Team Issues– Limitations– Lessons Learned– Conclusion

Page 3: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Derivation Process– Map components to our proposed conceptual architecture

• With aid of OpenGrok online source code browser, Software Landscape Editor, online PostgreSQL Manual, and source code decomposition

– Analysis of dependencies for the now-grouped components, making note of missing & unexpected dependencies

– Investigate gaps between conceptual dependencies & extracted concrete dependencies (Reflextion Analysis)

Page 4: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Propose

Conceptual subsystems

Dependencies between

SubSystems

Mapping source entities to

subsystems

Extracted source dependencies

Conceptual Architecture

Concrete Architecture

Compare

GapsInvestigate

Reflexion Analysis - Conceptual

Figure 1

Page 5: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Conceptual Architecture Revisited - Layered

Legend

Expected

Dependency

Figure 2

Page 6: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Expected Subsystem Interdependencies

ExpectedSubsystem Interdependency

Legend

Figure 3

Page 7: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Propose

Conceptual subsystems

Dependencies between

SubSystems

Mapping source entities to

subsystems

Extracted source dependencies

Conceptual Architecture

Concrete Architecture

Compare

GapsInvestigate

Reflexion Analysis - Concrete

Figure 4

Page 8: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Unexpected Subsystem Interdependencies

ExpectedSubsystem Interdependency

Legend

UnexpectedSubsystem Interdependency

Figure 5

Page 9: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Legend

Expected

Dependency

Unexpected

Dependency

Figure 6

Unexpected Subsystem Interdependencies

Page 10: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

pl

test

tutorial

include

tools

snowball

tsearch

regex

port

foreign

bin

Miscellaneous

Page 11: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Query Processor

Process Manager

Client Communication

Storage Manager

Catalog

GeneralUtils

Nodes/List

Access

Utility Inter-Subsystem Dependencies

Unexpected Dependencies

All External Subsystems Depend on

Expected Dependency

Query Processor dependency

Process Manager

Client Comm. Dependency

Storage Manager

Utility Component

Subsystems

Figure 7

Page 12: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Catalog

GeneralUtils

Nodes/List

Access

Utility Intra-Subsystem Dependencies

Unexpected Dependencies Utility component

Figure 8

Page 13: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Backend Utilities

Time zone Library Numeric.c

Unexpected Dependencies Utility component

General Utilities Intra-Subsystem Dependency

Figure 9

Page 14: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Propose

Conceptual subsystems

Dependencies between

SubSystems

Mapping source entities to

subsystems

Extracted source dependencies

Conceptual Architecture

Concrete Architecture

Compare

GapsInvestigate

Reflexion Analysis – Investigate Gaps

Figure 10

Page 15: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Architecture Style Revisited

Initially:Layered– Each layer only talks to the layer above or below

Maybe: Minimally layered ?- too much coupling

Now:Object Oriented – Function calls within and across various subsystems

Page 16: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

High Level Conceptual Remodeling – Object Oriented

Figure 11

NewExpected Dependencies Subsystem

Page 17: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

ClientLibrary Interfac

eServer

Parser Stage

Rewriter

Planner/ Optimizer

Executor

StorageManage

r

Request toLog in Request to

Log in

Server and communi-cation channel created

Logged in

QuerySent

QuerySent Query

Sent QuerySent

ExecutedQueryReturned

ExecutedQueryReturned

ExecutedQueryReturned

CatalogGeneralUtilities

Nodes

ServerRequested

Grammar rules and actions looked up

Grammar rules and actions retrieved

Copy node tree function called

Node tree returned

Tree manipulation function called

Manipulated tree returned

Tree comparison function called

Tree manipulation function called

Manipulated tree returned

ParsedTree

ModifiedTree

MostEfficientTree sent Access & Modify

Tree

Semantics lookup

Semantics retrieved

Comparison results returned

Format type function calledSQL format language returned

DataSent back

Current execution state of the queryExecuted Query Returned

Legend:

Components

Data Flow

Function Call

Duration ofrunning component

User

Figure 12

Page 18: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Concurrency &Team Issues

Team Issues- CommitFests

- Review and commit patches if up to par- If not committed, feedback given and changes

made

Concurrency– MVCC

• snapmgr.c (Utils - time)– Snapshot of data

• proc.c (Storage – Lock Manager)– Frees lock associated with current transaction

Page 19: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Limitations– Software Landscape Editor, although powerful, was primitive –

hard to use

– Determining how to map source files in accordance with our conceptual architecture

– Lack of documentation on important code fragments

– Was difficult to conslidate utilities into one shared component, as utilities were scattered throughout the various levels of the system

Page 20: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Lessons Learned

– Best way to understand High Level dependencies is to understand their origins on the lower levels

– Importance of clear and efficient commenting

– Group effort needed at every stage– Divide and Conquer proved to be much more difficult

given the nature of the contain files and Lsedit– Working in pairs of 2 at a time per task proved to be

most effective

Page 21: Concrete Architecture of PostgreSQL. Overview – Derivation Process – Conceptual Architecture Revisited – High Level Conceptual Dependencies – High Level

Conclusions

– All components were much more intertwined than originally suspected

– Importance of reflexion analysis

– We now believe the architecture to be Object-Orientated