Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Talk:SMILA/Component Requirements/Record Binary Storage Requirements

Nameing

Tom: I wouldnt use the smila specific 'record' and 'attachment' name parts because in/out arguments are generic.

Juergen.schumacher.empolis.com Yes, indeed. There is nothing record-specific in the arguments so we do not need to talk about records and attachments.

Igor.novakovic.empolis.com Well if you take a closer look at the page name, you'll see that page actually defines the _record_ binary storage requirements ;-) So here we are talking about the record-centric binary storage. The reason why I proposed to "tie" this concept to record is quite simple: We have to take care that our project concepts are not only technically sophisticated but also "user friendly" and easy to understand. IMO this can be achived by:

  1. Having a simple story behind SMILA: SMILA operates on (un)structured data. This data is internally encapsulated in Objects that we call records. The Records are passed from one service to another and can themselves contain (very) large amount of information (e.g. one record can represent the whole book). To be able to swiftly share this information between BPEL services we introduced the blackboard service which is actually the only client to low-level services like record binary and XML storage.
  2. Having self-explaining method names.
  3. Avoiding the "generic bug". By introducing services that are too general (i.e. can serve multiple different clients) you can confuse the person that is using them and also make them harder to implement than really needed.

Tom:

  1. Simplicity of use for users is IMHO a non-argument because as u pointed out, the Blackboard is the one and only user currently. And since the Blackboard is an internal building block i suppose we should be able to handle that generic interface.
  2. Furthermore I can quite well see that plug-ins by others may want to use an infrastructure block such as the BinStore and hence a record-centric naming is rather misleading in that case then.

Juergen.schumacher.empolis.com I'm not satisfied with this, too. I think a service is not becoming specific for something by making the method names say so, but by the semantics of the signature. By using Strings as IDs and byte[]/Stream for data you already are as generic as you can get for a binary storage. But then the method name says "no, this is only for record attachments". That's strange to me. In no time there will be some other service that would like to store a Blob that is not a record attachment and then it will either misuse this service or duplicate it. If you want to have a record specific binary storage service, you should use Record IDs + Attachment names in the signature so that the service hides the calculation of "physical" blob IDs from the blackboard service. That would be OK to me. But then, I would still like to seperate the "physical storage" layer (that one that cares about storing and retrieving Blobs with String IDs) from the "record attachment storage" layer to make the physical layer exchangeable. Having said that, the physical layer does not necessarily have to be created by us, but maybe like the Eclipse File System ([EFS], [1]) would be sufficient, too (as a side node, there are ideas to create an EFS provider for Hadoop DFS [2], so we would have a DFS version of binary storage quite easily).

Namespaces

Juergen.schumacher.empolis.com I wonder if it would make sense to add another parameter to be able to ensure that different clients that use BinStorage for difference purposes do not have ID collisions. Otherwise one client would overwrite the BLOB of another client by accidentally using the same ID. So we could have:

void store(String namespace, String id, InputStream stream);
void store(String namespace, String id, byte[] blob)
byte[] fetchAsByte(String namespace, String id)
InputStream fetchAsStream(String namespace, String id)
void remove(String namespace, String id)
int fetchSize(String namespace, String id)

Igor.novakovic.empolis.com IMO there is no need to introduce namespace since we in fact only have one client - the blackboard service.

Juergen.schumacher.empolis.com Alternatively we could require that IDs are not unstructured strings but something like "URIs" (maybe even javax.xml.namespace.QName instead of java.lang.String?)

Igor.novakovic.empolis.com I would leave (like in current implementation) IDs being generated by the blackboard service as strings that are calculated like this id = hash(record.id + attachmentName)

Tom:

> namespace parameter

I had that different in mind, namely when requesting the service, the client would pass in that info. that way we could have diff. BinStoreService instances and the client wouldnt have to pass in that info each time.

Juergen.schumacher.empolis.com Ok. I suppose, creating one BinStorage service per "namespace" would be fine, too. So the API could be:

void store(String id, InputStream stream);
void store(String id, byte[] blob)
byte[] fetchAsByte(String id)
InputStream fetchAsStream(String id)
void remove(String id)
int fetchSize(String id)

Igor.novakovic.empolis.com Here we have it - the "generic bug". Not only that the client needs to know which particular implementation of the binary storage he wants to contact to, but he also needs to know which instance has been properly configured for him.

User:T.menzel.brox.de This is intended to be a matter of configuration! Hence the client doesn’t need to know it, only the admin who configures it – iff he wants to or needs smth. else than the default config.

From Georg I have received the feature request to have a means to be able partition both storages. Introducing namespaces was an idea from J:urgen and I think it is a valid one. My suggestion was to not have a parameter in the methods but handle that on instance level, which was already in my mind but never voiced this before as it wasn’t a concern up to now. Rational, if we handle namespaces at the beginning, i.e. when requesting the service, we can introduce this feature later when we have need for it as it would just be another overloaded method that allows passing in certain configurations.

In order to have a properly designed API it is better to think now about current and possible future needs and to take proper measures. IMO this is a lot better than discovering later: "Hm, could and should have seen that before.", and therefore it is in no way a "generic bug". This is particularly true with eclipse and their police to have non breaking APIs.

Different instances

> 6. The client component must use different instances of the binary store fully transparently

@Igor: could you make this requirement more precise?

Igor.novakovic.empolis.com This means, that the client must not know anything about the implementation details of the record binary storage service (e.g. if binary storage stores data in a file system or into a DB).

User:T.menzel.brox.de OK. That part is a given to me. My question targeted more in the direction of "different instances ". Do u mean by this multiple instances of the BinStore running concurrently (leaving the case and its needs for clustering aside) or just diff. instantiations at diff. times? I suppose from your answers/comments the latter, right?

Back to the top