pgmemcache: PostgreSQL memcache function

memcache_add(key::TEXT, value::TEXT, expire::TIMESTAMPTZ)
memcache_add(key::TEXT, value::TEXT, expire::INTERVAL)
memcache_add(key::TEXT, value::TEXT)

Adds a key to the cache cluster, if the key does not already exist.

newval = memcache_decr(key::TEXT, decrement::INT8)
newval = memcache_decr(key::TEXT)

If key exists and is an integer, atomically decrements by the value specified (default decrement is one). Returns INT value after decrement.

What are advantages of using transaction pooling with pgbouncer?

Transaction-level pooling will help if you have apps that hold idle sessions. PgBouncer won’t need to keep sessions open and idle, it just grabs one when a new transaction is started. Those idle sessions only cost you a pgbouncer connection, not a real idle Pg session with a backend sitting around wasting memory & synchronisation overhead doing nothing.

The main reason you’d want session pooling instead of transaction pooling is if you want to use named prepared statements, advisory locks, listen/notify, or other features that operate on a session level not a transaction level.

CAP Twelve Years Later: How the “Rules” Have Changed

The easiest way to understand CAP is to think of two nodes on opposite sides of a partition. Allowing at least one node to update state will cause the nodes to become inconsistent, thus forfeiting C. Likewise, if the choice is to preserve consistency, one side of the partition must act as if it is unavailable, thus forfeiting A. Only when nodes communicate is it possible to preserve both consistency and availability, thereby forfeiting P. The general belief is that for wide-area systems, designers cannot forfeit P and therefore have a difficult choice between C and A. In some sense, the NoSQL movement is about creating choices that focus on availability first and consistency second; databases that adhere to ACID properties (atomicity, consistency, isolation, and durability) do the opposite. The “ACID, BASE, and CAP” sidebar explains this difference in more detail.

.. Finally, all three properties are more continuous than binary. Availability is obviously continuous from 0 to 100 percent, but there are also many levels of consistency, and even partitions have nuances, including disagreement within the system about whether a partition exists.