database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
ㆍCache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Cache Q&A 293 게시물 읽기
No. 293
오브젝트 동기화(Cache의 Replication 기능)
작성자
ReplicateIt
작성일
2007-10-15 10:56
조회수
4,424

얼마 전에 Cache도 Replication 기능이 있느냐는 질문을 받았다. 찾아보니, Cache에도 유사한 기능이 있는데 그 이름이 달랐다. "Object Synchronization" 기능이 바로 그것이다. Cache2007에서 처음 써봤는데, 매우 잘 동작했다. 여기에 그 기능과 적용 대상을 간략히 소개한다.


Cache 5.1에서 부터 추가된 Object Synchronization 기능을 사용하여 여러 분산된 Cache DB 간에 일정 간격을 두고 서로 동기(sync)를 맞추는 기능 구현이 가능하다.

참고로, 이 기능은 SQL 서버 등에서, 구독/게시 혹은 Replication이라 불리우기도 한다.


예를 들어, 영업 담당자들이 각기 PC에 Cache를 설치하고 동기를 맞춘 후에 각자 나가서 해당 DB를 업데이트 한 후에 다시 돌아와 그 내용을 Master 서버와 동기를 맞출 필요가 있을 때 사용할 수 있는 기능이다.


다음 문서에서는 Cache Object Synchronization 기능에 대한 설명 및 사용법을 소개하고 있다. 자, 도전해 봅시다!


Object synchronization is a feature of Caché objects that allows “occasionally connected” systems to synchronize databases. By this process, each database updates its objects. Object synchronization offers complementary functionality to Caché system tools that provide high availability and shadowing. Object synchronization is not designed to provide support for real-time updates; rather, it is most useful for a system that needs updates at discrete intervals.

For example, a typical object synchronization application would be in an environment where there is a master copy of a database on a central server and secondary copies on client machines. Consider the case of a sales database, where each sales representative has a copy of the database on a laptop computer. When Mary, a sales representative, is off site, she makes updates to her copy of the database. When she connects her machine to the network, the central and remote copies of the database are synchronized. This can occur hourly, daily, or at any interval.

This chapter includes the following sections:

About Updates

Object synchronization between two databases involves updating each of them with data from the other. However, Caché does not support bidirectional synchronization as such. Rather, updates from one database are posted to the other; then updates are posted in the opposite direction. For a typical application, if there is a main database and one or more local databases (as in the previous sales database example), it is recommended that updates are from the local to the main database first, and then from the main database to the local one.

For object synchronization, the idea of client and server is by convention only. For any two databases, you can perform bidirectional updates; if there are more than two databases, you can choose what scheme you use to update all of them (such as local databases synchronizing with a main database independently).

This section addresses the following topics:

The GUID

To ensure that updates work properly, each object in a database should be uniquely distinguishable. To provide this functionality, Caché gives each individual object instance a  GUID  — a Globally Unique ID. The GUID makes each object universally unique.

The GUID is optionally created, based on the value of the GUIDENABLED parameter. If GUIDENABLED has a value of 1, then a GUID is assigned to each new object instance.

Consider the following example. Two databases are synchronized and each has the same set of objects in it. After synchronization, each database has a new object added to it. If the two objects share a common GUID, object synchronization considers them the same object in two different states; if each has its own GUID, object synchronization considers them to be different objects.


How Updates Work

Each update from one database to another is sent as a set of transactions. This ensures that all interdependent objects are updated together. The content of each transaction depends on the contents of the journal for the “source” database. The update can include one or more transactions, up to all transactions that have occurred since the last synchronization.

Resolution of the following conditions is the responsibility of the application:

  • If two instances that share a unique key have different GUIDs. This requires determining if the two records describe a single object or two unique objects.

  • If two changes require reconciliation. This requires determining if the two changes were to a common property or to non-intersecting sets of properties.

[Top]
No.
제목
작성자
작성일
조회
296Cache2007.1.3 릴리즈 안내. [1]
Cache2007
2007-10-23
4748
295[SQL]Datediff 사용 방법
CacheSQL
2007-10-15
5661
294[CSP]Cache 2007에서 CSP 오류메시지
배영민
2007-10-15
4876
293오브젝트 동기화(Cache의 Replication 기능)
ReplicateIt
2007-10-15
4424
292[Security]사용자 테이블 SMP(관리포탈)에서 보기
배영민
2007-10-12
4653
291Java와 Cache의 찰떡 궁합.
Java야놀자
2007-10-09
4923
290Zen 이란 무엇인가
웹개발을빠르게
2007-09-27
5238
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2019 DSN, All rights reserved.
작업시간: 0.069초, 이곳 서비스는
	PostgreSQL v11.5로 자료를 관리합니다