Present and Future of dol #35
Replies: 3 comments 2 replies
-
@valentin-feron Thank you very much for putting this together! It's great to have this kind of material that summarizes the ins and outs of such tools. As a recent "user" (as opposed to "developer") of this tool, I can definitely relate to some of the points you developed above. Here's a couple of examples:
I know that's a lot of questions, but I told myself this was the ideal place to put them when I read your post! |
Beta Was this translation helpful? Give feedback.
-
Thanks for this description. I few notes:
|
Beta Was this translation helpful? Give feedback.
-
I'll try to accumulate a few links to previous work that is worth reading before making any Others
Ours |
Beta Was this translation helpful? Give feedback.
-
A general discussion to describe the actual state of dol, but also to align on its goal and fundamentals.
Definition
As described in the README file,
dol
is a set of "tools to make your interface with data be domain-oriented, simple, and isolated from the underlying data infrastructure".What does that mean?
Domain-oriented
The tool adapts to the context it is applied to, meaning that it provides objects that can deal with a specific domain model.
Simple
The interface is intuitive and normalized.
dol
uses the python built-in interface for Mappings (key/value) for CRUD operations with data.Isolated from the underlying data infrastructure
dol
totally hide the storage logic and infrastructure, making the interface the same regardless how and where the data is storedState of the Art
So far, we have a bunch of concrete
dol
solutions. However, 2 groups stand out:Examples: file stores, s3dol, azuredol. They all organize nested data using paths that can be used in a flatten way so any child element is reachable from any node, regardless the number of intermediary nodes between them.
Examples: mongodol, sqldol. They interact with DBMS.
Now, are the 3 main principles well followed?
Simple and Normalized
This principle has been our main concern. We've tried to stick to the python built-in Mapping interface. But sometimes, it is hard to keep the train on rails when the underlying technology's interface differs too much from the key-value one, or when it provides more complex features that are beyond the
Mapping
interface.The most relevant example would be mongodol (even if I think sqldol would have been an even better example if it were more developed and used in production, because of relational db). MongoDB provides a bunch of extra features (like distinct, aggregators, etc.) that can hardly be wrapped by a
Mapping
object. Furthermore, the implementations provided by MongoDB for those features are close to the metal, meaning that they are optimized, so we want to use them. Sometimes, it is hard to call native features without breaking theMapping
interface.Examples:
The second example seems to be an easier way to hook into the native features of the underlying technology, but, by bypassing the
Mapping
interface, we also lose in normalization and we depend more on the interface of the tech (that we want to be isolated from in the first place).We also have a hard time normalizing the different levels of a nested store sturcture, because the underlying objects manipulated are often very different in their nature.
Even if those objects are stores, they don't share a common behavior.
Domain-Oriented and Isolated from the Underlying Data Infrastructure
I put them together because they are strongly related with each other. Indeed, the closer the interface is to the domain, the further it is from the underlying technology.
We have a bunch of tools that allow us to wrap the
Mapping
interface so it becomes domain-oriented. The main tool is definitelywrap_kvs
, which enables us to add key and value transformers to a mapping:However, most of the usage we have of the stores are still very close to the underlying technology. A first example is the one we described above, with using native features by passing extra parameters to the store constructor. Another example is that we often have a 1:1 relationship between store instances and targets (or N:1, but rarely 1:N, which would be more domain-oriented)
Evolution
The main purpose of
dol
is to make the user forget about how and where the data is stored, being able to CRUD data in a domain-oriented way.Composite tree of stores
The user should be able to do the following, regardless the type and the number of storage target for the store and regardless which level it is applied to:
Consistency between concrete
dol
solutionsWe must ensure interface and behavior consistency between the different concrete
dol
solutions. For instance, in azuredol, if a store is instantiated from a container name but the container does not exist, the container will be created during the store instantiation. On the other hand, in s3dol, the bucket (s3-equivalent to azure storage container) is created when setting the first key-value, not during store instantiation. This is just an example, all ourdol
solutions differ in term of interface and behavior at some point. We need to fix that, so the user can really forget about what kind of store he's using.Add your proposals in comments!
Beta Was this translation helpful? Give feedback.
All reactions