开发者

Embedded database for desktop applications question

I wa开发者_运维技巧nt to make an application 'x' with an embedded database.If i make another application 'y' without an embedded database,will it be possible to read and update the database in application 'x'.


I'm not sure what you mean by "embedded" database mysql. Your application will connect to mysql via socket and any other application will connect to it (assuming it has right credentials). Alternatively you could use sqlite which is easier to manage in a desktop app environment.


Consider the needs of the solution. If you need to share the data, create a shared database. If you need to share business logic, create an application that services requests from that database. I'm am not sure what MySQL's capabilities are regarding embedding a database inside the application, but if you're embedding the database in an application, the data should stay inside the application.


No, I don't think so. Because you are using an embedded database it's actually part of your application (embedded) so it doesn't have any external interface as such. That's because embedded MySQL doesn't run a database server process to listen to requests. The database access logic is all linked into your application.

You could either:

  1. Have application X listen on a port and forward requests to it's embedded DB, this at least abstracts away from the fact that it is DB in the background, it would look juist like any other service.
  2. Use a non embedded DB, this should be pretty simple to setup really. You could have X start and stop the DB server when it starts and stops.
  3. Use a file based database like SQLLite.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜