ops + it ops aws ec2 [AWS] ๐ EC2 ์๊ธ ๋ชจ๋ธ ๐ฐ ์ ๋ง ์๊ธฐ ์ฝ๊ฒ ์ค๋ช EC2 4๊ฐ์ง ๊ฐ๊ฒฉ ๋ชจ๋ธ AWS EC2 ์ธ์คํด์ค์ ๋ํ ์๊ธ์ ์ง๋ถํ๋ ๋ฐฉ๋ฒ์๋ ์จ ๋๋งจ๋ ์ธ์คํด์ค, ์์ฝ ์ธ์คํด์ค, ์คํ ์ธ์คํด์ค ๋ฐ ์ ์ฉ ํธ์คํธ์ ๋ค ๊ฐ์ง ๋ฐฉ๋ฒ์ด ์กด์ฌํ๋ค. ์ด๋ ๊ฒ ๊ฐ๊ฒฉ ๋ชจ๋ธ์ ๋๋ ์ด๋ด๋ ์ผ์ข ์ ๋ง์ผํ ์ ๋ต์ด๋ผ๊ณ ๋ณด๋ฉด ๋๋ค. ๋์ ์๋น์ ์ ์ฅ์์๋ ๋์ฑ ์ ๋ ดํ๊ฒ ํ์ํ ๋๋ง ์ธ์ ์์ด ์ฌ์ฉ๋ ์๊ธ์ ์ ์ฝํ ์ ์์ผ๋, ํด๋ผ์ฐ๋๋ฅผ ์ฌ์ฉํ๋ค๊ณ ๋ง์์ ๋จน์๋ค๋ฉด, aws ๊ฐ๊ฒฉ์ ์ฑ ๋ชจ๋ธ์ ๋ํด์ ์ดํด๋ ํ์์ด๋ผ๊ณ ๋ด๋ ๋๋ค. AWS EC2 ์๊ธ์ ์ง๋ถํ๋ ๋ฐฉ์์ด AWS ๊ณต์์ฌ์ดํธ์๋ ๋ช ์๋์ด ์์ง๋ง, ๋ณด๋ค ๋ช ํํ๋ฉด์๋ ์ดํด๋๊ธฐ ์ฝ๊ฒ ์ฌ์ ๋ฆฌ ํด๋ณธ๋ค. ์จ ๋๋ฉ๋ (On-Demand Pricing) ์จ ๋๋งจ๋ ์ธ์คํด์ค๋ฅผ ์ฌ์ฉํ๋ฉด ์คํํ๋ ์ธ์คํด์ค์ ๋ฐ๋ผ ์๊ฐ๋น ๋๋ ์ด๋น ์ปดํจํ ์ฉ๋์ ์ง๋ถํ๊ฒ ๋๋ค.. wono | discuss | tweet + it ops db mysql dump mysql DUMP์ฌ์ฉdump ์ต์ โsingle-transaction :ย dump๋ฅผ ํ๋์ ํธ๋์ญ์ ์ ์ด์ฉํด์ ์คํํจ (InnoDB ์คํ ๋ฆฌ์ง ์์ง์ ์ฌ์ฉํ๋ ํ ์ด๋ธ์ ๋ํด์๋ Lock์์ด ์ผ๊ด๋ ๋คํ๋ฅผ ๋ฐ์ ์ ์์). ์์ธํ ๋ด์ฉ์ ์๋ โ์ผ๊ด๋ ๋ฐ์ดํฐ ๋คํ ๋ฐ๊ธฐโ ์ฐธ์กฐ โflush-logs :ย dump๋ฅผ ์์ํ๋ ์์ ์ binary log๋ฅผ rotation ์ํค๋๋ก ํ๋ค. Binary log๋ฅผ ์ฆ๋ถ ๋ฐฑ์ ์ฉ์ผ๋ก ์ฌ์ฉํ๋ ๊ฒฝ์ฐ, ํ๋ฐฑ์ ๊ณผ ์ฆ๋ถ ๋ฐฑ์ ์ ๊ตฌ๋ถ์ ๋ช ํํ ํ ์ ์๋ค. โmaster-data :ย ์ดโฆ wono | discuss | tweet + it ops db mysql dump mysqldump ์ฌ์ฉ์ ์ฃผ์์ mysqldump๋ mysql, mariadb ์์ ๋ฐ์ดํฐ ๋ฐฑ์ ์ ์ฃผ๋ก ์ฌ์ฉํ๋ ๋ฐฑ์ ๋ฐฉ๋ฒ ์ค ํ๋์ด๋ค. ๊ฐ๋ฐ DB์์ ์ฌ์ฉํ ๋๋ ๋ฌธ์ ๊ฐ ์์ง๋ง ์๋น์ค DB์์ ์ด๊ฑธ ์ฌ์ฉํ๋ค๋ฉด ํ๊ฐ์ง ์ฃผ์ํ ์ ์ด ์๋ค. ๋ชจ๋ฅด๊ณ ๊ทธ๋ฅ ์ฌ์ฉํ๊ฒ ๋๋ค๋ฉด TABLE LOCK ๋๋ฌธ์ ์๋น์ค ์ฅ์ ๋ฅผ ์ผ์ผํฌ ์ ์๋ค. mysqldump๋ ์ฌ๋ฌ ์ต์ ์ด ์๋๋ฐ ๊ทธ๊ฒ์ ๋ชจ๋ฅด๊ณ default ์ต์ ๋ง ๋๊ณ ์ฌ์ฉํ๋ค๋ฉด ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ค. 1. default ์ต์ ์ฌ์ฉ์ ex) mysqldump -uroot -p๋น๋ฒ xxxxDB TB_TEST_HIST > TB_TEST_HIST_20230110.sql MariaDB [(none)]> show processlist; +----------+-------------+---------------------.. wono | discuss | tweet + it ops db mysql dump [Mysql] mysql dump ์ฌ์ฉ๋ฒ๋ฐ์ดํฐ ๋ฐฑ์ : mysqldump๋ ๋ชจ๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค ํ ์ด๋ธ์ ๋ด์ฉ์ SQL ๋ช ๋ น์ผ๋ก ์ถ์ถํ์ฌ, ์ด๋ฅผ ํตํด ํ ์ด๋ธ ์์ฑ๊ณผ ๋ฐ์ดํฐ ์ฝ์ ์ ํ ์ ์๋ SQL ์คํฌ๋ฆฝํธ๋ฅผ ์์ฑํฉ๋๋ค.๋ฐ์ดํฐ ๋ณต์ : ์์ฑ๋ ๋คํ ํ์ผ์ mysql ๋ช ๋ น์ด ๋ผ์ธ ์ ํธ๋ฆฌํฐ๋ฅผ ์ฌ์ฉํ์ฌ MySQL ๋ฐ wono | discuss | tweet + it ops db postgresql varchar Don't Do This - PostgreSQL wiki wono | discuss | tweet + it ops db postgresql Should I add an arbitrary length limit to VARCHAR columns?According to PostgreSQL's docs, there's no performance difference between VARCHAR, VARCHAR(n) and TEXT. Should I add an arbitrary length limit to a name or address column? Edit: Not a dupe of: W... wono | discuss | tweet + it ops code error Differences in Javascript with throwing and return errorThis blog is to differentiate the throwing an error with returning an error. In project, I found different people have different ways of handling errors, but when people work together, this kind ofโฆ wono | discuss | tweet + it ops code error Why is it better to throw an exception rather than return an error code?Legacy error handling tends to follow the method that all functions return a code depending on success/failure. You would check this code and handle (if an error) appropriately. Modern programming wono | discuss | tweet + it ops db plpgsql PL/pgSQL์ ๊ตฌ์กฐ - Amazon RedshiftAmazon Redshift์์ ์ฌ์ฉ๋๋ PL/pgSQL ์ธ์ด์ ๊ตฌ์กฐ์ ๋ํด ์์๋ด ๋๋ค. wono | discuss | tweet + it ops db uuid tsid ๋ถ์ฐ ํ๊ฒฝ์์ P.K๋ ์ด๋ค ์ ๋ต์ผ๋ก ๊ฐ์ ธ๊ฐ๋ฉด ์ข์๊น?๋ณดํต ๋ด๊ฐ ์งํํ๋ ํ๋ก์ ํธ์์๋ ๋จ์ผ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ฌ์ฉํ๊ฑฐ๋, ๋จ์ผ ์์คํ ์์ ๋์ํ๊ธฐ์, auto_increment P.K ์ ๋ต์ ๊ฐ์ ธ๊ฐ๋ ์ค๋ณต๋ ๊ฐ์ด ์กด์ฌํ๋ ๊ฒฝ์ฐ๊ฐ ๊ฑฐ์ ์๊ธฐ ๋๋ฌธ์ ๋ฌธ์ ๊ฐ ๋์ง ์์๋ค. ํ์ง๋ง ๋๊ท๋ชจ ๋ถ์ฐ ์ฒ๋ฆฌ ์์คํ ์ผ ๋๋ ์ด ์๋ ์ฆ๊ฐ ์ wono | discuss | tweet + it ops db id pk ๐ Awesome Identifiers wono | discuss | tweet + it ops db postgresql do [PostgreSQL] Function3์ด๋ฒ ์ฅ์ for๋ฌธ๊ณผ loop๋ฅผ ์ด์ฉํ์ฌ function์ ์ฌ์ฉํ๋ ๋ฒ์ ์ตํ๋ณด๋ ค๊ณ ํฉ๋๋ค. ์ฐ์ ์ ์ฒ์ฒํ ๊ฐ์ ์ก์๊ฐ๊ธฐ ์ํด ๋๋ฆ๋๋ก์ ๋์ด๋๋ฅผ ์๊ฐํ์ฌ ์ฌ์ด ๋์ด๋๋ถํฐ ์ฝ๋๋ฅผ ๋๋ ค๊ฐ๋ฉฐ ๋์ด๋๋ฅผ ๋์ฌ๋ณด๋ ค๊ณ ํฉ๋๋ค.for๋ฌธ๊ณผ loop ์ฌ์ฉ ์ฐ์ต ์ด์ ๋ํ ๊ฒฐ๊ณผ๋ก ์๋์ wono | discuss | tweet + it ops db postgresql tsid pg_random_id/lib/pg_random_id/sql/crockford-pure.sql at 0b4dc52c68b7b4aedca25e6a6cac848da7771d4a ยท arjunmenon/pg_random_idContribute to arjunmenon/pg_random_id development by creating an account on GitHub. wono | discuss | tweet + it ops db postgresql tsid Build software better, togetherGitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects. wono | discuss | tweet + it ops db postgresql pk PostgreSQL generate unique sorted IDs for timestampsPostgreSQL generate unique sorted IDs for timestamps - snowflake.sql wono | discuss | tweet + it ops db postgresql base32 Base58 Encoder function in PostgreSQL> https://www.postgresql.org/docs/9.6/functions-binarystring.html wono | discuss | tweet + it ops nextjs tsid tsid-tsA TypeScript library for generating Time-Sorted Unique Identifiers (TSID).. Latest version: 0.0.9, last published: a year ago. Start using tsid-ts in your project by running `npm i tsid-ts`. There is 1 other project in the npm registry using tsid-ts. wono | discuss | tweet + it ops db postgresql tsid How to encode a byte array to base32 in PostgreSQLI have a Java application that generates ids for primary keys by encoding cryptographically random bytes to base32 (RFC4648). How do I do the same with PostgreSQL from an SQL script? The gen_random... wono | discuss | tweet + it ops db postgresql tsid GitHub - sergeyprokhorenko/pg_ulid_comparison: Comparison of ULID generation functions for PostgreSQLComparison of ULID generation functions for PostgreSQL - sergeyprokhorenko/pg_ulid_comparison wono | discuss | tweet + it ops db postgresql tsid GitHub - schinckel/ulid-postgresContribute to schinckel/ulid-postgres development by creating an account on GitHub. wono | discuss | tweetNext
+ it ops aws ec2 [AWS] ๐ EC2 ์๊ธ ๋ชจ๋ธ ๐ฐ ์ ๋ง ์๊ธฐ ์ฝ๊ฒ ์ค๋ช EC2 4๊ฐ์ง ๊ฐ๊ฒฉ ๋ชจ๋ธ AWS EC2 ์ธ์คํด์ค์ ๋ํ ์๊ธ์ ์ง๋ถํ๋ ๋ฐฉ๋ฒ์๋ ์จ ๋๋งจ๋ ์ธ์คํด์ค, ์์ฝ ์ธ์คํด์ค, ์คํ ์ธ์คํด์ค ๋ฐ ์ ์ฉ ํธ์คํธ์ ๋ค ๊ฐ์ง ๋ฐฉ๋ฒ์ด ์กด์ฌํ๋ค. ์ด๋ ๊ฒ ๊ฐ๊ฒฉ ๋ชจ๋ธ์ ๋๋ ์ด๋ด๋ ์ผ์ข ์ ๋ง์ผํ ์ ๋ต์ด๋ผ๊ณ ๋ณด๋ฉด ๋๋ค. ๋์ ์๋น์ ์ ์ฅ์์๋ ๋์ฑ ์ ๋ ดํ๊ฒ ํ์ํ ๋๋ง ์ธ์ ์์ด ์ฌ์ฉ๋ ์๊ธ์ ์ ์ฝํ ์ ์์ผ๋, ํด๋ผ์ฐ๋๋ฅผ ์ฌ์ฉํ๋ค๊ณ ๋ง์์ ๋จน์๋ค๋ฉด, aws ๊ฐ๊ฒฉ์ ์ฑ ๋ชจ๋ธ์ ๋ํด์ ์ดํด๋ ํ์์ด๋ผ๊ณ ๋ด๋ ๋๋ค. AWS EC2 ์๊ธ์ ์ง๋ถํ๋ ๋ฐฉ์์ด AWS ๊ณต์์ฌ์ดํธ์๋ ๋ช ์๋์ด ์์ง๋ง, ๋ณด๋ค ๋ช ํํ๋ฉด์๋ ์ดํด๋๊ธฐ ์ฝ๊ฒ ์ฌ์ ๋ฆฌ ํด๋ณธ๋ค. ์จ ๋๋ฉ๋ (On-Demand Pricing) ์จ ๋๋งจ๋ ์ธ์คํด์ค๋ฅผ ์ฌ์ฉํ๋ฉด ์คํํ๋ ์ธ์คํด์ค์ ๋ฐ๋ผ ์๊ฐ๋น ๋๋ ์ด๋น ์ปดํจํ ์ฉ๋์ ์ง๋ถํ๊ฒ ๋๋ค.. wono | discuss | tweet
+ it ops db mysql dump mysql DUMP์ฌ์ฉdump ์ต์ โsingle-transaction :ย dump๋ฅผ ํ๋์ ํธ๋์ญ์ ์ ์ด์ฉํด์ ์คํํจ (InnoDB ์คํ ๋ฆฌ์ง ์์ง์ ์ฌ์ฉํ๋ ํ ์ด๋ธ์ ๋ํด์๋ Lock์์ด ์ผ๊ด๋ ๋คํ๋ฅผ ๋ฐ์ ์ ์์). ์์ธํ ๋ด์ฉ์ ์๋ โ์ผ๊ด๋ ๋ฐ์ดํฐ ๋คํ ๋ฐ๊ธฐโ ์ฐธ์กฐ โflush-logs :ย dump๋ฅผ ์์ํ๋ ์์ ์ binary log๋ฅผ rotation ์ํค๋๋ก ํ๋ค. Binary log๋ฅผ ์ฆ๋ถ ๋ฐฑ์ ์ฉ์ผ๋ก ์ฌ์ฉํ๋ ๊ฒฝ์ฐ, ํ๋ฐฑ์ ๊ณผ ์ฆ๋ถ ๋ฐฑ์ ์ ๊ตฌ๋ถ์ ๋ช ํํ ํ ์ ์๋ค. โmaster-data :ย ์ดโฆ wono | discuss | tweet
+ it ops db mysql dump mysqldump ์ฌ์ฉ์ ์ฃผ์์ mysqldump๋ mysql, mariadb ์์ ๋ฐ์ดํฐ ๋ฐฑ์ ์ ์ฃผ๋ก ์ฌ์ฉํ๋ ๋ฐฑ์ ๋ฐฉ๋ฒ ์ค ํ๋์ด๋ค. ๊ฐ๋ฐ DB์์ ์ฌ์ฉํ ๋๋ ๋ฌธ์ ๊ฐ ์์ง๋ง ์๋น์ค DB์์ ์ด๊ฑธ ์ฌ์ฉํ๋ค๋ฉด ํ๊ฐ์ง ์ฃผ์ํ ์ ์ด ์๋ค. ๋ชจ๋ฅด๊ณ ๊ทธ๋ฅ ์ฌ์ฉํ๊ฒ ๋๋ค๋ฉด TABLE LOCK ๋๋ฌธ์ ์๋น์ค ์ฅ์ ๋ฅผ ์ผ์ผํฌ ์ ์๋ค. mysqldump๋ ์ฌ๋ฌ ์ต์ ์ด ์๋๋ฐ ๊ทธ๊ฒ์ ๋ชจ๋ฅด๊ณ default ์ต์ ๋ง ๋๊ณ ์ฌ์ฉํ๋ค๋ฉด ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ค. 1. default ์ต์ ์ฌ์ฉ์ ex) mysqldump -uroot -p๋น๋ฒ xxxxDB TB_TEST_HIST > TB_TEST_HIST_20230110.sql MariaDB [(none)]> show processlist; +----------+-------------+---------------------.. wono | discuss | tweet
+ it ops db mysql dump [Mysql] mysql dump ์ฌ์ฉ๋ฒ๋ฐ์ดํฐ ๋ฐฑ์ : mysqldump๋ ๋ชจ๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค ํ ์ด๋ธ์ ๋ด์ฉ์ SQL ๋ช ๋ น์ผ๋ก ์ถ์ถํ์ฌ, ์ด๋ฅผ ํตํด ํ ์ด๋ธ ์์ฑ๊ณผ ๋ฐ์ดํฐ ์ฝ์ ์ ํ ์ ์๋ SQL ์คํฌ๋ฆฝํธ๋ฅผ ์์ฑํฉ๋๋ค.๋ฐ์ดํฐ ๋ณต์ : ์์ฑ๋ ๋คํ ํ์ผ์ mysql ๋ช ๋ น์ด ๋ผ์ธ ์ ํธ๋ฆฌํฐ๋ฅผ ์ฌ์ฉํ์ฌ MySQL ๋ฐ wono | discuss | tweet
+ it ops db postgresql Should I add an arbitrary length limit to VARCHAR columns?According to PostgreSQL's docs, there's no performance difference between VARCHAR, VARCHAR(n) and TEXT. Should I add an arbitrary length limit to a name or address column? Edit: Not a dupe of: W... wono | discuss | tweet
+ it ops code error Differences in Javascript with throwing and return errorThis blog is to differentiate the throwing an error with returning an error. In project, I found different people have different ways of handling errors, but when people work together, this kind ofโฆ wono | discuss | tweet
+ it ops code error Why is it better to throw an exception rather than return an error code?Legacy error handling tends to follow the method that all functions return a code depending on success/failure. You would check this code and handle (if an error) appropriately. Modern programming wono | discuss | tweet
+ it ops db plpgsql PL/pgSQL์ ๊ตฌ์กฐ - Amazon RedshiftAmazon Redshift์์ ์ฌ์ฉ๋๋ PL/pgSQL ์ธ์ด์ ๊ตฌ์กฐ์ ๋ํด ์์๋ด ๋๋ค. wono | discuss | tweet
+ it ops db uuid tsid ๋ถ์ฐ ํ๊ฒฝ์์ P.K๋ ์ด๋ค ์ ๋ต์ผ๋ก ๊ฐ์ ธ๊ฐ๋ฉด ์ข์๊น?๋ณดํต ๋ด๊ฐ ์งํํ๋ ํ๋ก์ ํธ์์๋ ๋จ์ผ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ฌ์ฉํ๊ฑฐ๋, ๋จ์ผ ์์คํ ์์ ๋์ํ๊ธฐ์, auto_increment P.K ์ ๋ต์ ๊ฐ์ ธ๊ฐ๋ ์ค๋ณต๋ ๊ฐ์ด ์กด์ฌํ๋ ๊ฒฝ์ฐ๊ฐ ๊ฑฐ์ ์๊ธฐ ๋๋ฌธ์ ๋ฌธ์ ๊ฐ ๋์ง ์์๋ค. ํ์ง๋ง ๋๊ท๋ชจ ๋ถ์ฐ ์ฒ๋ฆฌ ์์คํ ์ผ ๋๋ ์ด ์๋ ์ฆ๊ฐ ์ wono | discuss | tweet
+ it ops db postgresql do [PostgreSQL] Function3์ด๋ฒ ์ฅ์ for๋ฌธ๊ณผ loop๋ฅผ ์ด์ฉํ์ฌ function์ ์ฌ์ฉํ๋ ๋ฒ์ ์ตํ๋ณด๋ ค๊ณ ํฉ๋๋ค. ์ฐ์ ์ ์ฒ์ฒํ ๊ฐ์ ์ก์๊ฐ๊ธฐ ์ํด ๋๋ฆ๋๋ก์ ๋์ด๋๋ฅผ ์๊ฐํ์ฌ ์ฌ์ด ๋์ด๋๋ถํฐ ์ฝ๋๋ฅผ ๋๋ ค๊ฐ๋ฉฐ ๋์ด๋๋ฅผ ๋์ฌ๋ณด๋ ค๊ณ ํฉ๋๋ค.for๋ฌธ๊ณผ loop ์ฌ์ฉ ์ฐ์ต ์ด์ ๋ํ ๊ฒฐ๊ณผ๋ก ์๋์ wono | discuss | tweet
+ it ops db postgresql tsid pg_random_id/lib/pg_random_id/sql/crockford-pure.sql at 0b4dc52c68b7b4aedca25e6a6cac848da7771d4a ยท arjunmenon/pg_random_idContribute to arjunmenon/pg_random_id development by creating an account on GitHub. wono | discuss | tweet
+ it ops db postgresql tsid Build software better, togetherGitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects. wono | discuss | tweet
+ it ops db postgresql pk PostgreSQL generate unique sorted IDs for timestampsPostgreSQL generate unique sorted IDs for timestamps - snowflake.sql wono | discuss | tweet
+ it ops db postgresql base32 Base58 Encoder function in PostgreSQL> https://www.postgresql.org/docs/9.6/functions-binarystring.html wono | discuss | tweet
+ it ops nextjs tsid tsid-tsA TypeScript library for generating Time-Sorted Unique Identifiers (TSID).. Latest version: 0.0.9, last published: a year ago. Start using tsid-ts in your project by running `npm i tsid-ts`. There is 1 other project in the npm registry using tsid-ts. wono | discuss | tweet
+ it ops db postgresql tsid How to encode a byte array to base32 in PostgreSQLI have a Java application that generates ids for primary keys by encoding cryptographically random bytes to base32 (RFC4648). How do I do the same with PostgreSQL from an SQL script? The gen_random... wono | discuss | tweet
+ it ops db postgresql tsid GitHub - sergeyprokhorenko/pg_ulid_comparison: Comparison of ULID generation functions for PostgreSQLComparison of ULID generation functions for PostgreSQL - sergeyprokhorenko/pg_ulid_comparison wono | discuss | tweet
+ it ops db postgresql tsid GitHub - schinckel/ulid-postgresContribute to schinckel/ulid-postgres development by creating an account on GitHub. wono | discuss | tweet