西维蜀黍

【Database】Concurrency Control

Why is concurrency control needed?

If transactions are executed serially, i.e., sequentially with no overlap in time, no transaction concurrency exists.

However, if concurrent transactions with interleaving operations are allowed in an uncontrolled manner, some unexpected, undesirable results may occur, such as:

  • The lost update problem
  • The dirty read problem
  • The incorrect summary problem
  ...


【Software Testing】Difference between Verification and Validation

Most people think verification and validation are exactly the same thing, but only different words. However, these two is not the same thing. I would like discuss both of them, especially the distinction between them.

Difference between Verification and Validation

  • Verification [Process-related]: a static practice of checking documents, design code and program

  • validation [Product-related]: a dynamic practice of validating and testing the actual product

    • validation will be done by testing
  ...


【Engineering】Data flow and Control flow

Background

A workflow can described from the control and data perspecitve respectively.

Data Flow and Control Flow

There are two types of messages: control messages and data messages, distinguished by their use at the recipients of the messages.

  • Control messages are mostly short messages that trigger state changes at the receiving services
  • Data messages are mostly large data packets that are given to the receiving services for processing.
  ...


【IoT】MQTT Protocol

Basic Idea

MQTT (Message Queuing Telemetry Transport) is a lightweight publish-subscribe-based messaging protocol.

MQTT vs HTTP

The publish/subscribe architecture which is used in MQTT is in contrast to HTTP with its request/response paradigm.

The difference to HTTP is that a client doesn’t have to pull the information it needs, but the broker pushes the information to the client, in the case there is something new. Therefore each MQTT client has a permanently open TCP connection to the broker. If this connection is interrupted by any circumstances, the MQTT broker can buffer all messages and send them to the client when it is back online.

  ...


【IoT】Node.js MQTT Demo

Setup MQTT Server

If you want to run your own MQTT broker (MQTT Server), you can use Mosquitto or Mosca, and launch it.

Take mosca as an example:

  ...