Write/get filter chain to database