Apache ShardingSphere, a powerful distributed database, recently released a major update to optimize and enhance its features, performance, testing, documentation, and examples.
[ Download a sysadmin's guide to Bash scripting. ]
Data migration has always been a strong focus for the ShardingSphere community. But migrating data from one structure to another is complex. In previous versions of ShardingSphere, you had to add an external table as a single sharding table, then modify the sharding rules to trigger migration. This process tended to be a little too complex for general users.
ShardingSphere 5.2.0 provides a new feature coupled with DistSQL for elastic migration to improve the ease of data migration. You can now migrate data from an existing single database to a distributed database built on ShardingSphere and MySQL or PostgreSQL, and you can do it in an SQL-like manner. It's a natural transformation from a single database to a distributed one.
[ Get started with MySQL and MariaDB. ]
Commands to migrate data
The new feature is capable of migrating Oracle data to PostgreSQL. First, create sharding rules and sharding tables through DistSQL. Next, create a new distributed database and tables and run MIGRATE TABLE ds.schema.table INTO table to trigger data migration. It's easy, and there's SQL to support the process.
-
Migrate from source to target:
MIGRATE TABLE ds.schema.table INTO table- For example:
MIGRATE TABLE ds_0.public.t_order INTO t_order
- For example:
- Query migration list:
SHOW MIGRATION LIST - Query job status:
SHOW MIGRATION STATUS jobID- For example:
SHOW MIGRATION STATUS 1234
- For example:
- Stop migration job:
STOP MIGRATION jobId- For example:
STOP MIGRATION 1234
- For example:
- Continue the job you just stopped:
START MIGRATION jobId- For example:
START MIGRATION 1234
- For example:
- Verify data consistency:
CHECK MIGRATION jobId- For example:
CHECK MIGRATION 1234
- For example:
- Show the available algorithm used for checking consistency:
SHOW MIGRATION CHECK ALGORITHMS - Use specified algorithm to check data consistency:
CHECK MIGRATION jobId (by type(name=algorithmTypeName)?- For example:
CHECK MIGRATION 1234 by type(name="DATA_MATCH")
- For example:
- Undo the job (Note: This statement will clean the target table):
ROLLBACK MIGRATION jobId- For example:
ROLLBACK MIGRATION 1234
- For example:
- Complete the migration job:
COMMIT MIGRATION jobId- For example:
COMMIT MIGRATION 1234
- For example:
During the migration process, you can also use the dedicated DistSQL for data migration in the table to manage the migration job status and data consistency. Please refer to the official documentation for more information about this new feature.
This article is excerpted from Apache ShardingSphere 5.2.0 is released! on Medium and is republished with permission.
저자 소개
I am passionate about technology and innovation. I moved to Beijing to pursue my PhD in Management and fell in awe of the local startup and tech scene. My career path has so far been shaped by opportunities at the intersection of technology and business.
I took on a keen interest in the development of the ShardingSphere big data ecosystem and spen source community building and have since become a Committer in this community.
ShardingSphere is an Apache Top-Level project, and an open source ecosystem to transform any database into a distributed database system and enhance it with sharding, elastic scaling, encryption features, and more.
유사한 검색 결과
Bridging the gap: Red Hat Academy shaping open source talent in APAC
From banking to tech: Bradley's Red Hat journey
Are Big Mistakes That Big Of A Deal? | Compiler
The Legend Of Hadoop | Compiler: Legacies
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
가상화
온프레미스와 클라우드 환경에서 워크로드를 유연하게 운영하기 위한 엔터프라이즈 가상화의 미래