DOC PREVIEW
UMD CMSC 424 - Database Design

This preview shows page 1-2-3-4-5-38-39-40-41-42-43-77-78-79-80-81 out of 81 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 81 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1DatabasesOutlineStorage HierarchyStorage HierarchyStorage HierarchyStorage HierarchyStorage HierarchyJim Gray’s Storage Latency Analogy: How Far Away is the Data?Storage…OutlineSlide 12Slide 13Slide 14Slide 15Slide 16Slide 17Accessing DataReliabilityDisk ControllerOptimizing block accessesOutlineRAIDRAID LevelsRAID LevelsRAID Level 5RAID Level 5Choosing a RAID levelOutlineBuffer ManagerBuffer ManagerBuffer ManagerOutlineFile OrganizationFile OrganizationFixed Length RecordsVariable-length RecordsFile OrganizationSequential File OrganizationSequential File OrganizationOutlineIndexOrdered IndexesPrimary Sparse IndexSecondary IndexMulti-level IndexesMulti-level IndexesOutlineExample B+-Tree IndexB+-Tree Node StructureProperties of B+-TreesExample B+-Tree IndexPropertiesExample B+-Tree IndexB+-Trees - SearchingTuple InsertionTuple InsertionB+-Trees: InsertionUpdates on B+-Trees: DeletionExamples of B+-Tree DeletionExamples of B+-Tree DeletionExample of B+-tree DeletionAnother B+Tree Insertion ExampleAnother Example: INSERT (125)Another Example: INSERT (125)Another Example: INSERT (125)Another Example: INSERT (125)Another Example: INSERT (125)B+ Trees in PracticeB+ Trees: SummaryMore…Secondary IndexB+-Tree File OrganizationB-TreeHash-based File OrganizationSlide 76Hash IndexesHash IndexesGrid FilesR-TreesConclusionsCMSC424: Database DesignInstructor: Amol Deshpande [email protected]Data ModelsConceptual representation of the dataData RetrievalHow to ask questions of the databaseHow to answer those questionsData StorageHow/where to store data, how to access itData IntegrityManage crashes, concurrencyManage semantic inconsistenciesDatabasesOutlineStorage hierarchyDisksRAIDFile OrganizationEtc….Storage HierarchyTradeoffs between speed and cost of accessVolatile vs nonvolatileVolatile: Loses contents when power switched offSequential vs random accessSequential: read the data contiguouslyRandom: read the data from anywhere at any timeStorage HierarchyStorage HierarchyCache Super fast; volatileTypically on chipL1 vs L2 vs L3 caches ???Huge L3 caches available now-a-daysBecoming more and more important to care about thisCache misses are expensiveSimilar tradeoffs as were seen between main memory and disksCache-coherency ??Storage HierarchyMain memory 10s or 100s of ns; volatilePretty cheap and dropping: 1GByte < 100$Main memory databases feasible now-a-daysFlash memory (EEPROM)Limited number of write/erase cyclesNon-volatile, slower than main memory (especially writes)Examples ?QuestionHow does what we discuss next change if we use flash memory only ?Key issue: Random access as cheap as sequential accessStorage HierarchyMagnetic Disk (Hard Drive)Non-volatileSequential access much much faster than random accessDiscuss in more detail laterOptical Storage - CDs/DVDs; JukeboxesUsed more as backups… Why ?Very slow to write (if possible at all)Tape storage Backups; super-cheap; painful to accessIBM just released a secure tape drive storage solutionJim Gray’s Storage Latency Analogy: How Far Away is the Data?RegistersOn Chip CacheOn Board CacheMemory Disk1210100Tape /Optical Robot109106SacramentoThis HotelThis RoomMy Head10 min1.5 hr2 Years1 minPluto2,000 YearsAndromedaStorage…Primarye.g. Main memory, cache; typically volatile, fastSecondarye.g. Disks; non-volatileTertiarye.g. Tapes; Non-volatile, super cheap, slowOutlineStorage hierarchyDisksRAIDFile OrganizationEtc….1956IBM RAMAC24” platters100,000 characters each5 million characters1979SEAGATE5MB1998SEAGATE47GB2004Hitachi400GBHeight (mm): 25.4. Width (mm): 101.6. Depth (mm): 146. Weight (max. g): 700 2006Western Digital500GBWeight (max. g): 600gLatest: Single hard drive: Seagate Barracuda 7200.10 SATA 750 GB 7200 rpm weight: 720g Uses “perpendicular recording”Microdrives IBM 1 GBToshiba 80GB“Typical” ValuesDiameter: 1 inch  15 inchesCylinders: 100  2000Surfaces: 1 or 2(Tracks/cyl) 2 (floppies)  30Sector Size: 512B  50KCapacity: 360 KB (old floppy) 300 GBAccessing DataAccessing a sectorTime to seek to the track (seek time)average 4 to 10ms+ Waiting for the sector to get under the head (rotational latency)average 4 to 11ms+ Time to transfer the data (transfer time)very lowAbout 10ms per accessSo if randomly accessed blocks, can only do 100 block transfers100 x 512bytes = 50 KB/sData transfer ratesRate at which data can be transferred (w/o any seeks)30-50MB/s (Compare to above)Seeks are bad !ReliabilityMean time to/between failure (MTTF/MTBF):57 to 136 yearsConsider:1000 new disks1,200,000 hours of MTTF eachOn average, one will fail 1200 hours = 50 days !Disk ControllerInterface between the disk and the CPUAccepts the commandschecksums to verify correctnessRemaps bad sectorsOptimizing block accessesTypically sectors too smallBlock: A contiguous sequence of sectors512 bytes to several KbytesAll data transfers done in units of blocksScheduling of block access requests ?Considerations: performance and fairnessElevator algorithmOutlineStorage hierarchyDisksRAIDFile OrganizationEtc….RAIDRedundant array of independent disksGoal:Disks are very cheapFailures are very costlyUse “extra” disks to ensure reliabilityIf one disk goes down, the data still survivesAlso allows faster access to dataMany raid “levels”Different reliability and performance propertiesRAID Levels(b) Make a copy of the disks. If one disk goes down, we have a copy. Reads: Can go to either disk, so higher data rate possible. Writes: Need to write to both disks.(a) No redundancy.RAID Levels(c) Memory-style Error CorrectingKeep extra bits around so we can reconstruct. Superceeded by below.(d) One disk contains “parity” for the main data disks.Can handle a single disk failure.Little overhead (only 25% in the above case).RAID Level 5Distributed parity “blocks” instead of bitsSubsumes Level 4Normal operation:“Read” directly from the disk. Uses all 5 disks“Write”: Need to read and update the parity blockTo update 9 to 9’read 9 and P2compute P2’ = P2 xor 9 xor 9’write 9’ and P2’RAID Level 5Failure operation (disk 3 has failed)“Read block


View Full Document

UMD CMSC 424 - Database Design

Documents in this Course
Lecture 2

Lecture 2

36 pages

Databases

Databases

44 pages

Load more
Download Database Design
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Database Design and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Database Design 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?