Skip to content

Instantly share code, notes, and snippets.

@zmagg
zmagg / gist:e7307ea2adf6cd510e95
Created January 17, 2015 06:22
scaleconf proposal

Etsy started with a monolithic Postgres database and moved to a horizontally sharded MySQL store with a lookup table and master-master replication. Scaling your data store is never easy as just adding more hardware though, even with sharding.

In this talk, we'll go over the pains and perils of sharding databases and how we solved some of the problems in Etsy's second take on sharding, what we call logical sharding. Logical sharding is where we put several databases on one mysqld, as opposed to one database per server. Upon hitting a resource limit on a box (CPU, Memory, Connections, etc) that would normally require individual row migration, we can instead do file level migrations of a database, replicate, then drop previous databases, which is super fast and a cleaner way to delete old unnecessary shard data. We'll also go over how logical sharding benefits other daily operational challenges like schema changes and backups, as well as simplies life for developers and makes life easier for downstream data wa

@zmagg
zmagg / gist:0f25e57f950dd2963ebd
Last active October 24, 2015 14:35
montreal recs
vegetarian friendly:
BAGELS (fairmount / st viateur)
arepera du plateau (delicious)
bangkok (thai food in a food court) maja knows a thai place that delivers though I think!
burritoville (adorable vegan place with sweet potato burritos and lemonade)
la panthere verte (my favorite falafels in montreal; mostly vegan). several locations.
omnivore (hummus and eggplant dips and tasty salads <3)
ice cream: MuuMuu and kem coba are both excellent.
indian food in park extension (bombay mahal or maison indian curry; they're across the street from each other)
@zmagg
zmagg / gist:03bfbe561d48326ffe0b
Created December 1, 2014 06:45
freud & lacan
freud --- civilization and its discontents
freud --- the new introductory lectures on psycho-analysis
lacan --- seminars (choose 2)
( a few other essays, TBD)
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
# bash history
export HISTSIZE=20000
shopt -s histappend
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
alias gdiff='gist -t diff'
syntax on
set number
filetype plugin on
set nocompatible
set modelines=0
filetype plugin indent on
syntax on
set expandtab
@zmagg
zmagg / GuavaCollection2
Created August 23, 2013 21:04
share guava test file.
import com.google.common.base.Predicates;
import com.google.common.collect.Collections2;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import static java.lang.System.out;
/**
@zmagg
zmagg / word_games.py
Last active December 21, 2015 02:38
hacker school mini improvised contest for the fastest solution to find what words are the longest anagrams of each other (single words, please, no phrases) in the sowpods scrabble dictionary.
f = open("sowpods.txt", "r")
canonized_words = {}
word1 = ""
word2 = ""
max_len = 0
for line in f:
if len(line) > max_len:
sorted_word = ''.join(sorted(line))