Discover Packages
github.com/codesome/htap-simulator
module
Version:
v0.0.0-...-60fd2de
Opens a new window with list of versions in this module.
Published: Dec 7, 2023
License: Apache-2.0
Opens a new window with license information.
README
README
¶
HTAP Simulator
Project link: https://github.com/codesome/htap-simulator/
Install PostgreSQL and Clickhouse
Start PostgreSQL and Clickhouse servers on their default port. (PostgreSQL is queryable from port 5432 and Clickhouse is querable from port 9000)
Create a database named htap
in both of them. For clickhouse, the database should be created under the default
user.
Create the following tables
In Postgres
CREATE TABLE htap_table
(
id serial primary key,
user_name VARCHAR(20),
user_age INT,
user_email VARCHAR(50),
user_city VARCHAR(20),
user_country VARCHAR(20),
registration_date VARCHAR(20),
is_active BOOLEAN,
user_interest VARCHAR(20),
visit_count INT,
user_category VARCHAR(20)
)
In Clickhouse
CREATE TABLE htap_table
(
user_name String,
user_age UInt8
)
engine=MergeTree
ORDER BY user_age
Install the go
compiler if you do not already have it (https://go.dev/doc/install ).
Start the htap-simulator
$ go run htap-brain/*
# Optional. If you get any error for above saying packages are not vendored,
# run the below command to fetch the dependencies and start htap-brain again.
$ $ go mod vendor
Start the read and write load in separate terminals
For now, the read-load only produces OLAP queries. load-generator/read.py
has instructions to change it to produce OLTP queries as well (a single line edit, search for TODO
in that file).
$ python3 load-generator/read.py
$ python3 load-generator/write.py
Expand ▾
Collapse ▴
Directories
¶
Click to show internal directories.
Click to hide internal directories.