4 ms·
You've got options there though https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model https://en.wikipedia.org/wiki/Entity%E2%80%93attribu
by bpicolo 9y ago
You've got options there though
https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80...
- threeseed 9y agoNo. EAVT is great as an intermediate format but it is absolutely useless to query for since most of the time you are trying to find a set of attributes for a given entity i.e. full table scan. What you want is a "wide table". One entity column and all the attribute columns to the right. Often with most of the values set to null. This is the dream use case for MongoDB since it you can ignore sparse values yet when you query it via their drivers it will appear as a wide table. You can't do this at all in PostgreSQL since you will hit a column limit.
- kuschku 9y ago> You can't do this at all in PostgreSQL since you will hit a column limit. JSONB is designed for exactly this, isn’t it?
- threeseed 9y agoSure. But MongoDB is far better at scaling, has infinitely better drivers (including Spark) and is about an order of magnitude faster than PostgreSQL for partial updates. The lack of a Spark driver alone renders PostgreSQL useless for most companies.
- flukus 9y ago> EAVT is great as an intermediate format but it is absolutely useless to query for since most of the time you are trying to find a set of attributes for a given entity i.e. full table scan. This is what indexes are for. An index on the entity id should avoid any full table scans.
- threeseed 9y agoEAVT table with 100 million entities and 10000 attributes = one trillion row table. And you want to build indexes on half the table ? Good luck with that.