duanji9378 2016-01-09 17:05
浏览 55
已采纳

实时Web服务的变更和测试

I have created a web service that is live for some time.

At the same time i purchased another domain where i imported and configured all the scripts/database from live web service.

Now i have 2 different domains; the one that i call LIVE and the other that i call TEST. Both domains have the same content now.

If i want to add a new feature, i code it on the TEST server, debug it and ensure that it works correctly. At the same time i write down all the changes to help me with implementation on the LIVE server.

After pushing the changes on the LIVE server i test them to check if everything is OK.

Questions:

1) Is this procedure valid? Any suggestions on improving it?

2) The are occasions where testing involves changes in the database (for example if i make some logic changes in my registration form).

  • How do i handle testing entries inside the database? Do i delete them?
  • If the real data (no testing data) in a table go up until ID 40 (1,2,3,...40) and the testing entry takes the place with ID 41, if i delete entry with ID 41, then the next real entry will take the place ID 42 (since ID is auto-increment). How do i reset the ID counter after deleting the test entry? Right now i use the following: ALTER TABLE tablename AUTO_INCREMENT = 1 and it works. Are there any site effects on the table i use this command? And why this works? I am setting the auto_increment to 1 not 41.
  • Is there any problem if the entries in a database have gaps? (ex. ID: 1,2,4,5,.. missing ID=3)

ps: i am using PHP as back end, and MySQL (InnoDB) as my database.

Thanks in advance.

Christos

  • 写回答

1条回答 默认 最新

  • dongyi6543 2016-01-09 17:22
    关注

    Two questions to solve here: deployment and migrations:

    1) Have a testing and production server is Ok, but you also need a way to deploy fast for both. There's a lot of options out there: deployer (http://deployer.org/) for example.

    2) Modern frameworks like Laravel or Yii2, uses migrations for update your database changes in structure, the testing entry doesn't matter. In your case, there are tools for use migrations without a framework like Phinx (https://phinx.org/)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 为什么eprime输出的数据会有缺失?
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题