Data structure with ids

Yes, that is exactly what we discussed in this thread earlier. See this reply especially.