Advanced Search
Search Results
164 total results found
Notes
IaaS and PaaS IaaS delivers on-demand infrastructure resources vis the cloud, it provide raw compute, storage, and network capabilities, organized virtually into resources that are similar to physical data centers. Compute Engine is an example of a Googl...
Terraform Notes
Template for Terraform GCP config file? terraform { required_providers { google = { source = "hashicorp/google" version = "4.51.0" } } } provide "google" { project = "logan-dev1" } resource ... How to declare a vari...
Q&A
What does SQL Proxy provide? a secure way to access Cloud SQL instances without having to allowlist IP addresses or configure SSL.Secure connections (automatic traffic encryption and SSL certification encryption) and easier connection management (automatic au...
gcloud notes
Universals # the cheat sheet $ gcloud cheat-sheet # initialize gcloud $ gcloud init # get gcloud version $ gcloud version # gcloud components $ gcloud components install $ gcloud components update # gcloud info $ gcloud info # gcloud help...
Markdown CheatSheet
Basic Syntax These are the elements outlined in John Gruber’s original design document. All Markdown applications support these elements. Refenced from here: click Syntax Description Heading # H1 ##H2 ### H3 Bold **bold text** Italic *italicized ...
OpenAPI V3.0 Syntax CheatSheet
OpenApi 3.0 specification in Yaml format contents can be written in separate files, and referenced with $ref: "./schemas/User.yaml" syntax Example: # Version of the openapi specificaiton openapi: 3.0.0 # General metadata about this app info: version: 1.0.0...
GORM CheatSheet
Import import ( "gorm.io/driver/mysql" "gorm.io/driver/postgres" "gorm.io/gorm" ) func main() { // MYSQL: // refer https://github.com/go-sql-driver/mysql#dsn-data-source-name for details dsn := "user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4...
Golang CheatSheet
Zero Values integer: 0 float: 0.0 boolean: false strings: "" channel, map, slice, pointer, function, interface: nil // MD5 hashing example: import ( "crypto/md5" "encoding/hex" ) func GetMD5Hash(text string) string { hasher := md5.New() ...
Proto3 CheatSheet
Why Protocol Buffers? Protocol buffers are Google's language-independent, platform-independent, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then y...
PostgreSQL CheatSheet
PostgreSQL is: open sourced supports both relational and non-relational (JSON) queries for dynamic websites and web applications Why are there schemas in each database? To better organize tables, create modules, and use RBAC Public is the default schema Som...
Inheritance Pattern
To apply the Inheritance Pattern to documents in a collection, you can use the aggregation framework. This first example updates all book documents with a new “product type” field to identify the shape of the ebook, printed book, and audiobook documents. The p...
Finance
ISO 20022 a international standard for communication in financial systems. widely adopted by financial institutes world wide clear standardized format, efficient, real-time processing (RTP), flexible, example: <Document> <CstmrCdtTrf> <GrpHdr> <M...
Don't Communicate by Sharing Memory, Share Memory by Communicating
Mutex
What is it mutual exclusion a synchronization primitive used in concurrent programming to ensure that only one thread can access a shared resource at a time How it works Locking: a thread that needs to access a sahred resource acquires the mutex lock if th...
Goroutine
Goroutines are not threads The Go runtime efficiently manages a pool of OS threads to execute many goroutines. It intelligently schedules goroutines onto these threads, switching between them as needed. This multiplexing allows for highly concurrent applicat...
Concurrency vs Parallelism
Computed Pattern
Use Case: running a function frequently degrade performance, for example: calculate the average rating whenever a new review is submitted. Mathematical Operation: store avg and # of reviews. then update the rating: (avg_rating * #reviews + new_rating) / (#r...
Approximation Pattern
When data is changing constantly, and exact statistic is not critical, we can use approximations with a decent level of accuracy.
Extended Reference Pattern
Joins are expensive so store some must have data into the child to avoid joins. This creates data duplicate, yes, but it's an expense we can pay in exchange for performance. Duplicated data should not change frequently in nature. If data needs to be updated, ...
Schema Versioning Pattern
add a schema_version field to the document To Handle multiple versions: application handles both old and new version run a background task to update all documents to new version once migrated to new verion, remove code that handles old version