http://github.com/zippy1981/BSON-ObjectId.SQL
I have a user defined function that mostly implements a BSON ObjectId.
I have not figured out how to bitshift anything bigger than an 8 byte
integer in T-SQL, so I had to do casting and string manipulation to do
it. Due to these inefficiencies I assume implementing an ObjectId as a
CLR type by compiling the ObjectId C++ class as a managed DLL will
lead to better performance.
My practical goals are twofold. First I want to test thinkgs like Id
Colissions, and if ObjetId makes sense in a databsase for performance
reasons. Second, in an SOA system it would make sense to be able to
have one SQL backed web service that stores external keys that
reference mongo documents retrieved through another service. There are
of course other ways to solve this problem but I want to try this way.
I'm looking for any constructive feedback, but specifically:
1. A way to get the machine id from SQL
2. Efficiencies in the algorithm.
3, Recommendations for implementing the sequence section
4. signatures for other UDFs to implement.
Regards,
Justin Dearing