質問

I'm looking for a way to store EAV-like subject on a relational DB. I'm going to use Rails + Mysql. I had little expirience with EAV in PHP + Mysql. ~500 entries. That's nothing, of course, all queries was fast (though there was no query caching). But what if a million records? What to do? Use MongoDB? Or maybe Sphinx can help in this situation? Or maybe SQL+NoSQL tandeme?

In short, what is the best way? P.S. I'm complete noob in Rails yet, switching with PHP, so tell me, what could be the pitfalls.

Sorry for my english)

役に立ちましたか?

解決

I would say MongoDB, but if for some reasons you prefer to use ordinary database you can take a look at PostgreSQL and HStore extension: http://www.postgresql.org/docs/9.2/static/hstore.html

there are gems for using it in rails: https://github.com/engageis/activerecord-postgres-hstore

and a Railscast episode: http://railscasts.com/episodes/345-hstore

他のヒント

maybe this questions and articles will help you:

It is good to start up with the right database architecture, but in my opinion you should think about performance, when you'll need this.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top