statamic / ideas

đŸ’¡Discussions on ideas and feature requests for Statamic
https://statamic.dev
31 stars 1 forks source link

MongoDB driver #125

Open Christophvh opened 4 years ago

Christophvh commented 4 years ago

Hi,

Thanks again for the amazing project. I love working with v2 and loving v3 even more!

Thinking about integrating a Commerce package build in Laravel. The admin/cms side of things would run in Statamic and expose a GraphQL API. Big fan of how all the different fieldsets are currently stored in markdown. But for a larger site, we have to use a DB. (15k+ products)

In previous Laravel projects, we worked with a hybrid MySQL and MongoDB setup. MySQL for the highly structured data like users/roles/permissions/.. And MongoDB for unstructured data like the contents of a Bard-like editor or flexible products.

When I look at the current output of the markdown files it pretty much is already in a perfect setup to store in a MongoDB document. I was wondering how hard it would be to incorporate a MongoDB driver for Statamic collections/taxonomies/pages.

Also, I of course am willing to write this driver myself, so a few pointers to where this conversion should happen or a few gotchas in the code would be highly appreciated.

I assume this would be the core of how this driver should be made: https://statamic.dev/extending/repositories

duncanmcclean commented 3 years ago

In case you're still looking for something, maybe the Eloquent driver might be helpful? https://github.com/statamic/eloquent-driver

Christophvh commented 3 years ago

In case you're still looking for something, maybe the Eloquent driver might be helpful? https://github.com/statamic/eloquent-driver

We have chosen for Nodejs + mongodb for our e-commerce project since at the time statamic was not ready to be used headless. But yes that might be a startingpoint. But i still think a MongoDB driver would be a perfect fit for statamic, sadly Laravel + MongoDB is a pain to get working.