将indexedDB与mysql数据库同步 [英] Sync indexedDB with mysql database

查看:383
本文介绍了将indexedDB与mysql数据库同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将要开发一个应用程序,使员工可以在客户场所去维修机器.他们需要使用平板电脑或任何其他移动设备填写服务卡. 如果没有Internet连接,我正在考虑使用HTML5脱机存储(主要是IndexedDB)在本地存储服务卡(网络表单)数据,并在存在Internet的办公室进行同步.同步是通过MySQL数据库进行的.

I am about to develop an application where employees go to service repair machines at customer premises. They need to fill up a service card using a tablet or any other mobile device. In case of no Internet connection, I am thinking about using HTML5 offline storage, mainly IndexedDB to store the service card (web form) data locally, and do a sync at the office where Internet exists. The sync is with a MySQL database.

那么问题是:是否可以将mysql与indexedDB同步?我从未与indexedDB一起工作过,我只是在做研究,发现它有潜力.

So the question: is it possible to sync indexedDB with mysql? I have never worked with indexedDB, I am only doing research and saw it is a potential.

不建议使用Web SQL.否则,它可能是更接近的解决方案.

Web SQL is deprecated. Otherwise, it could have been the closer solution.

在上述困难或超出标准的情况下,还有其他选择吗?

Any other alternatives in case the above is difficult or outside the standard?

您的意见受到高度赞赏.

Your opinions are highly appreciated.

谢谢.

推荐答案

这绝对可以做到.我只是最近几天才开始学习indexeddb.这就是我看到它工作的方式.抱歉,没有代码可提供给您.

This is definitly do able. I am only just starting to learn indexeddb the last couple of days. This is how I would see it working tho. Sorry dont have code to give you.

  1. 网站以某种方式知道其处于离线模式
  2. 单击提交表单会将数据保存到indexeddb
  3. 后来的笔记本电脑或任何重新联机或在Intranet上并且可以与主服务器通信的计算机,都将所有indexeddb行发送给服务器,并通过ajax调用存储在mysql中.
  4. indexeddb已清除
  5. 重复

这篇关于将indexedDB与mysql数据库同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆