Start a MySQL DB:
docker run -d --name local-mysql -v mysql:/var/lib/mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root mysql:5.7Start a PostgresSQL DB:
| # Add in ~/.bashrc or ~/.bash_profile | |
| function parse_git_branch () { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
| } | |
| RED="\[\033[01;31m\]" | |
| YELLOW="\[\033[01;33m\]" | |
| GREEN="\[\033[01;32m\]" | |
| BLUE="\[\033[01;34m\]" | |
| NO_COLOR="\[\033[00m\]" |
| #!/bin/bash | |
| # Author: Daniel Alvarenga Lima | |
| # Ubuntu version supported: 18.04 LTS 64Bit | |
| # EXECUTE | |
| # sudo chmod +x script-configure-ubuntu18.94-amd64.sh | |
| # ./script-configure-ubuntu18.94-amd64.sh | |
| #INSTRUCTIONS |
| #!/bin/bash | |
| # Author: Daniel Alvarenga Lima | |
| # Ubuntu version supported: 20.04 LTS amd64 | |
| # EXECUTE | |
| # sudo chmod +x script-configure-ubuntu18.94-amd64.sh | |
| # ./script-configure-ubuntu20.04-amd64.sh | |
| #INSTRUCTIONS |
| package fileline | |
| import ( | |
| "fmt" | |
| "os" | |
| "runtime" | |
| "strings" | |
| ) | |
| //Location returns an absolute path of the caller file and the line number. |
| # Puma can serve each request in a thread from an internal thread pool. | |
| # The `threads` method setting takes two numbers: a minimum and maximum. | |
| # Any libraries that use thread pools should be configured to match | |
| # the maximum value specified for Puma. Default is set to 5 threads for minimum | |
| # and maximum; this matches the default thread size of Active Record. | |
| # More: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#threads | |
| # | |
| threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } | |
| threads threads_count, threads_count |
Binary UUIDs are much more efficient in space and lookups compared to VARCHAR or CHAR UUIDs. To better exmplain how they work I have a few examples of raw sql and how that translates in a programming language like Ruby using the UUID tools module. All examples will reference the following database table and schema.
Table name: users
id :uuid(16)
first_name :string(255)
last_name :string(255)