Pergunta

I'm developing a web application in Laravel 4 that has multiple users, each one with a profile. These profiles may (or may not) have different variables, such as dates, etc. I've looked at some RDBMS solutions for this problem including EAV design, but this method is really expensive in terms of both performance and code, so I discarded it.

The other option was tocreate a huge table with many columns, but I also discarded it since it is pretty useless to have a user with 30 null fields.

So I was thinking about using NoSQL and I ended up with CouchDB for the scalability and master-master replication. I looked into some DBaaS and found Cloudant quite interesting. The real question is: Is it really the option for my case (having users with a profile with different variables for each user)? Or is it doable with a RDBMS (MySQL)? Also, How can I use CouchDB with Laravel in a 3 tiered app? I don't want the user to have access to neither of the database's features, I really think that using CouchDB on the server side is the best option so far, please correct me if I'm wrong.

Foi útil?

Solução

Having non-homogenous data like you is the typical case where document-oriented databases like CouchDB or MongoDB are better than relational databases.

While CouchDB can be configured to be public-facing and being directly accessible by the clients (there are even proof-of-concepts of whole web applications served solely by CouchDB), this is quite uncommon in practice. The usual scenario is to use CouchDB as a hidden backend service which is used by a webserver running some kind of server-sided web technology like PHP, JSP, ASP or whatever you prefer.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top