[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Handle-info] [Handle-MongoDB] New attributes?



Thinking about the Tobias' email...


Robert, should I be "worried" about the replication of Handle system using Mongo?.  If I keep the same fields, same Handle Storage principles (based on HandleStorage class) but different CRUD methods to use the database, it is supposed to works well with many servers?.


Best regards.


De: handle-info-bounces@cnri.reston.va.us <handle-info-bounces@cnri.reston.va.us> en nombre de Ruiz-Zafra, Angel <a.ruiz-zafra@ucl.ac.uk>
Enviado: jueves, 5 de enero de 2017 9:53:41
Para: Robert R Tupelo-Schneck
Cc: handle-info@cnri.reston.va.us
Asunto: Re: [Handle-info] [Handle-MongoDB] New attributes?
 

Hello Robert.


Yes, I wrote a custom storage module that implements "HandleStorage" interface and yes, I though the idea to storage a full mongo object (or query) into the "data" field and this is what I'm going to do now that I know that is really difficult (or almost impossible) to support new fields.


Thank you very much!.


Tobias, I'm just focused in the deployment of a single server, so I'm not addressing the replication system using Mongo (so far). 


Best regards to both of you.



De: Robert R Tupelo-Schneck <schneck@cnri.reston.va.us>
Enviado: miércoles, 4 de enero de 2017 19:47:19
Para: Ruiz-Zafra, Angel
Cc: handle-info@cnri.reston.va.us
Asunto: Re: [Handle-info] [Handle-MongoDB] New attributes?
 
If I remember correctly you have written a custom storage module to use MongoDB?  How to structure MongoDB queries will depend on how each handle or handle value is serialized into a MongoDB object.  In principle you could (and should!) certainly do that in such a way to allow access to the various components of the handle values in MongoDB queries.

The binary encoding of a handle value is specified in the Handle RFCs and this limits the ability to add new fields in a way compatible with the Handle protocol.  My strong recommendation would be to have the "data" of a handle value be a structured object---a bit of JSON, probably---which encodes the attributes you want.  You could even write your MongoDB storage module in such a way that it could notice when a handle value's data is JSON (perhaps for certain handle value "types") and "unpackage" it into a form compatible with MongoDB search.

Robert

On Jan 4, 2017, at 7:15 AM, Ruiz-Zafra, Angel <a.ruiz-zafra@ucl.ac.uk> wrote:

Hello!.

I'm using MongoDB as DBMS, instead BerkeleyDB.

My question is: It is possible add/support new attributes, besides the "static" ones (idx, timestamp, data, index, ttl, etc)?. With "support" I mean, manage any additional attribute like any other attribute through the Handle Storage, that is, when I use "HandleValue", get other additional attribute.

I've tried to define a custom class such as HandleValue (HandleValueMongo), with the same source code but adding HashMap<String,String> for other attributes, but couldn't be possible because some of attributes of HandleValue class are protected (only could be used by class of the same package).

I know that other option is connect directly with the DB, but I would like to do it through HandleStorage and HandleValue classes, I guess is more safety connect to the DB through Handle Server instead directly.

In the same way, it is possible to specify custom queries based on MongoDB to get information?. Like the "Custom sql statement" define in the chapter 7.1.4 of the documentation, but using MongoDB syntax to optimize the search.

Thanks in advance and best regards!


_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info

_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info