Testing interaction with large CRM database

In our company we have two large systems, basically they are scoring and CRM. Both have large SQL Server databases running on Windows servers on the intranet. These two databases are managed by other department, which we have a direct contact with.

Neither of those systems have any external APIs except for some stored procedures (hereinafter “SPs”), which we use to input all the data from our (web-dev team) two applications, which are a public web site and a web-based CRM.

There are problems which make this kind of integration a nightmare:

  1. There are no proper copies of databases for testing. There are some occasional copies which may or may not be up-to-date and being synced manually, which make them practically useless in “ASAP-situations” (all the time).

  2. All sorts of modifications in stored procedures code are being made straight on the production databases (!!!), which obviously cause us a lot of problems.

  3. Stored procedures code is not documented, poorly commented and mostly not well-written. Just to say that I’ve spent last two days “decrypting” two SPs, one of which is ~2400 SLOC long and has many magic numbers and vars like @str1.

To make it easier and safer:

  1. We made kind of “API-server”, which is basically a SOAP server which does queries to SPs and gives back whatever queries return together with some nice status messages. This helps us decouple our apps from the chaos, but it barely simplifies our task when it comes to writing and tesing new functionality.

  2. We store some IDs and other constants from these databases in our databases to prevent using magic numbers in our code whenever possible, but still we have to collect and fill in all the data manually with sqlcmd (which is very uncomfortable because of the Windows cmd disability to handle copying, pasting and displaying text).

I wish we could have some proper process of testing interaction with those databases, but what we have today is just another copy of CRM database which we have to sync manually somehow.

My questions are:

  1. How can we make all the changes made on production databases automatically propagate into testing copies? I can think of something like .bat-script, but maybe there are better tools. I doubt (because of previous experience) we can ask other department to do some replication, so I’m asking for something we can make ourselves and convince that other department to use.

  2. How can we easily sync some data without copying all the data? For example, we need to have an up-to-date copy of all dictionaries/taxonomies, but not the data about clients (which is a lot of data and will take significant time to copy). Again, I’m thinking of some script, but may there be something with just a bunch of checkboxes to select.

  3. What is the best approach for testing the interactions through our “API-server”? I mean, suppose I made a request via SOAP with some fake data and no errors occured – how can I be sure the data is there in that external DB and it is consistent? It is sort of black/grey box testing and I don’t know how to deal with it.

1

How can we make all the changes made on production databases automatically propagate into
testing copies? I can think of something like .bat-script, but maybe there are better tools. I doubt (because of previous experience) we can ask other department to do some replication, so I’m asking for something we can make ourselves and convince that other department to use.

Use standard backup/restore mechanisms provided by your database vendor. If your other department makes a daily backup of the production database (automatically), they surely can make a daily backup for testing purposes using the same mechanism. See here

http://msdn.microsoft.com/de-de/library/ms187510.aspx

for information about the options of backing up an MS SQL Server.

How can we easily sync some data without copying all the data?

Well, the optimal way depends much on the data model, the number of records and the complexity of the schema. Copying only a part of the records may need a specifially designed program which transfers the data in the correct order, without violating constraints. Perhaps it is easier to make a full backup/restore first, and afterwards delete everything you don’t need in the copy and keep the rest for further processing. That may be too slow in your case, or probably fast enough, impossible to know without further details. Another idea is to use differential backups, see here for further details.

but still we have to collect and fill in all the data manually with sqlcmd (which is very uncomfortable because of the Windows cmd disability to handle copying, pasting and displaying text)

If cmd is not powerful enough, why don’t you use something more powerful like Powershell?

suppose I made a request via SOAP with some fake data and no errors occured – how can I be sure the data is there in that external DB and it is consistent

Simple – query for that data, either via your SOAP API, or by adding some SP to your test database especially designed for testing purposes. Of course, the re-adding of the SP code to the DB should be reproducible, so you can add it automatically to your testing copy of the database everytime you made a copy of the production DB.

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