4 ms·
Isn't this a category error? If you need to query within serialized data, you don't want to serialize. Normalize your database for this.
by rhizome 14y ago
Isn't this a category error? If you need to query within serialized data, you don't want to serialize. Normalize your database for this.
- rdtsc 14y agoOr de-normalize and keep your data serialized but also keep an additional index of data you want to query.
- rhizome 14y agoSerialized is already denormalized, you're talking about a kind of double-denormalization where you introduce metadata as a guide for the serialized-data queries. Spaghetti.
- randomdata 14y agoWouldn't that kind of defeat the purpose of using a document database in the first place? Being able to throw unstructured data into the system, and then being able to query on that data once the space is better understood is where the document databases really shine. If you are able to start with rigid structure, you, in many cases, could have just used a relational database to begin with.
- rhizome 14y agoWouldn't that kind of defeat the purpose of using a document database in the first place? Yes. Use the right tool for the job.
- mgkimsal 14y agoDefining 'right', and being able to predict 'right' for future iterations/versions of an app's life is where that mantra seems to fall down. I'm not a huge nosql fan right now, given that I sometimes need document-style schemaless data storage, but I always (eventually) need adhoc reporting and relational querying capabilities on projects. With that (fore)knowledge, I may as well always choose a relational db.
- qeorge 14y agoIn my (limited) experience with Mongo, its just not like that. You can't just (quickly) query any key in the document - you have to define indexes anyway or you'll be doing the equivalent of a table scan or Map/Reduce. Document databases shine when you're just not doing that kind of query anyway, and you've got a ton of data to store. If you need to do e.g., fulltext and/or geospatial search you should probably use a search server anyway (I like Sphinx), and then just lookup by PK in whatever datastore you're using. Its been mentioned elsewhere on this thread, but I'm also quite fond of the old FriendFeed method: serialize your arbitrary data into a (MySQL) BLOB, and then run a background process to build "indexes" (really tables) when you find out you need them. Its ridiculously simple to start doing that, and there's no new tech to learn.
- DEinspanjer 14y agoWell, what I need is expressive and flexible querying over document data that doesn't have a rigid schema. There are several document stores that provide filtering and retrieval matching that, but they all have various limitations when it comes to aggregation.