MapDB should provide provide a mechanism to easily switch between different Configurations
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 5.1k
- Forks
- 877
- PR merge metrics
- No merged PRs in 30d
Description
Problem: Quickly switch between MapDB Configurations
Very often application developers want to use one Configuration during development (say in memory) and another Configuration in production (say transactions enabled etc). This kind of seamless switching Configuration is difficult with MapDB because the builder pattern is used to create Databases.
Attach files by dragging & dropping, , or pasting from the clipboard. Styling with Markdown is supported
Proposed Solution: A Configuration Interface rather than the Builder Pattern
MapDB should provide a single Configuration interface that captures the options of the DB. A quick sketch (though you might want to fundamentally distinguish between In-Memory Configuration and Persistent Configuration):
public interface DBConfiguration {
public enum StorageMedia {
Memory, Disk
}
public enum Durability {
WriteAheadLog, Periodic
}
public enum FileType {
MemoryMappedFile, FileChannel, RandomAccessFile
}
public Durability getDurability();
public FileType getFileType();
public StorageMedia getStorageMedia();
}
MapDB should also provide a default implementation of this interface, DefaultDBConfiguration, with the appropriate getters and setters.
Finally, a nice to have (though not necessary): the ability to read/write configuration from a properties file ie 'DBConfiguration config = DefaultDBConfiguration.build(Properties)`.
(I figure some might not like this but it's worth a shot. I find myself writing a lot of code to deal with MapDB configuration because I want try out different configurations.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating MapDB’s current builder-based database configuration entry points and reviewing how development and production settings are represented. Compare that design with the proposed DBConfiguration and DefaultDBConfiguration types, including the optional Properties support. Done means the configuration approach is agreed, implemented consistently, and covered by the relevant existing tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100