File Allocation (FAP)
- Manages disk space by dividing it into fixed sized blocks or clusters. Uses simple data structures like file allocation table (FAT) to track allocated vs free blocks.
- Files are stored in one or more blocks that can be scattered across the disk. This leads to external fragmentation over time.
- No inherent support for relationships between files or metadata beyond filename and size.
- Simple and low overhead, but inefficient use of space. Internal fragmentation when file size is smaller than block size.
- Difficult to optimize data placement for performance. Related files may be distant on disk.
- Limited crash recovery capabilities. FAT can be corrupted.
Database Allocation (DAP)
- Uses database management system to manage storage space. Space is allocated/deallocated from database files and objects.
- Storage structures like B+ trees are used to efficiently track free and allocated space.
- Data objects like tables and indexes are stored together in database pages, not scattered. Reduces fragmentation.
- Database schema defines rich metadata and relationships between objects. Enables data optimization.
- Storage can be expanded by adding/removing database files. Tables can also span files.
- Page level locking provides concurrency control. Transaction logs enable crash recovery.
- Overhead of database structures and memory caching. But provides efficient use of storage.
- Data can be clustered on disk according to access patterns to improve performance.
- Database queries allow intelligent data access and aggregation.
In summary, DAP leverages mature database techniques like structured storage, metadata management, locking, logging, and caching to provide superior storage utilization and access flexibility compared to simple FAP systems. But requires greater software complexity.