Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

I would like to create web app and I planned to use two types of databases.

I'm going to use PostgreSQL to keep data that requires a specific structure - for example, users - and MongoDB to keep tags for quick read and search. But recently I found some info suggesting that PostgreSQL can have similar performance to MongoDB.

So my question is, is this right?

If this is true then I would to use only one database PostgreSQL.

share|improve this question

closed as too broad by Craig Ringer, Jan Doggen, OGHaza, Daniel Vérité, plannapus Mar 5 '14 at 6:53

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Like most x vs y questions, "it depends". You are trying to solve performance problems you do not have yet, using technology you don't seem to fully understand. You're more likely to create performance problems than fix them by attempting things like this. The only "correct" answer to this question would be: benchmark it with a simulation of your workload and see. – Craig Ringer Feb 4 '14 at 7:08
1  
Also consider the non-performance consequences of mixing databases. Complexity, for one. Inability to fetch all the desired data in a single query, for another. Difficulty of getting a consistent view of data, co-ordinating transactions, etc. If in doubt, keep it simple until you have enough information to know what to change, and how. Anyway, close-voted "not constructive" – Craig Ringer Feb 4 '14 at 7:09

1 Answer 1

up vote 1 down vote accepted

There is no need to use two databases. Stick to either PostgreSQL or MongoDB, a good database and schema design,with proper caching can leverage good performance from both.

Advantage of MongoDb would be when lot of your data is schemaless,and prone to constant changes. But the same can be achieved in PostgreSQL by storing json in some columns. A good advantage PostgreSQL provides over some other rdbms ( eg MySQL ) is support for a native json type :

http://www.postgresql.org/docs/devel/static/datatype-json.html

share|improve this answer
    
Most of the data will be structured. The main function of mongo will store tags. – user2239655 Feb 4 '14 at 7:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.