Recent Posts

PostgreSQL 版本 Schema 效能比較

需求 開發者持續發布新軟體,版本格式是 {major}.{minor}.{micro}.{build}當裝置詢問升級資訊時,我們需要找出最新的軟體版本但不只是最新的版本,我們可能還需要知道以下版本資訊,才能提供適合的建議是否有 3 個更新的軟體版本?有多少更新的軟體版本? 挑戰 資料庫用「自然排序」來排文字這兩...

Kafka - Pick a transaction.id

Intention: Why I need Kafka Transaction需求中收到 message 並處理之後, application 需要另外傳送訊息出去給多個 topic.不管遇到任何錯誤, 我都希望訊息就不要送出去.除此之外, 原本 consume 的訊息也不要收下來How it worksProd...

Kafka - 選擇 transaction.id

動機:為什麼我需要 Kafka Transaction需求中收到 message 並處理之後, application 需要另外傳送訊息出去給多個 topic.不管遇到任何錯誤, 我都希望訊息就不要送出去.除此之外, 原本 consume 的訊息也不要收下來運作方式Producer 用 transaction.i...

用 protobuf Any 來 parse byte array

第一次錄影片分享技術議題. Source code: https://github.com/axxdeveloper/study-practice/tree/gpb  主要其實就是之後可以用 Any.pack( gpbEntity ).toByteArray 傳送出去.接收端也適用 Any.p...

用 protobuf Any 來 parse byte array

第一次錄影片分享技術議題. Source code: https://github.com/axxdeveloper/study-practice/tree/gpb  主要其實就是之後可以用 Any.pack( gpbEntity ).toByteArray 傳送出去.接收端也適用 Any.p...

PostgreSQL Replication

  WAL - Write Ahead Log, or xlog, or transaction log. WAL 就像是 Cassandra 的 CommitLog, 會先被存起來, 再寫進資料庫, 使 Postgres 不管何時被關閉, 重啟後都可以恢復資料.WAL 存在 pg_wal folder...

PostgreSQL 資料複寫(Replication)

  WAL - Write Ahead Log,又叫 xlog 或 transaction log。WAL 就像是 Cassandra 的 CommitLog, 會先被存起來, 再寫進資料庫, 使 Postgres 不管何時被關閉, 重啟後都可以恢復資料.WAL 存在 pg_wal folder 下Po...

Angular - Built-in directives

ngIftrue => Host div will be included in the HTML elementsfalse => Host div will be excluded in the HTML elements<div *ngIf="needShow(4)" class="bg...

Angular - 內建 Directives

ngIftrue => Host div 會被加入 HTML 元素中false => Host div 會被排除在 HTML 元素外<div *ngIf="needShow(4)" class="bg-info p-2 mt-1"> Check need to show if pass ...

init mongodb data in docker

 1. Given file in project folder ./mongo/docker-entrypoint-initdb.d:/initdb.sh ``` echo '=====================================>' mongo --eval 'db.get...

在 Docker 中初始化 MongoDB 資料

 1. 在專案資料夾放一個檔案 ./mongo/docker-entrypoint-initdb.d:/initdb.sh ``` echo '=====================================>' mongo --eval 'db.getSiblingDB("testqq...

Start Kafka by docker-compose

docker-compose.yml services: zookeeper-server: image: bitnami/zookeeper:latest ports: - "2181:2181" environment: - ALLOW_ANONYMOUS_...

用 docker-compose 啟動 Kafka

docker-compose.yml services: zookeeper-server: image: bitnami/zookeeper:latest ports: - "2181:2181" environment: - ALLOW_ANONYMOUS_LO...

Kafka Client assign 與重設 offset

 1. Producer 發送訊息 ``` private static void sendMessages(Properties kafkaProps, String topic) {     for (int i = 0; i < MSG_COUNT; i++) { &nb...

Kafka Consumer specify offset

1. Producer send messages ``` private static void sendMessages(Properties kafkaProps, String topic) {     for (int i = 0; i < MSG_COUNT; i++) { ...

Kafka Consumer 指定 offset

1. Producer 發送訊息 ``` private static void sendMessages(Properties kafkaProps, String topic) {     for (int i = 0; i < MSG_COUNT; i++) {   &n...