Is there a programming pattern, design pattern, or naming convention for moving data between related schemas? [closed]

I’m working on a web application that is publicly accessible. (Really) Long story short, we have two sets of tables in the database with relatively the same names and relatively the same data. The first set of tables are used by our web site, which I will call Set A. The second set of tables are used by an Oracle Forms application, which I will call Set B.

The reasons for duplicated tables:

  1. The data in Set B is the Holy Grail of information. Allowing the public to change this has legal repercussions.
  2. The public can partially fill out all of the forms in our web application, and in one final button click, finalize their information. They then have to pay a fee before downstream processing begins. Users may start, stop and restart this process any number of times.

My current task is to copy data from Set B into Set A in one operation, so that form fields are pre-populated. If we don’t do this, every page in our web application has to pull data from Set A first, and if it is missing fall back to Set B (which sometimes involves data conversions).

I have this built and functioning correctly, but I’m not real keen on the names I’ve used: *Converter

I’m really trying to avoid a “service” object. Having read I Shall Call It.. SomethingManager at Coding Horror, naming anything with the word “service” makes me want to write a sibling blog post titled “I Shall Call It.. SomethingService.”

My lead developer didn’t like the “Converter” naming convention. I’ve searched for programming and design patterns for moving data between similar tables and I haven’t found anything.

I’ve thought about “Migration” but this implies changing the database schema iteratively over a period of time (ala Active Record Database Migrations).

Whatever the name or pattern is, I’d like it to clearly communicate:

  1. Information is being pulled from one set of tables
  2. Mapped to a common object model
  3. And inserted into another schema

I also feel like I’m not the only person who has encountered this problem.

Is there a programming pattern, design pattern, or naming convention for moving data between related schemas?

Update: One of the biggest problems I have is that the web site tables (Set A) don’t have primary or foreign keys! We have a bunch of meta data hidden in constants, whose values get mashed together sometimes into a single column.

@kevincline’s answer to write a stored procedure is actually why I choose to handle this specific situation in code. We have a stored procedure to move data from Set A into Set B, and Oh. My. Goodness. The hoops the poor PL/SQL developer had to jump through to untangle our mess was nothing short of a miracle.

In this case, the code was much easier to write and maintain outside of the database because our web application … well. Think of every database design best practice imaginable and then do exactly the opposite.

6

If you want to give a name to “moving data between related schemas”: In Datawarehousing this is called ETL:

From Extract_transform_load@wikipedia

In computing, extract, transform, and load (ETL) refers to a process in database usage and especially in data warehousing that:

  • Extracts data from outside sources
  • Transforms it to fit operational needs, which can include quality levels
  • Loads it into the end target (database, more specifically, operational data store, data mart, or data warehouse)

1

I would just write a stored procedure to do this instead of getting application code involved. It will be easier to develop and maintain and it will run faster. You may need only a single MERGE statement for each destination table.

1

A design pattern would probably be more applicable how you accomplished the goal in source code rather than describing the goal itself. It sounds like this could have been coded up using Adaptor or Strategy pattern, but again, that would depend on the code itself.

It sounds like you’re looking for a name to describe the whole process, then want to apply that to the code to describe that “this is the part of the code that converts/translates data from B to A”. Depends a lot on the codebase. But you might consider naming it based on the actual names. SetBConverter might not be so bad, depending on context. Or OracleToWebDataTranslator or whatever… (now just getting into total speculation).

In general, a lot of computer science can be boiled down to data transformations. Moving between related schemas is a little more specific, but I can’t think of any specific terms to cover that off-hand.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật