the old one: http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang/
| const { LRUCache } = require('lru-cache') | |
| const options = { | |
| max: 500, | |
| // for use with tracking overall storage size | |
| maxSize: 5000, | |
| sizeCalculation: (value, key) => { | |
| // any key/value will be sized as 1 | |
| // this one is just dump |
| # Example One: spec/unit/lib/space/flight/ship_gateway_spec.rb | |
| RSpec.describe Space::Flight::ShipGateway do | |
| let(:ship) { FactoryBot.create(:ship) } | |
| let(:gateway) { described_class.new(ship_repository: Ship) } | |
| context 'when finding a ship by id' do | |
| subject { gateway.find_by_id(ship.id) } | |
| it 'returns ship with correct id' do |
| Pulled: registry-1.docker.io/bitnamicharts/postgresql-ha:14.2.16 | |
| Digest: sha256:ef8126d9334d30fd22140b5b26cc6b454d81a0832ca9fc12344d036cc79aef57 | |
| NAME: postgresql-ha | |
| LAST DEPLOYED: Fri Aug 9 17:57:00 2024 | |
| NAMESPACE: postgresql | |
| STATUS: deployed | |
| REVISION: 1 | |
| TEST SUITE: None | |
| NOTES: | |
| CHART NAME: postgresql-ha |
| // Ref: https://blog.golang.org/pipelines | |
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| ) | |
| func gen(done <-chan struct{}, nums ...int) <-chan int { |
rsync (Everyone seems to like -z, but it is much slower for me)
- a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
- H: preserves hard-links
- A: preserves ACLs
- ~50GB MySQL Application
- Main motivation: PostGis
- Migration made with a custom tool(xml2pgcopy) and mysqldump on 45min
When querying your database in Sequelize, you'll often want data associated with a particular model which isn't in the model's table directly. This data is usually typically associated through join tables (e.g. a 'hasMany' or 'belongsToMany' association), or a foreign key (e.g. a 'hasOne' or 'belongsTo' association).
When you query, you'll receive just the rows you've looked for. With eager loading, you'll also get any associated data. For some reason, I can never remember the proper way to do eager loading when writing my Sequelize queries. I've seen others struggle with the same thing.
Eager loading is confusing because the 'include' that is uses has unfamiliar fields is set in an array rather than just an object.
So let's go through the one query that's worth memorizing to handle your eager loading.