Skip to content

Commit

Permalink
Merge pull request #9 from iluhinsky/feature/opensearch
Browse files Browse the repository at this point in the history
Added OpenSearch support
  • Loading branch information
viatoriche authored Oct 16, 2024
2 parents f1bf9b1 + 6a43e40 commit 4fc8990
Show file tree
Hide file tree
Showing 21 changed files with 1,204 additions and 663 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ It includes:

## Acronis Database Benchmark (acronis-db-bench)

The Acronis Database Benchmark is a comprehensive framework for testing and analyzing the performance of various database systems. It supports a wide range of both SQL and NoSQL databases, such as MySQL, PostgreSQL, Cassandra, ClickHouse, ElasticSearch and more, making it a powerful tool for cross-database performance comparisons. The tool provides extensive support for different data access patterns, including inserts, updates, facet searches, indexed searches, vector searches, and others, allowing for a detailed exploration of how each database handles different query types and workloads.
The Acronis Database Benchmark is a comprehensive framework for testing and analyzing the performance of various database systems. It supports a wide range of both SQL and NoSQL databases, such as MySQL, PostgreSQL, Cassandra, ClickHouse, ElasticSearch, OpenSearch and more, making it a powerful tool for cross-database performance comparisons. The tool provides extensive support for different data access patterns, including inserts, updates, facet searches, indexed searches, vector searches, and others, allowing for a detailed exploration of how each database handles different query types and workloads.

With built-in features for simulating multi-tenant environments, the benchmark can model real-world SaaS-like scenarios where multiple tenants access shared resources. Additionally, it offers advanced logging and diagnostic features that help developers and database administrators quickly identify and troubleshoot performance issues. The tool is ideal for assessing the impact of various database configurations, comparing the overhead of database clusters versus single instances, and analyzing performance bottlenecks under concurrent workloads. It also enables users to evaluate how databases perform under high-cardinality data, different indexing strategies, and various levels of hardware and virtualization environments. This makes it highly suitable for optimizing database systems and ensuring efficient performance in production-like environments.

Expand All @@ -32,7 +32,6 @@ These instructions will get you a copy of the project up and running on your loc

Before you begin, ensure you have met the following requirements:
* You have installed the latest version of [Go](https://golang.org/dl/).
* You have a `<Mac/Linux/Windows>` machine. State which OS is supported/required.

### Getting perfkit

Expand Down
264 changes: 142 additions & 122 deletions acronis-db-bench/README.md

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions acronis-db-bench/tenants-cache/tenant_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,9 @@ func (tc *TenantsCache) CreateTenant(rw *benchmark.RandomizerWorker, tx db.Datab
return "", err
}

var tenantUuid, _ = guuid.ParseBytes([]byte(t.UUID))
if err = tx.BulkInsert(TableNameTenants, [][]interface{}{
{t.ID, t.UUID, t.Name, t.Kind, t.ParentID, t.NestingLevel, t.IsDeleted, t.ParentHasAccess},
{t.ID, tenantUuid, t.Name, t.Kind, t.ParentID, t.NestingLevel, t.IsDeleted, t.ParentHasAccess},
}, []string{"id", "uuid", "name", "kind", "parent_id", "nesting_level", "is_deleted", "parent_has_access"}); err != nil {
tc.logger.Log(benchmark.LogTrace, 0, fmt.Sprintf("error inserting into table %s: %v", TableNameTenants, err))
return "", err
Expand Down Expand Up @@ -624,8 +625,9 @@ func (tc *TenantsCache) CreateCTIEntity(rw *benchmark.RandomizerWorker, tx db.Da

cti.GlobalState = 1

var ctiUUID, _ = guuid.ParseBytes([]byte(cti.UUID))
if err = tx.BulkInsert(TableNameCtiEntities, [][]interface{}{
{cti.UUID, cti.CTI, cti.Final, cti.GlobalState, cti.EntitySchema, cti.Annotations, cti.Traits, cti.TraitsSchema, cti.TraitsAnnotations},
{ctiUUID, cti.CTI, cti.Final, cti.GlobalState, cti.EntitySchema, cti.Annotations, cti.Traits, cti.TraitsSchema, cti.TraitsAnnotations},
}, []string{"uuid", "cti", "final", "global_state", "entity_schema", "annotations", "traits", "traits_schema", "traits_annotations"}); err != nil {
return fmt.Errorf("error inserting into table %s: %v", TableNameCtiEntities, err)
}
Expand Down
2 changes: 1 addition & 1 deletion acronis-db-bench/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (t *TestDesc) getDBs() string {

var (
// ALL is a list of all supported databases
ALL = []db.DialectName{db.POSTGRES, db.MYSQL, db.MSSQL, db.SQLITE, db.CLICKHOUSE, db.CASSANDRA, db.ELASTICSEARCH}
ALL = []db.DialectName{db.POSTGRES, db.MYSQL, db.MSSQL, db.SQLITE, db.CLICKHOUSE, db.CASSANDRA, db.ELASTICSEARCH, db.OPENSEARCH}
// RELATIONAL is a list of all supported relational databases
RELATIONAL = []db.DialectName{db.POSTGRES, db.MYSQL, db.MSSQL, db.SQLITE}
// PMWSA is a list of all supported databases except ClickHouse
Expand Down
2 changes: 1 addition & 1 deletion acronis-db-bench/workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func initWorker(b *benchmark.Benchmark, workerID int, testDesc *TestDesc, rowsRe
tenantCacheDBOpts.ConnString = b.TestOpts.(*TestOpts).BenchOpts.TenantConnString

if workerData.tenantsCache, err = NewDBConnector(&tenantCacheDBOpts, workerID, b.Logger, 1); err != nil {
return
b.Exit("db: cannot create tenants cache connection: %v", err)
}
}

Expand Down
2 changes: 2 additions & 0 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const (
CLICKHOUSE DialectName = "clickhouse" // CLICKHOUSE is the ClickHouse driver name
CASSANDRA DialectName = "cassandra" // CASSANDRA is the Cassandra driver name
ELASTICSEARCH DialectName = "elasticsearch" // ELASTICSEARCH is the Elasticsearch driver name
OPENSEARCH DialectName = "opensearch" // OPENSEARCH is the OpenSearch driver name
)

// Special conditions for searching
Expand Down Expand Up @@ -359,6 +360,7 @@ func GetDatabases() []DBType {
// "A" is used as the latest symbol of the "Cassandra" due to duplicate with ClickHouse "C"
ret = append(ret, DBType{Driver: CASSANDRA, Symbol: "A", Name: "Cassandra"})
ret = append(ret, DBType{Driver: ELASTICSEARCH, Symbol: "E", Name: "Elasticsearch"})
ret = append(ret, DBType{Driver: OPENSEARCH, Symbol: "O", Name: "OpenSearch"})

return ret
}
233 changes: 0 additions & 233 deletions db/es/adapter.go

This file was deleted.

Loading

0 comments on commit 4fc8990

Please sign in to comment.