concrete architecture of postgresql

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: charis

Post on 26-Feb-2016

61 views

Category:

Documents


2 download

DESCRIPTION

Concrete Architecture of PostgreSQL. S-Queue-L Khurrum A Mujeeb, Adam Abu Hijleh, Adam Ali Stephen McDonald, Wisam Zaghal. CISC 322 - Fall 2010. Overview. Derivation Process Conceptual Architecture Revisited High Level Conceptual Dependencies - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Concrete  Architecture of  PostgreSQL

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 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

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

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

Conceptual Architecture Revisited - Layered

Legend

Expected

Dependency

Figure 2

Page 6: Concrete  Architecture of  PostgreSQL

Expected Subsystem Interdependencies

ExpectedSubsystem Interdependency

Legend

Figure 3

Page 7: Concrete  Architecture of  PostgreSQL

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

Unexpected Subsystem Interdependencies

ExpectedSubsystem Interdependency

Legend

UnexpectedSubsystem Interdependency

Figure 5

Page 9: Concrete  Architecture of  PostgreSQL

Legend

Expected

Dependency

Unexpected

Dependency

Figure 6

Unexpected Subsystem Interdependencies

Page 10: Concrete  Architecture of  PostgreSQL

pl

test

tutorial

include

tools

snowball

tsearch

regex

port

foreign

bin

Miscellaneous

Page 11: Concrete  Architecture of  PostgreSQL

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 ManagerClient Comm. DependencyStorage Manager

Utility Component

Subsystems

Figure 7

Page 12: Concrete  Architecture of  PostgreSQL

Catalog

GeneralUtils

Nodes/List

Access

Utility Intra-Subsystem Dependencies

Unexpected Dependencies Utility component

Figure 8

Page 13: Concrete  Architecture of  PostgreSQL

Backend Utilities

Time zone Library Numeric.c

Unexpected Dependencies Utility component

General Utilities Intra-Subsystem Dependency

Figure 9

Page 14: Concrete  Architecture of  PostgreSQL

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

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

High Level Conceptual Remodeling – Object Oriented

Figure 11

NewExpected Dependencies Subsystem

Page 17: Concrete  Architecture of  PostgreSQL

ClientLibrary Interfac

eServer Parser

StageRewrite

rPlanner/

OptimizerExecuto

r

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

Catalog GeneralUtilities 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 backCurrent execution state of the query

Executed Query Returned

Legend:

Components

Data Flow

Function Call

Duration ofrunning component

User

Figure 12

Page 18: Concrete  Architecture of  PostgreSQL

Concurrency &Team IssuesTeam 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

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

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

Conclusions– All components were much more intertwined than originally

suspected

– Importance of reflexion analysis

– We now believe the architecture to be Object-Orientated