Question

For the project we have a MySQL database. We want to use Mongo'S GridFS to store screenshots of each piece of software.

We're not sure if we should store the MySQL software id in the mongo file collection or to store the mongo id in a MySQL table i.e. table screenshots would have software_id and mongo_id. MongoID would point to the collection of the screenshots.

We'll be using Doctrine ORM and Doctrine ODM in parallel.

Any ideas? What would be the best solution? In terms of synchronisation. Would we run into any problems?

Thanks

Was it helpful?

Solution

Assuming each sotware has many screenshots and each screenshot belongs to one software, I would put MySQL ids in MongoDB:

  • it will avoid having an additional table in MySQL referencing entities it doesn't own
  • it should avoid some lookups too (when you need screenshots, you will only request it with the software id in MongoDB instead of asking MySQL first and MongoDB afterward)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top