13 monolithic

Upload: rizi-razzak

Post on 06-Oct-2015

19 views

Category:

Documents


0 download

DESCRIPTION

IT

TRANSCRIPT

  • Systems ArchitectureMonolithic Systems

    CSC407

  • Monolithic Systemsno architecturestatic datadynamic dataimported datareports

    CSC407

  • ExamplesMost programs you deal with day-to-dayword processingspreadsheetspowerpointe-mail (?)inexpensive accounting packagesdevelopment environmentscompilersmost games(not Combat Flight Simulator)Large, corporate batch systemspayrollreportsDescartes route planning

    CSC407

  • CharacteristicsUsually written in a single programming language.Everything compiled and linked into a single (monolithic) applicationas large as 1 MLOC C++as large as 100M loaded executableas large as 2G virtual memoryMay operate in bothbatch modeGUI modeDataload into memorywrite all back on explicit saveNo simultaneous data sharingMay have concurrencymulti-threadingmulti-processing (but only one executable)

    CSC407

  • Concurrencymulti-threading

    shared memoryshared system resourcessingle or multi-cpu1 source code

    CSC407

  • Concurrencysymmetric multi-processing1 source code

    CSC407

  • Concurrencydistributed processingmany source codes

    CSC407

  • ConcurrencyWhy multi-threading?performance (when you have access to multiple CPUs)A design philosophy for dealing with asynchronous eventsinterruptsGUI eventscommunications eventsMaintain livenesscan continue to interact with user despite time-consuming operationse.g., SMIT running manperformancepre-load, network initializationsmulti-tasking (lets the user do many tasks at once)e.g., downloads from the netYou WILL have to multi-thread your programstart early in the design process

    CSC407

  • ConcurrencyWhy symmetric multi-processing?you need parallelismperformancelivenessa program is not written to be multi-threadedtemporarily modifying shared datafork cost is inexpensive relative to amount of work to be done by slavesfork typically implemented with COWTricks:special allocators to group modifiable shared data to contiguous memoryUsing memory management hardware to switch volatile data based on thread

    CSC407

  • Monolithic ArchitectureA monolithic system is therefore characterized by1 source code1 program generatedbut may contain concurrency

    CSC407

  • DataIn a monolithic architecturedata is read into application memorydata is manipulatedreports may be outputdata may be saved back to the same source or different

    Multi-user access is not possible

    CSC407

  • Multi-User AccessCan changes by one user be seen by another user?not if each copy of the application reads the data into memoryonly sequential access is possibleshared data

    CSC407

  • Multi-User AccessAllowing multiple users to access and update volatile data simultaneously is difficult.Big extra costrequire relational database expertiseMore on this later.

    CSC407

  • Advantagesperformanceaccessing all datadisk is disk!eitherread data more directly from the disk via file systemhighly optimizedcaching and pre-fetching built-inread data less directly from the disk via layers of intervening software (e.g., RDBMS, OODBMS, distributed data server).modifying datain-memory is massively quickercaching is not an option for shared data systemsdelays while committing changes to a recordNo IPC overheadsimplicityless code to writefewer issues to deal withlocking, transactions, integrity, performance, geographic distribution

    CSC407

  • DisadvantagesLack of support for shared accessforces one-at-a-time accessmitigate:allowing datasets that merge multiple fileshybrid approachcomplex monolithic analysis softwaresimple data client/server update softwareQuantity of datawhen quantity of data is too large to load into memorytoo much time to loadtoo much virtual memory usedDepending on which is possiblesequential access (lock db or shadow db)selective access

    CSC407

  • Red HerringMonolithic systems are less modular

    CSC407

  • Red HerringThe code for distributed systems will need to share common objects.This module organization could be terrible.

    CSC407

  • Red Herring (sort of)Distributed systems require architects to define and maintain interfaces between componentscannot do anything without thiseven for RDBMS systemsrelational schema + stored procedures define an important interfaceby default: nothing is visiblemust work to expose interfaceFor monolithic systems, this is optionalbecause there are no process boundaries, any tiny component can depend on (use, invoke, instantiate) any other in the entire monolithic system. e.g.,extern void a_routine_I_should_not_call(int a, int b);default: everything is visiblemust work to hide non-interface

    CSC407

  • Module StructureTo preserve the architectural integrity of a monolithic system, we must work to define and maintain (typically) extra-linguistic sub-system boundaries.recall faade pattern

    CSC407

  • Library Structure

    CSC407

  • Library Structure in C/C++Decidehow many libraries to havetheir nameswhich subsystems go into which librarieswise to align library structure with a subsystemnot necessary to do soe.g., could be a base level of utilities that rarely change whose TUs belong to unrelated subsystems (stretching it).rationaleWhy?reduce compilation dependenciescan be changing a bunch of .cs and .hs and others can keep using the librarybut dont change any.hs exported beyond the librarypoor mans configuration management systemoften most practicalReduces link time (libraries often pre-linked)Shipping librariesCommon library supports many apps

    CSC407