Skip to content

What the difference bewteen Atomic and Ordinary database type ? #17906

Closed
@Steuf

Description

@Steuf

Hi guys,

At first congratulations for this amazing project 👍

As I can see on backup project : https://github.com/AlexAkulov/clickhouse-backup it don't support default database engine Atomic.

So, my question: What is the concret difference between Atomic and Ordinary database ? I can see a really different way to organize data on disk and don't find more informations about this on documentation.

It's for performance ? For specifics features ? An Ordinary database can be converted later on Atomic database when Backup support it ?

Before put my project on production I need to decide :

  • launch with Atomic and start backup when the project support it
  • launch with Ordinary database, Backup and convert database to Atomic later...

Thanks you !

Activity

den-crane

den-crane commented on Dec 8, 2020

@den-crane
Contributor

In short:
Atomic:
non-blocking drop table / rename table
tables delete (&detach) async (wait for selects finish but invisible for new selects)
atomic drop table (all files / folders removed)
atomic table swap (table swap by "EXCHANGE TABLES t1 AND t2;")
rename dictionary / rename database
unique automatic UUID paths in FS and ZK for Replicated

Steuf

Steuf commented on Dec 8, 2020

@Steuf
Author

Ok I see, thanks. It's more flexible for some actions on cluster.

Last question, it's possible to convert a Ordinary database to Atomic ? If not it will ne possible later ?

den-crane

den-crane commented on Dec 8, 2020

@den-crane
Contributor

AFAIK you already can move tables to atomic database using rename table. But later will be implemented a special method to convert database;

create database atom Engine=Atomic;
create database ord Engine=Ordinary;
create table ord.A (A Int64) Engine=MergeTree order by A;
insert into ord.A select number from numbers(1000);

rename table ord.A to atom.A;

select count() from atom.A;
┌─count()─┐
│    1000 │
└─────────┘
Steuf

Steuf commented on Dec 8, 2020

@Steuf
Author

Ho nice ! Thanks.

So in this case I can start the project with Ordinary and migrate later when backup will support it.

Thank you it's clear.

techkuz

techkuz commented on May 12, 2023

@techkuz
Contributor

@den-crane is ALTER TABLE non-blocking in Atomic engine?

alexey-milovidov

alexey-milovidov commented on May 12, 2023

@alexey-milovidov
Member

Yes, ALTER TABLE is non-blocking in Atomic databases, while in Ordinary databases it blocks DROP and RENAME queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Steuf@techkuz@tavplubix@alexey-milovidov@den-crane

      Issue actions

        What the difference bewteen Atomic and Ordinary database type ? · Issue #17906 · ClickHouse/ClickHouse