We are migrating some data from MySQL to Mongo and have been adding extra fields to some of our DB tables for the ObjectId value of the migrated data objects.
At the moment we are storing them as varchar(24) latin1_general_ci which works fine.
However, for efficient storage/indexing we probably should convert back to the 12-byte binary value. Unfortunately, MySQL only seems to have native integer support up to 8 bytes. Is there another option - binary perhaps?
Update: I am migrating from MySQL but only certain tables at the moment. So I first make duplicates of the objects in Mongo of a certain table. Then I go back to any other tables left in MySQL that have foreign key references to that old MySQL table ID and add a new reference field that will store the Mongo object's ID. I will then remove the original reference field the BIGINT.
Update 2: The reason I bring this up is that it may be 12 months more (or never) before we move this other data, so it will have a performance impact on the live web application until then.