On Fri, Jan 24, 2025 at 4:48 AM anlex N <an0291170@xxxxxxxxx> wrote:
Hello Adrian, Laurenz. Have you tried postgresql's json in your everyday life? How fast is it? how is it than mongodb?
My honest opinion, JSON(B) in PG is great as data transfer format but not so much for storage. Here is an example. Up to last year I had a table in my DB with rows consisting of a bunch of numbers in many columns. Over maybe 15 years of business that table had grown to a few TB in size. Then the development team decided they needed more flexibility and started to fill a new table with the same information in JSON. After only 1 year of business that table is now in the same size range.
Another example, the developers came up with a new table to store the result of the JSON response they got from a 3rd party application. That worked for a while and the table behaved normally. Suddenly it started growing by a few GB a day. Turns out the 3rd party had decided to include an MB-sized picture in the JSON response. Our team then faithfully stored all of that crap unfiltered in the DB.
That is not an answer to your original question, of course. How fast it is depends very much on the use case. If you are talking about access methods alone, the ability of indexing JSON and such, then PG is on par with mongo if not better. But nobody but you can give you a definite answer relating to your situation.