This is a great idea Martin. I'd be happy to add an auto-increment
option. Info vars are easily extensible after all.
The easiest option would be a simple function like [(nextinfo
info.somepage)]. Reads the values and spits out the next available
number.
Then you could do
[(info field={(nextinfo info.somepage)} value=whatever)]
It would only be slightly more complicated to create an info var
extension that allows this:
[(info next value=whatever)]
Because the first is pretty special case, and the latter required a
fair bit of redundant code, I'd probably not want to put these in the
core... Note, threads probably will come out of the core in 4.0... And
moved to plugins, so that would be consistent.
There might be some clever way to add it to the core, but I don't see
it at this point in the code.
Is there anything else you would need to generate a twitter like
plugin besides this "next" feature? I don't use twitter but would be
interested to see something like this happen...
Cheers,
Dan
P.S. The reason it is fast is you have very focused storage of the
exact data you need, and not a mountain of data all stored together.
It is the same difference between storing page counts on each page, or
even in an index, verses a dedicated info.pagecount page. You can rip
through that smaller specified data lightning fast.
On Mon, Mar 22, 2010 at 8:11 AM, Martin <[email protected]> wrote:
> A long time I considered info vars as minor compared to data fields.
> Now it seems that there is a rise of key - value databases.
>
> The guys who built one of these databases, Redis, provide an easy to
> follow tutorial on how to organize a twitter clone with key - value
> only. It claims to be superfast, highly scalable and easy to built.
>
> Maybe there is some inspiration how to manage data with info lists
> (and how to extend info var functions like adding autoincrement)
>
> http://code.google.com/p/redis/wiki/TwitterAlikeExample
>
> First you set an unique key for every user (uid, e.g. a random number
> or md5-key).
> Then store everything with this uid
> uid: username
> uid: password
>
> Set an unique key for every new post or article (if its a blog).
> post:10343 "$uid|$time|text of posting here"
>
> Maintain and update three more lists:
> - a list with the post-ids for every user.
> - a list with user-ids of people following each you.
> - a list with all posts in a timeline.
>
> Why is it fast? I do not know...
>
> Greetings, Martin
>
> --
> You received this message because you are subscribed to the Google Groups
> "BoltWire" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/boltwire?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/boltwire?hl=en.