Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Uh, what?

What's wrong with using MongoDB to screw around while you are developing it? It's not like you have to marry it. Figure out what schema you are going to be using, and then write your table layouts for Postgres.



Sorry but what you are suggesting is crazy.

MongoDB has a completely different data model to PostgreSQL. You can't just build your app around one approach and then trivially move to another.

Pick the database for the data model not the other way around.


I could not fail to disagree with you less.

(^ that means I agree).

This idea that you can arbitrarily switch between database X and database Y with radically different models is a really harmful fallacy. Code which attempts to ‘abstract away the details’ is often leaky, buggy, complex, and just as prone to tight coupling as any other solution.

At the very least, such has been my experience. And I think certain individuals have a policy of downvoting those comments they disagree with rather than explaining their counterpoints in a comment.


In my experience there isn't an issue. It all comes down to how well you design your application. Here's the interface to a service in a fun side project I'm currently working on (comments removed):

    public interface IAnalysisService
    {
        Guid CreateAnalysis(Guid ownerId, string name);
        void LoadingAnalysisInputs(Guid analysisId);
        void RequestAnalysis(Guid analysisId, string number, IEnumerable<Records> inputs);

        Guid CreateAndRequestAnalysis(Guid ownerId, string name, string number, params Records[] inputs);
        Guid CreateAndRequestAnalysis(Guid ownerId, string name, string number, IEnumerable<Records> inputs);

        Analysis FindAnalysis(Guid analysisId);
        Analysis FindAnalysisForProcessing(Guid analysisId);

        void CompletedAnalysis(Guid analysisId, AnalysisResults results);
        void FailedAnalysis(Guid analysisId, string reason, params object[] args);        
    }
These methods implement some business rules, do some database work and throw a few messages onto a service bus. Why is it so hard to believe that the database implementation for any of these methods affects the consumers? Here's a sample implementation:

        public void FailedAnalysis(Guid analysisId, string reason, params object[] args)
        {
            AnalysisRepository.Failed(analysisId, string.Format(reason, args));

            Bus.Send(new AnalysisCompleted {AnalysisId = analysisId});
        }
I don't see any obvious bugs, complexity or leaky abstractions.


Your comment is lost on most people here - Ruby doesn't have interfaces.


And ruby doesn't have macros that would make such a db switch even simpler.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: