jankotek / jankotek/mapdb

MapDB should provide provide a mechanism to easily switch between different Configurations

Open
#893 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

4.0 document
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.