The memcached protocol over UDP has a huge amplification factor, of more than 51000. Victims of the DDoS attacks include GitHub, which was flooded with 1.35 Tbit/s peak incoming traffic. This issue was mitigated in Memcached version 1.5.6, which disabled UDP protocol by default. "Note that all functions described on this page are pseudocode only. Memcached calls and programming languages may vary based on the API used." Converting database or object creation queries to use Memcached is simple. Typically, when using straight database queries, example code would be as follows: After conversion to Memcached, the same call might look like the following  The client would first check whether a Memcached value with the unique key "userrow:userid" exists, where userid is some number. If the result does not exist, it would select from the database as usual, and set the unique key using the Memcached API add function call. However, if only this API call were modified, the server would end up fetching incorrect data following any database update actions: the Memcached "view" of the data would become out of date. Therefore, in addition to creating an "add" call, an update call would also be needed using the Memcached set function. This call would update the currently cached data to match the new data in the database, assuming the database query succeeds. An alternative approach would be to invalidate the cache with the Memcached delete function, so that subsequent fetches result in a cache miss. Similar action would need to be taken when database records were deleted, to maintain either a correct or incomplete cache. An alternate cache-invalidation strategy is to store a random number in an agreed-upon cache entry and to incorporate this number into all keys that are used to store a particular kind of entry. To invalidate all such entries at once, change the random number. Existing entries (which were stored using the old number) will no longer be referenced and so will eventually expire or be recycled.