Bài đăng

Đang hiển thị bài đăng từ Tháng 5, 2019

Transaction and Shrink in SQL

Hình ảnh
-           -  Transaction log là gì ? o    Transaction log là thành phần trong SQL Server. Mỗi database sẽ có 1 hoặc   nhiều transcaction log chứa tất cả records ghi lại tất cả thông tin chỉnh sửa liên quan đến database. -          -   Tại sao lại có transaction log? o    Transaction log có thể giúp phục hồi dữ liệu trở về một thời điểm mong muốn. Và vì transaction log đảm bảo hiệu xuất xử lý. Vì datafile lưu trữ dữ liệu theo cơ chế ngẫu nhiên nên nếu mỗi thao tác cập nhật đều ghi trực tiếp vào data file sẽ khiến database bị chậm. Transcation log sẽ giúp việc cập nhập dữ liệu theo cơ chế tuần tự. o    Mỗi thao tác làm thay đổi tới dữ liệu sẽ dược ghi vào các record của transactin log. Còn giá trị dữ liệu   (data pages) sẽ được lưu tạm tong buffer của bộ nhớ RAM đê xử lý. Khi chỉnh sửa dữ liệu cũng chính là xử lý trên data pages trên ram ( dữ liệu được chỉnh sữa gọi là Di...

Kafka Monitoring with Prometheus and Grafana

Hình ảnh
The reference setup uses 3 applications: Prometheus jmx_exporter in either server or agent mode Grafana Installation and setup - structure directory :    - Root:              - kafka              -  kafka-monitor / prometheus :                                   jmx_prometheus_javaagent-0.11.0.jar                                   kafka-2-0-0.yml                                   prometheus:                                                      prometheus         ...

Redo and undo Log in MySQL transaction

Hình ảnh
We all know that transactions have four characteristics: atomicity, consistency, isolation and persistence, and that the operation in a transaction is either fully executed or not done at all, which is the purpose of the transaction. Transaction isolation is achieved by locking mechanism, atomicity, consistency and persistence are guaranteed by transaction redo log and undo log. So this article will discuss several issues about redo and undo in transactions: What are redo logs and undo logs? How does redo ensure transaction durability? Is undo log an inverse process of redo log? redo log Types of Redo The redo log is used to ensure the persistence of transactions, that is, D in transaction ACID. In fact, it can be divided into the following two types: Physical Redo Log Logical Redo Log In InnoDB storage engine, In most cases, Redo is a physical log, which records the physical changes of data pages. 。 Logical Redo logs, however, do not record the actual modific...