Cool, I’ll give that a try. In case I wasn’t clear earlier, I planned on keeping every tag as another bin and adding secondary indexes on them… querying this system by the tags’ values is the whole point. (In case you’re curious, we’re trying to implement something very similar to KairosDB, InfluxDB, or Prometheus, but we need these atomic increments, which none of these systems have).
Which leads me to my question about increment behavior… can I increment records with multiple bins or just the one I want to store the number I’m incrementing? I came up with some code to try what I thought would work but didn’t to try to highlight what I’m asking:
brand = 'awesomesauce' metric = 'updates' ts = 1425412470000 attributes = { 'passed':'F', 'channel':'WEB', 'mode':'DEFAULT', 'guid':'cmE2SAhY', 'updated':'F' } uniq_string_ts = 'awesomesauce:updates:1425412470000:passed=F,channel=WEB,mode=DEFAULT,guid=cmE2SAhY,updated=F' as_key = (AS_NS, AS_SET, uniq_string_ts) value = 3 record = attributes record['value'] = value record['ts'] = ts record['brand'] = brand record['metric'] = metric def put(): try: client.put(as_key, record) client.increment(as_key, 'value', value) except Exception as e: print "Problem incrementing in Aerospike.. exception was: %s" % str(e) def inc(): try: client.increment(as_key, 'value', value) except Exception as e: print "Problem incrementing in Aerospike.. exception was: %s" % str(e) def read(): (key, meta, r) = client.get(as_key) print "record of key: %s" % r
Is there a way I can combine the increment and put? Because when I try something like putting the entire record as another parameter in the increment call it doesn’t seem to include any more data in the record…