문제

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