Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tCJ3d-00G4vH-7X for pgsql-admin@arkaria.postgresql.org; Sat, 16 Nov 2024 13:41:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tCJ3Y-00EJX4-LE for pgsql-admin@arkaria.postgresql.org; Sat, 16 Nov 2024 13:41:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tCJ3Y-00EJWm-6k for pgsql-admin@lists.postgresql.org; Sat, 16 Nov 2024 13:41:44 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tCJ3V-002GFi-S3 for pgsql-admin@lists.postgresql.org; Sat, 16 Nov 2024 13:41:44 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-53d9ff92ee9so3281899e87.1 for ; Sat, 16 Nov 2024 05:41:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731764501; x=1732369301; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WWGFhfrKfHSLIN66FYv7gdaVwS5Ag5+nSBLHIwx+Ww4=; b=nLQv3WYHpWcNWM7Rvz9GS4hFeN1w3yxCTRq+mjTP6JywYIDkh1WfDReoqcsZcEPdrr 0lGcRtBzbr2trQ1stOFlsq9JlSYc5m7Z6rCrsM6zu/LpxJcFdH/yqRPPe2I6eMZ8wI2Z tCXEfcGNQWwg/HBtbKxMSwEcKxZ47LnUjLSlpN4cuV/TrBrMt7xFWC5CMkUS+jKZWbxN c0ZI8rdhCiCYwVcZnuCayLsEgBDKbn7505YGfI6CErFRMTO4FePsea7YcLJ7bKPXirdG LiYC2xw4lQEBg7P/Y9CJiBG4IEtlRAApZOGFZ4GhuapSb2AsFrEH5DwodssBlI57gd+V erzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731764501; x=1732369301; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WWGFhfrKfHSLIN66FYv7gdaVwS5Ag5+nSBLHIwx+Ww4=; b=DTMRsvfu80ZoxuXZpm26afuboWfGp3Qa/mxOkByP1Bpu7AkCr4Z9yZ5i/TpbXQHMyw w0Eaa5eUOp7grq/T7y5HDAkklRh5G3/MaAwIGhJT78tJs+TuzgQzFO0LlVtZrn5RuPYt RfHRdgvS510xe9O0EN29NnZM5DUXyNR7lL2Gs8BxI8YufQvlIhxPlWS2GNopO+v+/D3A 3DsDv/G8PeMDE5sAmezdMiHH0na+nTXh+VU3Qjxer0xPNOcXIKfRDn3I7oK0OxUTuvCM 1+i54i2sRxfipotszs8F6vz0Q5yAQbIo2fyhCmhUgLtw0mPnue5bVENaa0j659wL+6DG TB9A== X-Forwarded-Encrypted: i=1; AJvYcCWOqxjIzCkvk2vQd57x9rXCqvtJ71Lt1f5TqDuGK+Hcv4VaMFoqnj1dCliNhQ896R83nvFDbFZfGYHv4g==@lists.postgresql.org X-Gm-Message-State: AOJu0YxPAKCoxmx/vqunmOpBJ7YVhNJl28zH6xeeXlgiSX47meR/40TC apFdeK0gSUBPfqlLFEovYh572BQCEijrSzOkj10tVKB7PSUEBPZSRQKiAh3CsHqcjL5T9UgZNyX xrOcQr1HLFnRwV1Bt30kzmB7f1eI= X-Google-Smtp-Source: AGHT+IGjpiDESnV33fnf6yY8GVuIREFUMOibfoHCAEGSjgnIoGc2Qgq+gV9Dz0LIxRwp8MGHo8vHpK5/O46WwRNJIxg= X-Received: by 2002:a05:6512:3ca0:b0:53d:a9b9:fdc0 with SMTP id 2adb3069b0e04-53dab2a845fmr3341288e87.31.1731764500518; Sat, 16 Nov 2024 05:41:40 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Erik Serrano Date: Sat, 16 Nov 2024 10:41:29 -0300 Message-ID: Subject: Re: PostgreSQL historical database To: Rui DeSousa Cc: Keith Fiske , Samed YILDIRIM , Pgsql-admin , pgsql-admin Content-Type: multipart/alternative; boundary="000000000000e35ebf062707d7bc" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e35ebf062707d7bc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Muchas gracias, Michel . Saludos El vie, 15 nov 2024, 19:52, Rui DeSousa escribi=C3=B3: > > > On Nov 5, 2024, at 1:15 PM, Keith Fiske > wrote: > > I would first recommend looking into partitioning for managing data > retention like this. > > > I don=E2=80=99t think you need partitioning. The is so many ways to slic= e this > problem. > > You need some form of logical replication. I=E2=80=99ve used both of the= se > methods in the past to do exactly the issue at hand. These are not the > only solutions. > > 1, Queue tables via triggers and then asynchronous replicate those > transaction to the archive database in real time. > 2. Messages queues; Modern application make use of massage queues; Just > attach the archive database to the same message queue. > > I don=E2=80=99t see a need for partitioning. I managed a Muti-terabyte c= ontent > delivery platform where the data was only licensed between 30 to 90 days. > Records where being purged more or less just as fast as new records were > being created. In essence the database was completely reloaded with new > data every 30-90 days depending on the data stream. We did no use any fo= rm > of partitioned tables and had no performance issues. > > --000000000000e35ebf062707d7bc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Muchas gracias, Michel .=C2=A0 Saludos


El vie= , 15 nov 2024, 19:52, Rui DeSousa <= rui@crazybean.net> escribi=C3=B3:

=

On Nov 5, 2024, at 1:15 PM, Keith F= iske <keith.fiske@crunchydata.com> wrote:

= I would first recomm= end looking into partitioning for managing data retention like this.=

I don=E2=80=99t think you need partitioni= ng.=C2=A0 The is so many ways to slice this problem. =C2=A0

<= /div>
You need some form of logical replication.=C2=A0 I=E2=80=99ve use= d both of these methods in the past to do exactly the issue at hand.=C2=A0 = These are not the only solutions.

1, Queue tables = via triggers and then asynchronous replicate those transaction to the archi= ve database in real time.=C2=A0
2. Messages queues; Modern applic= ation make use of massage queues; Just attach the archive database to the s= ame message queue.

I don=E2=80=99t see a need for = partitioning.=C2=A0 I managed a Muti-terabyte content delivery platform whe= re the data was only licensed between 30 to 90 days.=C2=A0 Records where be= ing purged more or less just as fast as new records were being created.=C2= =A0 In essence the database was completely reloaded with new data every 30-= 90 days depending on the data stream.=C2=A0 We did no use any form of parti= tioned tables and had no performance issues.

--000000000000e35ebf062707d7bc--