Skip to content

Instantly share code, notes, and snippets.

View mezzomondo's full-sized avatar

Miki Fossati mezzomondo

  • Amarti
  • London, UK
View GitHub Profile
@mezzomondo
mezzomondo / aurora_vertical_scaling.md
Last active October 10, 2023 12:32
Automatic vertical scaling of an Aurora cluster

The problem (AKA don't waste money)

One of my clients is a big company that has a very variable but predictable database usage pattern. In the weekdays morning they come up with a huge amount of INSERTs and UPDATEs while for the rest of the day, form noon on, the usage is fairly limited to a decent amount of SELECTs with very low writing activity. The smallest class type that can handle the morning's volume is db.r3.large but having such an instance running all day long and in the weekends is just a big waste of resources money (or a big favour we do to Amazon, from their point of view).

The solution

So I was wondering if there's some autoscaling mechanism for Aurora writers (there is, but only for replicas),

@mezzomondo
mezzomondo / maybe.py
Last active May 21, 2019 09:32
Datatypes (attr), sum types (sumtypes) and pattern matching (pampy) in Python 3.7
from attr import attrs, attrib, validators
from sumtypes import sumtype, constructor
from pampy import match
from typing import Any, Dict
@attrs
class Valid:
valid_id: int = attrib()
valid_description: str = attrib()