by kuschku · 10y ago · 0 comments
> - Fast and simple object storage (ie sessions).
Those would also be fulfilled by using a jsonb column in Postgres, right?
For querying, my guess is that frameworks such as MongoDB's Aggregation (https://docs.mongodb.com/manual/aggregation) are more versatile.
If you have a table with a column data in format json or jsonb, you can do a
SELECT data->>cust_id AS cust_id, SUM(data->>amount)
WHERE data->>status = 'A'
GROUP BY data->>cust_id;
just as well in postgres.Or, for the third example,
SELECT DISTINCT data->>cust_id;
(See https://www.postgresql.org/docs/9.5/static/functions-json.ht... )Storing JSON is now natively supported in MySQL 5.7
Look at my answer to the sibling comment for an example.