hi richard,
(disclaimer: i am one of the core developpers of PHPCR and this is my
biased opinion :-)
i think this is an excellent idea. for semi-structured content, PHPCR is
the right fit. you can have different model classes stored along with
each other, put them into hierarchies and have them reference each other
regardless of the target type. on the other hand, with the PHPCR-ODM and
document classes, you still don't risk a mess in your database.
PHPCR supports universally unique identifiers, which you could use in
the order information and similar. because data that you want to
aggregate and that really /is/ relational should rather live in a
relational database than in PHPCR.
while PHPCR does have search methods, they should not be overused -
performance can be less than you would expect from relational database.
it is /not/ a relational database, but a nosql-like store with tree
structures, references and - depending on whether the backend supports -
goodies like versioning.
one thing you might also enjoy is multilang: phpcr-odm has a multilang
support built in where you only need to care about language when writing
translations, but uses the request language when reading, so your code
does normally not need to be multilang aware.
with the doctrine xml/yml mapping, you can theoretically also share
model classes between the different storages. for very simple cases
(just one product class) the relational db probably is enough. but when
it gets more complex, you can switch to PHPCR and provide mappings for
that as well.
cheers,
david
Am 13.07.2012 19:22, schrieb IamPersistent:
> The question of ORM has come up again. Right now, we have a couple of
> bundles that are using DoctrineORM for storing to a relational database.
> The problem really come with the Product. When you have a various types
> of products with an unknown amount and types of features and options,
> then add in an unknown number identifiers for some or none of the
> products and options, storage in a relational database becomes difficult.
>
> My plan, for a while, has been to add support for PHPCR
> <
http://phpcr.github.com/> from the the SymfonyCMF
> <
http://cmf.symfony.com/> project. There is a Doctrine implementation
> <
https://github.com/jackalope/jackalope-doctrine-dbal> that could be
> used as the backend for the usual relational databases. By using the
> PHPCR interface, I believe it will make it easier to store products with
> varying features and options with the added bonus of gaining access to a
> number of different storage engines. I still think this is the best
> course of action for the project, especially for persisting the Product.
>
> PHPCR may not be right for all of the data that needs to be persisted,
> but I think with persisting the Product, its the smartest way to go.
>
> Any other thoughts?
>
> Richard
--
Liip AG // Agile Web Development // T
+41 26 422 25 11
CH-1700 Fribourg // PGP 0xA581808B //
www.liip.ch