Re: schema advice for event stream with tagging and filtering

From: Venkata B Nagothi <nag1010(at)gmail(dot)com>
To: Chris Withers <chris(at)simplistix(dot)co(dot)uk>
Cc: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: schema advice for event stream with tagging and filtering
Date: 2016-08-17 04:07:29
Message-ID: CAEyp7J918B+FYcbNsYXe5QvTRWynibvdc9DG6QkhoWMczY3JOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Aug 16, 2016 at 6:38 PM, Chris Withers <chris(at)simplistix(dot)co(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sameer Kumar 2016-08-17 04:09:46 Re: Running pg_dump from a slave server
Previous Message Venkata B Nagothi 2016-08-17 04:00:47 Re: Running pg_dump from a slave server