在网络共享上使用sqlite

在网络共享上使用sqlite

本文介绍了在网络共享上使用sqlite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在基于windows桌面的Java应用程序上使用SQLite(Xerial JDBC驱动程序)。现在我们将讨论同一个应用程序的客户端 - 服务器版本,其中多个基于Java的Swing客户端将连接到指定服务器Windows PC上的同一个SQLite数据库文件。如果我错了,请更正我:


  1. 通过网络共享保留SQLite数据库文件是否在此模式下使用SQLite的唯一选项?



  2. $ b

    我没有看到很多并发更新操作。将有5-10个客户端尝试读取&更新同一个DB。在这种情况下,最好是使用一个entperise等级的DB(MySQL,Postgres)?

    解决方案

    不会网络共享一个SQLite数据库文件,因为它看起来你会买自己讨厌的同步问题,导致很难再现数据损坏。



    换句话说,你使用一个文件共享机制来替代另一个DBMS的服务器能力。这些其他DBMS经过专门测试和现场硬化以实现多个客户端访问,尽管SQLite有很大的优点,但这不是其中之一。


    We are using SQLite (Xerial JDBC driver) on a windows desktop based Java application. Now we are moving on to a client-server version of the same application where multiple Java based Swing clients will be connecting to the same SQLite db file on the designated server Windows PC. Please correct me if I'm wrong:

    1. Is keeping the SQLite database file over network share the only option to use SQLite in this mode? or is there some other solution that I am missing ?
    2. Will using SQLite increase the chances of DB corruption ?

    I don't see lot of concurrent update operations. There will be 5-10 clients trying to read & update the same DB. In that case, is it better to use an entperise grade DB (MySQL, Postgres)?

    解决方案

    From the FAQ paragraph before the one quoted:

    I would not network share a SQLite database file as it appears you will be buying yourself nasty synchronization problems yielding hard to reproduce data corruption.

    Put another way, you are using a general file sharing mechanism to substitute for the server capabilities of another DBMS. These other DBMS are tested specifically and field-hardened for multiple client access, though SQLite has great merits, this isn't one of them.

    这篇关于在网络共享上使用sqlite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 22:48