Can Postgres be used as a document database?

Let's say we're building a database to store analytics from websites or mobile apps. Transactions are not important (it's ok to throw things off) and only slow things down by supporting so many concurrent calls that consistency can be possible and some of the data will be unstructured (i.e. user can pass a random JSON parameter as a parameter to call the logging log which we will store in the database).

Something like Mongo would be a smart choice for this, since it satisfies most of the requirements listed above. However, you often hear Postgres' ability to tune itself to fill many different roles. I guess it is possible to disable transactions, etc.

I'm not very familiar with setting up Postgres, so I have to ask: is it really possible to adapt Postgres to meet the requirements listed above?

+3


source to share


1 answer


You need to try / do some tweaking to see if it suits your performance needs. But Postgres has built-in support for transparently storing large column values ​​(up to 1 GB), effectively called TOAST (since 7.1). The Postgres-as-a-service provider Heroku uses this to offer "document storage" capabilities using its hstore flat text. Postgres datatype - this page has sample applications from xstors. In terms of setup, I think Postgres 9.0 High Performance is a good reference for someone unfamiliar with postgres to figure out where to look in an online Postgres doc on a topic. For completeness, Postgres has a large object APIwhich can handle objects up to 2GB in size, but it makes it harder to migrate to a different DBMS than using a transparent solution like TOAST.



+5


source







All Articles