4

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 method insert][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

5
  • 5
    Really your best bet is to actually use that database; create a test application or data to load in it; and test it out, and when you come across an actual bottleneck to your work, then ask about getting around that bottleneck (with reproducing code, of course). Jul 29, 2015 at 13:51
  • I really don't see how you can word a question about a specific programming issue that can be answered that way.
    – Cerbrus
    Jul 29, 2015 at 13:52
  • @GeorgeStocker Ah, I did. However, the actual implications of this technology are really specific and need a lot of details. I did solve the bottleneck, but it required a whole new approach which would be way too long for SO... So I can't really ask for that. The main issue was that I went with the wrong technology to begin with (see the answer), so I wanted to share that.
    – Kyll
    Jul 29, 2015 at 13:54
  • 2
    @Kyll The sentiment is great; but the question and answer point in the wrong direction; specifically that for your specific use case, this was the wrong technology. That sounds like a blog post to me. Without an actual, specific problem for people to solve, it just doesn't fit here. Jul 29, 2015 at 13:58
  • @GeorgeStocker I see. Your comment made me think about how I could achieve this, and I think I've grasped the right way, thanks a lot! Would you post an answer, or should I simply delete this post?
    – Kyll
    Jul 29, 2015 at 14:01

1 Answer 1

4

Really your best bet is to actually use that database; create a test application or data to load in it; and test it out, and when you come across an actual bottleneck to your work, then ask about getting around that bottleneck (with reproducing code, of course).

The sentiment is great; but the question and answer point in the wrong direction; specifically that for your specific use case, this was the wrong technology. That sounds like a blog post to me. Without an actual, specific problem for people to solve, it just doesn't fit here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .