Comments (7)
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.
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.
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.
That is exactly what I had in mind with the term, sounds good.
from dstore.
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.
For now, I think you could submit this tutorial in a branch/PR under docs. Thank you for putting this together!
from dstore.
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)
- dstore/Memory#setData does not update grid. HOT 3
- question documentation - combination of stores memory/rest HOT 6
- Request _renderFilterParams fails when filter target contains parens
- cannot dojbuild that by bower_component HOT 2
- Trackable event incorrect when beforeId matched item being updated
- typedef not included in npm package or DefinitelyTyped registry
- filter issue with certain keys HOT 1
- Caching-store exception propagation
- allow filter-functions for legacy-stores
- dgrid/Rest does not parse arrays of JSON in get(1) HOT 1
- Cache mixin doesn't work with Rest without an object ID when adding when using the default Memory store for the cache
- IndexedDB fails to create index if you use a not default 'idProperty' HOT 1
- How to use filter for excluding a list of values? HOT 1
- bower.json should restrict to dojo 1.x HOT 4
- track() reports on data changed outside the collection HOT 2
- Commit 2288729 breaks existing code HOT 5
- Customizable error logging
- Dependency on @types/dojo
- Strict mode exception in Cache#_fetch() HOT 5
- RequestMemory does not honor HTTP headers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dstore.