I want to post a question about whether a very specific database technology, used in the client-side memory (not written on the disk) is suited for a particular purpose: very highly active data.
For example, is it suited for an application that must absolutely stay at the highest possible framerate while doing lots of changes to its data? Such an application could be a video-game.
Of course asking "is that stuff gud enough" is obviously too broad or primarily opinion based. But I happen to know the answer, which is a definite no for a simple reason! Thus in the end it is neither too broad (the answer is short and simple) nor POB (their is only one answer).
Question:
Can minimongo be used for highly active, quickly updating data?
Given some very highly active specific data and events (moving elements around a whiteboard app, moving a character in a video game...), and not considering the actual client-server synchronization,
Should minimongo be used to store that data? What would be the main technical limitation?
minimongo
is the client-side RAM DB used primarily to store data exchanged with a server.
Answer:
[Meteor's
minimongo
][1] client-side database was created with two purposes in mind:
- Offering the same API as the one used server-side, allowing to write one code for all sides;
- Easily allowing synchronization between the client and server.
And this second point is what makes
minimongo
a poor support for highly active data.Look at the [code of
minimongo
's methodinsert
][2] :LocalCollection.prototype.insert = function (doc, callback) { var self = this; doc = EJSON.clone(doc); //...
This call,
EJSON.clone(doc)
, means that all the data you ever insert in this collection is going to be processed to later be sent to the server. Even if you don't intend to send it, it will be serialized and deserialized all the time.This process of serialization and deserialization makes it unsuited for use in any application that requires very tight performances, such as a 60FPS application with lots of operations happening.
It's otherwise fine for all purposes[1]: https://www.meteor.com/mini-databases
[2]: https://github.com/meteor/meteor/blob/devel/packages/minimongo/minimongo.js#L538
(Link format voluntarily broken for the purpose of the quoting)
I believe the answer is fine but the question is really crappy. I don't know how I could enhance it...
How can I improve this potential post?
If you need any more data to understand the question, feel free to ask