Giter Club home page Giter Club logo

Comments (7)

neonstalwart avatar neonstalwart commented on July 29, 2024

on a side note... X- headers are deprecated (http://tools.ietf.org/html/rfc6648) this reminded me to bring this up, i think dstore should stop using them.

from dstore.

kriszyp avatar kriszyp commented on July 29, 2024

This looks good to me. I agree with Ben, that we should probably eliminate the X- prefix. I tend to think of "natural ordering" as being an order that is deterministic, controlled, and meaningful (when no sort order is defined), but I think that is more conceptual, and I think you basically mean the same thing since you said the server might opt out of that and use an optimization driven order.

from dstore.

mercmobily avatar mercmobily commented on July 29, 2024

There is the possibility that I have been misusing the term "natural ordering".

To me, "natural ordering" is when you add an item, placing it in a specific "spot" (could be at the end, at the beginning, or in the middle of a collection) and then expect it to find it exactly there when you query the collection without specifying a sorting option.

With "server opting out" I mean this: with "natural ordering", the only meaningful way to do it is by adding a hidden field to the DB table (call it position) and then, every time you add something in a specific spot (or at the end by default), you make sure that sorting by position will result in the order you requested. Again, position is completely hidden to the user who must never worry about its value. (In contrast, the Memory store doesn't need a position field because it will just place the element in the right spot in the array).

There are several ways of keeping natural ordering database-wide, but they are all quite expensive. With MySql, you end up with at least one mass-update per insert/update, to "make space" for example.

So, the server might end up ignoring completely "natural ordering": if so, you can use beforeId, defaultNewToStart, and whatever else you want: if you then ask for a query without specifying any sorting, the collection's order will depend on the database server's mood (basically: very unpredictable).

Makes sense? Should I use a different term rather than "natural ordering"? (Which also means "ordering thing alphabetically so that it makes sense to humans")

from dstore.

kriszyp avatar kriszyp commented on July 29, 2024

That is exactly what I had in mind with the term, sounds good.

from dstore.

mercmobily avatar mercmobily commented on July 29, 2024

For the tutorial, does it make sense for me to post it here once it's written so that you guys can comment on it etc.? Or shall we close this issue and shall I email it to somebody when I am done? If so, who should I email it to?

from dstore.

kriszyp avatar kriszyp commented on July 29, 2024

For now, I think you could submit this tutorial in a branch/PR under docs. Thank you for putting this together!

from dstore.

mercmobily avatar mercmobily commented on July 29, 2024

Hi,

OK will do!
The tutorial will be a "beefed up" version of this document, with a nice
introduction etc.

Merc.

On 29 August 2014 04:31, Kris Zyp [email protected] wrote:

For now, I think you could submit this tutorial in a branch/PR under docs.
Thank you for putting this together!


Reply to this email directly or view it on GitHub
#42 (comment).

from dstore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.