MongoDB Capped collection equivalent in PostgreSQL -
the basics of mongodb capped collections let set maximum size of table , system clear old data when size limit reached.
has came similar setup in postgresql , used in production?
haven't heard of that. guess simulate capped table size or circular queue using:
- upserts
- and modulo operator on sequence (see insert, on duplicate update in postgresql? explanation on how merge/upsert)
especially interesting (from perspective) bovine's response (ie @ non-accepted answers).
with introduction of column table represent index "collection" , sequence column, each upsert can based on condition:
where index = (sequence.nextval % max collection size)
Comments
Post a Comment