Re: schema advice for event stream with tagging and filtering - Mailing list pgsql-general

From Venkata B Nagothi
Subject Re: schema advice for event stream with tagging and filtering
Date
Msg-id CAEyp7J918B+FYcbNsYXe5QvTRWynibvdc9DG6QkhoWMczY3JOw@mail.gmail.com
Whole thread Raw
In response to schema advice for event stream with tagging and filtering  (Chris Withers <chris@simplistix.co.uk>)
List pgsql-general

On Tue, Aug 16, 2016 at 6:38 PM, Chris Withers <chris@simplistix.co.uk> wrote:
Hi All,

What would be the best schema to use when looking to implement an event stream with tagging and filtering?

An event is a row with a primary key along the lines of (colo, host, category) and an associated set of tags, where each tag has a type and a value (eg: {"color": "red", "owner": "fred", "status": "open"...}).

Events come in as a streams of creates/updates as a cluster of http posts to a web app.

Not sure which version of PostgreSQL you are using. Did you consider JSON/JSONB data-types which is strongly supported by PostgreSQL ? You can consider having a table with JSON or JSONB column type. If you can use JSONB, then, it supports indexing as well.

That should make web app easy to push JSON format data to PostgreSQL.

Regards,
Venkata B N

Fujitsu Australia

pgsql-general by date:

Previous
From: Venkata B Nagothi
Date:
Subject: Re: Running pg_dump from a slave server
Next
From: Sameer Kumar
Date:
Subject: Re: Running pg_dump from a slave server