I am working on a highload system, which needs to process quite a lot of events, but not an insanely huge amount. The data ingested has to be editable during a short period of time, and then the need for editing diminishes. I want to store that data in a cache while it's "hot", and then save it to PG when the data "cools down". I want to be able to partition my tables based on the dates, and drop partitions as they expire. This way I try to avoid update and delete related vacuum. Thus I need to be able to assign record ids in my cache, but such that they don't conflict in the db.
PG's bigserial type is so big that I can use nanosecond precision timestamps and have the last three digits to use as random "tie brake", and that will last me till 2262. I will be able to partition my main table on its primary key and the related table on their foreign keys, thus keeping my related data in the same partitions.
Is it a good idea?