Database level partitioning

This is a discussion on Database level partitioning within the MySQL Database forums, part of the Database Forums category; Is it good to partition database by using multiple databases? e.g. Blog System Each user is split into different ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-18-2008
howa
 
Posts: n/a
Default Database level partitioning

Is it good to partition database by using multiple databases?

e.g. Blog System

Each user is split into different database by they user name (hashing
algorithm),

If I use two letter prefix, e.g. aa...zz, I will have total (26x26 =
676 db)

So assuming originally I have 10M articles in a single DB, now I only
have 1476 articles per db, which is very scalable in nature.

Any comments?

Reply With Quote
  #2 (permalink)  
Old 01-18-2008
Gordon Burditt
 
Posts: n/a
Default Re: Database level partitioning

>Is it good to partition database by using multiple databases?

It depends on how the data is used.

>e.g. Blog System
>
>Each user is split into different database by they user name (hashing
>algorithm),
>
>If I use two letter prefix, e.g. aa...zz, I will have total (26x26 =
>676 db)


Does it take 676 queries to find out the next article in a thread?
If so, you've made a TERRIBLE choice. On the other hand, if 'user name'
means the OWNER OF THE BLOG, not the poster of a comment, it might not
be such a bad idea, segregating posts of each blog into a separate database.


>So assuming originally I have 10M articles in a single DB, now I only


MySQL performs rather well with lots more records in a single TABLE.

>have 1476 articles per db, which is very scalable in nature.


*NOT* if there are many queries which do not know the username ahead
of time, and therefore involve queries to all the databases. If
there are many of these queries, and they are run often, your
proposed splitting is not a good idea.

>Any comments?


Don't be too quick to assume that partitioning the database as you
propose is not a pessimization. Also, you may incur more
permission-checking if you split by database rather than by table
in the same database.

For example, consider a sales order tracking system. It's a bad
idea to partition the database by product, because many orders will
order more than one kind of product (so printing an invoice will
require a query per product). It's a bad idea to partition the
database by salesman, since you will want to generate reports of
the total number of a particular item sold for the whole company.
It might not be such a terrible idea to partition the database by
fiscal year, but you still have to deal with ordering in one fiscal
year and shipping and payment in another.

Reply With Quote
  #3 (permalink)  
Old 01-18-2008
Captain Paralytic
 
Posts: n/a
Default Re: Database level partitioning

On 18 Jan, 03:38, howa <howac...@gmail.com> wrote:
> Is it good to partition database by using multiple databases?
>
> e.g. Blog System
>
> Each user is split into different database by they user name (hashing
> algorithm),
>
> If I use two letter prefix, e.g. aa...zz, I will have total (26x26 =
> 676 db)
>
> So assuming originally I have 10M articles in a single DB, now I only
> have 1476 articles per db, which is very scalable in nature.
>
> Any comments?


I think the simple answer is no
Reply With Quote
  #4 (permalink)  
Old 01-18-2008
Kees Nuyt
 
Posts: n/a
Default Re: Database level partitioning

On Thu, 17 Jan 2008 19:38:38 -0800 (PST), howa
<howachen@gmail.com> wrote:

>Is it good to partition database by using multiple databases?
>
>e.g. Blog System
>
>Each user is split into different database by they user name (hashing
>algorithm),
>
>If I use two letter prefix, e.g. aa...zz, I will have total (26x26 =
>676 db)
>
>So assuming originally I have 10M articles in a single DB, now I only
>have 1476 articles per db, which is very scalable in nature.
>
>Any comments?


You may want to read:
http://dev.mysql.com/tech-resources/...titioning.html

and view:
http://www.mysql.com/news-and-events...g-20061205.php
--
( Kees
)
c[_] He who regards all things as one is a companion of Nature. (#265)
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:10 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0