pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
best way to write large data-streams quickly?
4+ messages / 3 participants
[nested] [flat]

* best way to write large data-streams quickly?
@ 2018-04-09 15:49  Mark Moellering <markmoellering@psyberation.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Mark Moellering @ 2018-04-09 15:49 UTC (permalink / raw)
  To: pgsql-general

Everyone,

We are trying to architect a new system, which will have to take several
large datastreams (total of ~200,000 parsed files per second) and place
them in a database.  I am trying to figure out the best way to import that
sort of data into Postgres.

I keep thinking i can't be the first to have this problem and there are
common solutions but I can't find any.  Does anyone know of some sort
method, third party program, etc, that can accept data from a number of
different sources, and push it into Postgres as fast as possible?

Thanks in advance,

Mark Moellering

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: best way to write large data-streams quickly?
@ 2018-04-09 16:01  Steve Atkins <steve@blighty.com>
  parent: Mark Moellering <markmoellering@psyberation.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Steve Atkins @ 2018-04-09 16:01 UTC (permalink / raw)
  To: pgsql-general


> On Apr 9, 2018, at 8:49 AM, Mark Moellering <markmoellering@psyberation.com> wrote:
> 
> Everyone,
> 
> We are trying to architect a new system, which will have to take several large datastreams (total of ~200,000 parsed files per second) and place them in a database.  I am trying to figure out the best way to import that sort of data into Postgres.  
> 
> I keep thinking i can't be the first to have this problem and there are common solutions but I can't find any.  Does anyone know of some sort method, third party program, etc, that can accept data from a number of different sources, and push it into Postgres as fast as possible?

Take a look at http://ossc-db.github.io/pg_bulkload/index.html. Check the benchmarks for different situations compared to COPY.

Depending on what you're doing using custom code to parse your data and then do multiple binary COPYs in parallel may be better.

Cheers,
  Steve





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: best way to write large data-streams quickly?
@ 2018-04-10 14:17  Mark Moellering <markmoellering@psyberation.com>
  parent: Steve Atkins <steve@blighty.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Mark Moellering @ 2018-04-10 14:17 UTC (permalink / raw)
  To: ; +Cc: pgsql-general

On Mon, Apr 9, 2018 at 12:01 PM, Steve Atkins <steve@blighty.com> wrote:

>
> > On Apr 9, 2018, at 8:49 AM, Mark Moellering <markmoellering@psyberation.
> com> wrote:
> >
> > Everyone,
> >
> > We are trying to architect a new system, which will have to take several
> large datastreams (total of ~200,000 parsed files per second) and place
> them in a database.  I am trying to figure out the best way to import that
> sort of data into Postgres.
> >
> > I keep thinking i can't be the first to have this problem and there are
> common solutions but I can't find any.  Does anyone know of some sort
> method, third party program, etc, that can accept data from a number of
> different sources, and push it into Postgres as fast as possible?
>
> Take a look at http://ossc-db.github.io/pg_bulkload/index.html. Check the
> benchmarks for different situations compared to COPY.
>
> Depending on what you're doing using custom code to parse your data and
> then do multiple binary COPYs in parallel may be better.
>
> Cheers,
>   Steve
>
>
>
(fighting google slightly to keep from top-posting...)

Thanks!

How long can you run COPY?  I have been looking at it more closely.  In
some ways, it would be simple just to take data from stdin and send it to
postgres but can I do that literally 24/7?  I am monitoring data feeds that
will never stop and I don't know if that is how Copy is meant to be used or
if I have to let it finish and start another one at some point?

Thanks for everyones' help and input!

Mark Moellering

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: best way to write large data-streams quickly?
@ 2018-04-10 18:09  Jerry Sievers <gsievers19@comcast.net>
  parent: Mark Moellering <markmoellering@psyberation.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Jerry Sievers @ 2018-04-10 18:09 UTC (permalink / raw)
  To: Mark Moellering <markmoellering@psyberation.com>; +Cc: pgsql-general

Mark Moellering <markmoellering@psyberation.com> writes:

<snip>

>
> How long can you run COPY?  I have been looking at it more closely. 
> In some ways, it would be simple just to take data from stdin and
> send it to postgres but can I do that literally 24/7?  I am
> monitoring data feeds that will never stop and I don't know if that
> is how Copy is meant to be used or if I have to let it finish and
> start another one at some point? 

Launch a single copy and pipe data into it for an extended period an/or
bulk is fine but nothing will be visible until the statement is finished
and, if it were run in a transaction block, the block committed.

HTH

>
> Thanks for everyones' help and input!
>
> Mark Moellering
>
>
>
>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 312.241.7800




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2018-04-10 18:09 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-04-09 15:49 best way to write large data-streams quickly? Mark Moellering <markmoellering@psyberation.com>
2018-04-09 16:01 ` Steve Atkins <steve@blighty.com>
2018-04-10 14:17   ` Mark Moellering <markmoellering@psyberation.com>
2018-04-10 18:09     ` Jerry Sievers <gsievers19@comcast.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox