Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Tokyo Cabinet is 14 times faster than MySQL
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  13 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David Beckwith  
View profile  
 More options Oct 22 2008, 7:52 am
From: David Beckwith <dbitsoluti...@gmail.com>
Date: Wed, 22 Oct 2008 04:52:52 -0700 (PDT)
Local: Wed, Oct 22 2008 7:52 am
Subject: Tokyo Cabinet is 14 times faster than MySQL
I just did a simple benchmark of inserting a million rows into a Tokyo
Cabinet .fdb file versus a MySQL table.  The Tokyo Cabinet insertions
were 14 times faster.

Time.now.to_f:
-------------------------
Start Tokyo: 1224676065.98518
End Tokyo: 1224676080.02634
Server version: 5.0.37
Start MySQL: 1224676080.07674
End MySQL 1224676246.60687

Granted, that's not a realistic scenario, but it shows what might be
possible.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Julian Leviston  
View profile  
 More options Oct 22 2008, 5:40 pm
From: Julian Leviston <jul...@leviston.net>
Date: Thu, 23 Oct 2008 08:40:34 +1100
Local: Wed, Oct 22 2008 5:40 pm
Subject: Re: [merb] Tokyo Cabinet is 14 times faster than MySQL
It'd be nice if it had a DataMapper object (DO).

That'd be bloody wicked.

Julian.

On 22/10/2008, at 10:52 PM, David Beckwith wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kyle Drake  
View profile  
 More options Oct 22 2008, 8:16 pm
From: "Kyle Drake" <kyledr...@gmail.com>
Date: Wed, 22 Oct 2008 19:16:19 -0500
Local: Wed, Oct 22 2008 8:16 pm
Subject: Re: [merb] Re: Tokyo Cabinet is 14 times faster than MySQL
Tokyo Cabinet is a cool power tool, but it's not a relational
database. It only does key/value store. I'm not sure there would be
much of a point to making a DM interface, since you wouldn't be able
to use most of the methods in it. I think it would be much easier to
just write a set of model methods for getting/setting the data.

Kyle Drake
Net Brew Design
http://www.netbrewdesign.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jarkko Laine  
View profile  
 More options Oct 23 2008, 12:33 am
From: Jarkko Laine <jar...@jlaine.net>
Date: Thu, 23 Oct 2008 07:33:27 +0300
Local: Thurs, Oct 23 2008 12:33 am
Subject: Re: [merb] Re: Tokyo Cabinet is 14 times faster than MySQL
On 23.10.2008, at 3.16, Kyle Drake wrote:

> Tokyo Cabinet is a cool power tool, but it's not a relational
> database. It only does key/value store. I'm not sure there would be
> much of a point to making a DM interface, since you wouldn't be able
> to use most of the methods in it. I think it would be much easier to
> just write a set of model methods for getting/setting the data.

DataMapper is not just for relational databases: http://merbist.com/2008/09/29/write-your-own-custom-datamapper-adapter/

//jarkko

--
Jarkko Laine
http://jlaine.net
http://dotherightthing.com
http://odesign.fi

Check out my latest book, Unobtrusive Prototype, fresh off the  
Peepcode oven:
http://peepcode.com/products/unobtrusive-prototype-js


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel N  
View profile  
 More options Oct 23 2008, 1:14 am
From: "Daniel N" <has....@gmail.com>
Date: Thu, 23 Oct 2008 16:14:12 +1100
Local: Thurs, Oct 23 2008 1:14 am
Subject: Re: [merb] Re: Tokyo Cabinet is 14 times faster than MySQL

There's only a handful of methods you need to use to setup for a DataMapper
adapter as defined in the AbstractAdapter.  Not sure how you'd go with a
model id though although you can use composite keys etc... doesn't seem to
sit...

~Daniel


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Aimonetti  
View profile  
 More options Oct 23 2008, 1:56 am
From: "Matt Aimonetti" <mattaimone...@gmail.com>
Date: Wed, 22 Oct 2008 22:56:05 -0700
Local: Thurs, Oct 23 2008 1:56 am
Subject: Re: [merb] Re: Tokyo Cabinet is 14 times faster than MySQL

hehe since my DM adapter was mentioned I guess I should give my opinion.

I actually agree with Kyle and I would probably not use an adapter unless
Tokyo Cabinet can handle conditional statements.

A good example would be couchDB. I don't think the adapter makes a lot of
sense. Don't get me wrong, it's great to have one and help people getting
started, but DM is very much RDBMS oriented, with a concept of clean/dirty
objects, collections, relationships.  I feel, Couchrest (by Chris Anderson)
is a better fit since it's a lighter layer between your models and your
data.

-Matt


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Julian Leviston  
View profile  
 More options Oct 23 2008, 2:04 am
From: Julian Leviston <jul...@leviston.net>
Date: Thu, 23 Oct 2008 17:04:43 +1100
Local: Thurs, Oct 23 2008 2:04 am
Subject: Re: [merb] Re: Tokyo Cabinet is 14 times faster than MySQL

C'mon guys,

If you can store data in a thing, DM should be able to wrap it...

I mean, if you can store key value pairs, we could *easily* write  
something the yields relationship-type mappings, right?

I'm also keen to start using a proper object database like gemstone/s  
with merb... (maglev hm? :))... because then we can write proper ruby  
objects for our model with proper relationships and not use this  
cobled SQL crap anymore.

The thing then, though, is that we'd need some legacy-backuppy-
database support thing... for when we have clients that require the  
database to be able to be backed up and restored to some sql type thing.

I personally detest SQL backed databases.

Jules

On 23/10/2008, at 4:56 PM, Matt Aimonetti wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Beckwith  
View profile  
 More options Oct 23 2008, 3:20 pm
From: David Beckwith <dbitsoluti...@gmail.com>
Date: Thu, 23 Oct 2008 12:20:21 -0700 (PDT)
Local: Thurs, Oct 23 2008 3:20 pm
Subject: Re: Tokyo Cabinet is 14 times faster than MySQL

> DataMapper is not just for relational databases: http://merbist.com/2008/09/29/write-your-own-custom-datamapper-adapter/

Pretty awesome!  Thanks!

On Oct 22, 9:33 pm, Jarkko Laine <jar...@jlaine.net> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Beckwith  
View profile  
 More options Oct 23 2008, 3:41 pm
From: David Beckwith <dbitsoluti...@gmail.com>
Date: Thu, 23 Oct 2008 12:41:00 -0700 (PDT)
Subject: Re: Tokyo Cabinet is 14 times faster than MySQL
I want to do some more tests to see if Tokyo Cabinet would really
offer much of a performance advantage -- and in what cases.

Here are some test cases (Tokyo Cabinet vs. MySQL) I'm thinking about
implementing (while using INNO DB and turning off ACID for MySQL):
* joins (say user has many posts, say 100 posts each)
* graph traversal with depth 11 and doing a read and write to each
node over a graph with like 3 edges per vertex, with depth 11.

It may be the case that Tokyo Cabinet doesn't significantly improve
over MySQL to warrant creating an ORM for it.  That's why I want to do
the preliminary tests to see if they are at least encouraging.

On Oct 22, 11:04 pm, Julian Leviston <jul...@leviston.net> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Kubb (dkubb)  
View profile  
 More options Oct 23 2008, 4:05 pm
From: "Dan Kubb (dkubb)" <dan.k...@gmail.com>
Date: Thu, 23 Oct 2008 13:05:29 -0700 (PDT)
Local: Thurs, Oct 23 2008 4:05 pm
Subject: Re: Tokyo Cabinet is 14 times faster than MySQL
On Oct 22, 10:56 pm, "Matt Aimonetti" <mattaimone...@gmail.com> wrote:

> hehe since my DM adapter was mentioned I guess I should give my opinion.

> I actually agree with Kyle and I would probably not use an adapter unless
> Tokyo Cabinet can handle conditional statements.

> A good example would be couchDB. I don't think the adapter makes a lot of
> sense. Don't get me wrong, it's great to have one and help people getting
> started, but DM is very much RDBMS oriented, with a concept of clean/dirty
> objects, collections, relationships. I feel, Couchrest (by Chris Anderson)
> is a better fit since it's a lighter layer between your models and your
> data.

I think DataMapper seems RDBMS oriented mostly because we were
pragmatic about the design and decided to base some of the abstraction
around something we understood well enough to be successful with.
That's not to say we don't want to become more agnostic towards
different storage engines though. In order for that to happen people
need to start writing adapters that bend and stress DM's API. The
adapter API is relatively stable right now, but that's not to say if a
new abstraction can be found that better supports all the storage
engines we won't consider it.. we just need real world cases to build
on first.

I'm beginning to see three separate use cases that DM can handle, but
that not all underlying storage engines support:

  - Read/Write by Key
  - Read/Write by Search
  - Aggregate Reporting

I should start by saying that "Aggregate Reporting" is something DM
can handle with plugins like dm-aggregates, but there will never be
native support for that built into dm-core. If you're doing alot of
reporting or anything that requires the equivalent of GROUP BY, COUNT,
SUM, AVG, etc and you're not using an RDBMS based adapter, then DM
might not be your best option.

However, the other two cases should be handled by DM pretty well. The
main limitation is that some engines like Tokyo Cabinet can only
lookup an object by it's key blazingly fast, but not perform searches.
Then there are engines like Sphinx that can handle searches extremely
well. The engines that can do both, like the RDBMS based ones,
typically perform nowhere near the specialized engines.

DM makes it possible to define a single model, but use different
repositories and engines for different purposes.  For example you
could use one engine for key lookups, one for searching and one for
aggregate reports. You could use hooks, message queues and/or
background processes to keep the data in sync between the various
engines.  If you're at the level where you've outgrown generalized
engines like the RDBMS ones, then its probably worth considering.

Dan Kubb
(dkubb)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kyle Drake  
View profile  
 More options Oct 23 2008, 4:29 pm
From: "Kyle Drake" <kyledr...@gmail.com>
Date: Thu, 23 Oct 2008 15:29:49 -0500
Local: Thurs, Oct 23 2008 4:29 pm
Subject: Re: [merb] Re: Tokyo Cabinet is 14 times faster than MySQL

> I want to do some more tests to see if Tokyo Cabinet would really
> offer much of a performance advantage -- and in what cases.

If you're doing simple get/put of data, it's going to blow any SQL
server out of the water. But doing things like tables, foreign keys
and joins is just not possible. I don't have any specific benchmarks,
but I've seen tasks that take days on MySQL take seconds on DBMs like
Tokyo Cabinet. The difference for simple data store can be
substantial.

You can certainly write a DM adapter. But you wouldn't be able to use
most of the functionality.  Even doing things like setting properties
would be pointless. DM is an Object Relational Mapper, but since the
database is not relational, the pieces don't fit. It's not to bash
Tokyo Cabinet or DM, they're both great tools. They're just designed
for fundamentally different things.

Kyle Drake
Net Brew Design
http://www.netbrewdesign.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
sonicpond  
View profile  
 More options Dec 2 2008, 5:22 pm
From: sonicpond <sonicp...@gmail.com>
Date: Tue, 2 Dec 2008 14:22:19 -0800 (PST)
Local: Tues, Dec 2 2008 5:22 pm
Subject: Re: Tokyo Cabinet is 14 times faster than MySQL
On Oct 23, 3:29 pm, "Kyle Drake" <kyledr...@gmail.com> wrote:

> DM is an Object Relational Mapper, but since the
> database is not relational, the pieces don't fit.

you make a really good point, as obvious as it might seem, and it
raises a question for me.

i'm thinking about data-persistence in general.  assuming that the use
of a dbm like tokyo cabinet is mandated (let's just assume that it
is), is it unreasonable (or illogical) to use it from within an mvc
framework?

i'm really new to merb.  everything is so astonishingly abstracted
that i'm having a hard time visualizing how to do "manual" labor (like
retrieving a marshalled object out of a dbm and doing something with
it).


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Justin Reagor  
View profile  
 More options Dec 2 2008, 7:02 pm
From: Justin Reagor <justi...@gmail.com>
Date: Tue, 2 Dec 2008 19:02:46 -0500
Local: Tues, Dec 2 2008 7:02 pm
Subject: Re: [merb] Re: Tokyo Cabinet is 14 times faster than MySQL

> i'm really new to merb.  everything is so astonishingly abstracted
> that i'm having a hard time visualizing how to do "manual" labor (like
> retrieving a marshalled object out of a dbm and doing something with
> it).

Sorry that I'm jumping into the middle of this conversation, but I  
just saw that there is a Tokyo Cabinet DM adapter on Github. Unless  
this is what you guys are talking about already... ;)

:: Justin Reagor
:: justi...@gmail.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google