Bài đăng

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

Cassandra Query Language (CQL) - CREATE TABLE

This is some syntax to work with Cassandra. CREATE TABLE Required parameters: table_name: name of the table to index column_name: name of the column column_definition Restriction: A table must have at least one PRIMARY KEY When PRIMARY KEY is at the end of a column definition, that column is the only primary key for the table, and is defined as the partition key (*) A static column cannot be a primary key (**) Primary keys can include frozen collections So, let's explain (*): When you create a table in SQL (especially in Cassandra or similar NoSQL databases), you can define a primary key in two ways:  After the column , like this: CREATE TABLE users (     id UUID PRIMARY KEY,     name text,     email text ); Or at the end , like this: CREATE TABLE users (     id UUID,     name text,     email text,     PRIMARY KEY ...

What is Cassandra?

Hình ảnh
 I have a chance to work with Cassandra on the project. This is a note of mine about this technology Firstly, we will go over the basic knowledge of Cassandra: Cassandra is NoSQL It is distributed on multiple nodes Write throughput is greater than read throughput Performance Every node works as P2P (peer to peer) CQL (Cassandra Query Language) instead of SQL So, let's talk about CQL, which is the query language of Cassandra. Some of the syntax as: CREATE, WHERE, SELECT, INSERT, and  NO JOINS. This is the difference between Relational DB and Cassandra DB:

How to check if your IP can connect to another address

Hình ảnh
If your leader requires you to check the connection between your computer and another address. Please use this way: This is an example: Mongo: 181.288.188.288, port: 27017 Redis: 181.288.188.282, port: 6379 PostgreDB: 181.288.188.188, port: 5432 Elasticsearch: 188.288.188.88, port: 9200 kafka: 181.288.188.286, port: 9092 Let’s check: Before checking, open PowerShell with administrator permissions. Type the command below: Test-NetConnection 181.288.188.286 -p 9092 This is the successful result: ComputerName : 181.288.188.286  RemoteAddress : 181.288.188.286  RemotePort : 9092  InterfaceAlias : Ethernet  SourceAddress : 192.168.199.29  TcpTestSucceeded : True

GIT Command Lines

Hình ảnh
These are the Git command lines that I have used frequently in the project. Switch to the existing branch: git checkout <branch_name> Switch to a new branch: git checkout -b <origin_brnach> <new_branch_name> Add all local changes to the local repository: git add . Commit all local changes: git commit -m"commit message" The standard commit if GitLab is connected with Jira Software: git commit -m"CHD-86: Update code for contract API" CHD-86 is your task on Jira Software Push commits to the remote repository: git push Pull code from the remote repository: git pull Merge your branch codes with the other branch (ex, develop): git checkout <your_branch> git merge develop If it shows many conflicts, you should fix it! Roll back to the specific commit code Firstly, you should determine the commit that you want to roll back: git log --oneline The result will show:           The next step is to roll back t...