How to create different types of databases
masterRustbreak provides several database constructors depending on your storage needs:
- FileDatabase: Use
FileDatabase::from_pathfor persistent storage on disk. Note thatPathBackendis the only backend that supports atomic saves. - MemoryDatabase: Use
MemoryDatabase::memoryfor in-memory storage. This is fast but data is lost when the process exits unless saved. - MmapDatabase: Use
MmapDatabase::mmaporMmapDatabase::mmap_with_sizefor memory-mapped files (requires themmapfeature). - Database: Use
Database::from_partsfor custom configurations.