Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 78F8C12A65BC for ; Sat, 2 Jun 2012 21:57:44 -0300 (ADT) Received: from mail-ob0-f174.google.com ([209.85.214.174]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Saz8X-0004ZW-Ai for pgsql-admin@postgresql.org; Sun, 03 Jun 2012 00:57:43 +0000 Received: by obbtb18 with SMTP id tb18so5048982obb.19 for ; Sat, 02 Jun 2012 17:57:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :content-language; bh=5IGJ2JruQ/CTqJXwK8tbq/aUoc1PIj+814BJx+y5vQc=; b=dfGOra4Ifb2fPZabHL7FnazPxGjfcfOSFEPlOQSP75Ft2eUSDcjp4kMFAWE3vUs4Wq 02MnCCkG4pmfL5oLXYvYwVJUyUBrUcgetc11l9SXjZqOal9s2qMdB3VNMEtJnhR/NwTM 38M0gAyN5fzTZm+VE/uDU/lqGr0/S6ZcJDE6CJTfkM3aUB5weV9UBzHFPRQndWmy0l+l vwpBfNDu/2oOOMQht3Qqab3EdA2sy/KWwrg1QEMXfCu9XZYQJkaK5ZHM4fpP81SsYNdp 8VxKLGpqMozJRjFzagK2hHan1eao0/OAL06Zz+Y7qA05F4xtpYcX0VPEMU5plHvsC2ls kcVw== Received: by 10.50.203.98 with SMTP id kp2mr5006552igc.42.1338685046916; Sat, 02 Jun 2012 17:57:26 -0700 (PDT) Received: from Tower (CPE001c1008f624-CM0011aec4f376.cpe.net.cable.rogers.com. [174.118.17.120]) by mx.google.com with ESMTPS id fv9sm4874995igc.8.2012.06.02.17.57.24 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 02 Jun 2012 17:57:25 -0700 (PDT) From: "Igor Shmain" To: "'Kevin Grittner'" , References: <4FC9E6D70200002500047FA7@gw.wicourts.gov> In-Reply-To: <4FC9E6D70200002500047FA7@gw.wicourts.gov> Subject: Re: Data split -- Creating a copy of database without outage Date: Sat, 2 Jun 2012 20:57:25 -0400 Message-ID: <009f01cd4123$d89d9840$89d8c8c0$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQLAKVofQVYRFYUrn76u2Yv6MeqI5JUB4jJA Content-Language: en-ca X-Pg-Spam-Score: -2.7 (--) X-Archive-Number: 201206/2 X-Sequence-Number: 39593 Thank you for the "food for thoughts", Kevin :-) Would it be possible for you to mention what hardware (cpu, ram, disks, etc.) and software your system uses to support this db size and number of transactions? Regarding the original question: It was not a question of potency of postgres. The architecture I am working on is intended to be used by a web startup. If the product is successfully, many users can start using the service in a very short time. If that happens, there will be not time to re-architect the database and the applications; the database will need to be scaled almost overnight. Total number of requests per day is not a major criterion for this system. The response time for multiple hits in a short period of time is more important. The requirement is to serve thousands of requests per second. Buying a "super" computer, hoping that one day it will run at full throttle is not for startups. Getting such a powerful computer quickly and moving the database there is unrealistic. It makes more sense to design the system in a way so it can be easily and quickly distributed across many relatively inexpensive servers. That is why the sharding is needed. If you say something like "this is just purely theoretical", "what are the chances to get all those users", "things like that does not happen overnight", I would totally agree. But look at it from another angle: If only a few people use the application, the company will stay with a small server and will not lose much. But if the service is successful, the company will deploy a whole bunch of servers in a few hours and will be able to serve all the users quickly :-) It is a trade-off. More work now in exchange for having a scalable system tomorrow (yes, yes, it is also called premature optimization :-) And you know what, it does not look like too much extra work now :-) If you see real or potential problems in this logic, or heard about similar implementations, please mention that. I would appreciate it very much. Best wishes, -igor -----Original Message----- From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov] Sent: June-02-12 11:12 AM To: igor.shmain@gmail.com; pgsql-admin@postgresql.org Subject: Re: [ADMIN] Data split -- Creating a copy of database without outage "Igor Shmain" wrote: > I need to design a solution for a database which will grow and will > require horizontal split at some moment. Just one more bit of "food for thought" -- we have a database with 3TB processing approximately 50 million database transactions per day (some with a great many statements or affecting many rows) running quite comfortably on a single machine (actually sharing that machine with a 2TB database on a separate drive array), without partitioning. We have done a lot of tuning. I'm not sure what your basis is for the assumption that you will need to split the database across machines; you might be right, but you might be engaging in "premature optimization". -Kevin