Windows 8 & MySQL? What are my options?

大城市里の小女人 提交于 2019-12-04 22:41:34

I strongly advise against client programs connecting directly to a database server over the Internet, for the following reasons:

  • Client libraries are designed and built around the assumption that the database is under a few miliseconds away, especially very chatty protocols (MSSQL is amongst these). Short operations might take considerably longer as a result.
  • It's a security liability, not only are you exposing your database server to the Internet, but you're also embedding connection details (such as passwords) in your application.
  • It doesn't lend itself to scalability. What if you introduce multiple load-balanced or failover database servers, you'd have to rewrite your client.
  • It also assumes that there won't be any connectivity problems. Many networks (especially mobile networks) restrict activity outside of port 80/443 to prevent abuse of their network (such as zombie users launching attacks).

The ideal solution in these cases is to develop a web-service frontend for your database; your application would then interface with the web-service instead of your database. This has other advantages.

Of course, clients (especially mobile clients) should use a data cache so the application will continue to work when offline.

Back on-topic: assuming you still want to go with a direct connection, then I don't see why the MySQL client library won't work on 4.5. You can modify an assembly's manifest/configuration so that it will run on future versions of the .NET CLR (you'll only run into problems if said library uses since-removed types and members or relies on changed behavior. The .NET framework has a good reputation for backwards and forwards compatibility).

Metro applications distributed via the App Store are sandboxed so you'll run into problems if you use MySQL. If you want a simple database I recommend SQLite. If you want to be assured of portability avoid any "mixed-mode" implementations - there exists a "pure" .NET implementation available here: http://code.google.com/p/csharp-sqlite/

There are plenty of GUI tools you can use to administer and design SQLite databases too.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!