In-Memory Store Refactoring #371
Replies: 5 comments 4 replies
-
I have a question about the "persistence interface", is possibile to have an example? |
Beta Was this translation helpful? Give feedback.
-
While I like the idea of having an in-memory storage "by default", there are a few false assumptions and problematic statements in this proposal. These are:
Tests are not what they are intended for. Tests should always use mocks/stubs.
Using an external storage only requires the extension in which that external storage api is implemented.
Even if we used something like a generic (as in Java Generics) storage, we would still have to define at least a marker class, otherwise
Why are they hard to integrate now? You add one extension, provide the necessary config values and you're done.
It doesn't. Please give an example, where access logic spreads over >1 extension, except maybe for abstraction layers like the
No it would not, because different storage systems will still have to be implemented differently.
I agree that a generic CRUD API might be convenient, and we might even get away with that as a basis, but neither will it be sufficient nor can we guarantee that the same implementation will fit all needs (e.g. save() vs create()+update()). So modifications, overrides and such will be necessary. At which point we can re-evaluate whether that API was necessary in the first place.
We have that. It's called The core idea of this proposal, i.e. to unify and harmonize storage interfaces, is a good one and we should strive toward it, at least for rather trivial cases like CRUD operations. We need to be very careful not to stick to a pattern simply for pattern's sake. Further, I agree that in-memory storages can be generalized, since most of them are Java Maps in one form or the other anyways and that those in-mem impls should be the "default". I strongly disagree with the notion to have one in-memory extension that provides all in-mem-impls. That goes against the way we decided So here's my counter-proposal: why not have all features (such as the |
Beta Was this translation helpful? Give feedback.
-
They have different interfaces, different methods. There can be a unified persistence layer though, which is the
So if I understand correctly the
nope - makes one extension, the
And probably one in all the other *DbPersistenceClasses, right? Assuming we have those ofc.
OK, might have inferred from previous discussions. Do I understand correctly that you want to separate persistence into two things, a "service" and a "repository", the former would contain business logic and the latter the actual persistence operations? |
Beta Was this translation helpful? Give feedback.
-
I will just continue the discussion by highlighting things where the suggested abstraction layer would have helped. Consistency@MikhailGordienk Created a discussion #387 that there is no possibility to remove data. If the functionality would be added now there is a possibility that it may not be implemented for all kind of storage systems.
DuplicationsAnother Issue is there with my own pull-requests, that implement different kind of storage interface extensions for PostgresSQL (AssetIndex, ContractDefinitionStore, AssetLoader, etc.). Dominik Pinsel [email protected], Daimler TSS GmbH, legal info/Impressum |
Beta Was this translation helpful? Give feedback.
-
These are two distinct problems:
Lets not mix up those two, and lets also be careful to copy other DAO/persistence implementations simply because of familiarity. The CosmosDbApi solves all of the aforementioned problems like configuration, so we should use that as a starting point. If we find it lacking, we can always improve. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As discussed here the proposal to refactor the in-memory store implementations.
In Memory Store Refactoring
At the time of writing we have 9 different in-memory store extensions.
Assumed issues
Why is this an improvement
Proposal
Please Note
Dominik Pinsel [email protected], Daimler TSS GmbH, legal info/Impressum
Beta Was this translation helpful? Give feedback.
All reactions