orientdb - 在orient DB中创建数据库时LOCAL和REMOTE的区别?

标签 orientdb database nosql

在此使用 OrientDB 数据库,我使用命令 create database PLOCAL:path/testdb admin admin PLOCAL DOCUMENT 文档类型数据库创建数据库,并且我创建了两个类 commentpost ,它们在评论类中具有属性 postId ,在帖子类中具有属性 Id 。然后我尝试在这两个类之间创建链接。使用命令create LINK Usercomments TYPE LINKSET FROM comment.postId TO post.Id。 此命令显示错误“执行命令时出错:sql.create LINK comments TYPE LINKSET FROM comment.postId TO post.Id, java.util.UnknownFormatConversionException: Conversion = '%'”。如果我使用命令创建数据库远程:localhost/testdb管理管理内存文档创建数据库,则同样的情况也有效。创建数据库时PLOCALREMOTE有什么区别?

最佳答案

根据OrientDB official docs , PLOCALREMOTE<database-url> <mode>参数指定用于连接到创建的数据库的连接类型,它与 <storage-type> 不同参数指定您要使用的存储类型:

  • PLOCAL:如果您以这种方式创建数据库,您会自动在PLOCAL中连接到它。模式。它使用基于磁盘的存储来确保数据持久性。例如:

    create database plocal:/path/to/db/dbname document
    
    Creating database [plocal:/path/to/db/dbname] using the storage type [plocal]...
    Database created successfully.
    
  • REMOTE:如果使用REMOTE模式创建数据库,则必须指定存储类型,可以是PLOCALMEMORY 。例如:

    • PLOCAL:它使用基于磁盘的存储。

      create database remote:localhost/dbname root root plocal
      
      Creating database [remote:localhost/dbname] using the storage type [plocal]...
      Connecting to database [remote:localhost/dbname] with user 'admin'...OK
      Database created successfully.
      
    • MEMORY:它使用 volatile 内存来创建和保存数据库。它不能保证数据持久性,并且当您重新启动计算机时您将丢失所有数据。例如:

      orientdb {db=dbname}> create database remote:localhost/dbname1 root root memory
      
      Creating database [remote:localhost/dbname1] using the storage type [memory]...
      Connecting to database [remote:localhost/dbname1] with user 'admin'...OK
      Database created successfully.
      

希望对你有帮助

关于orientdb - 在orient DB中创建数据库时LOCAL和REMOTE的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36146793/

相关文章:

sql - 为 SQL Server 中的存档表节省空间

database - 寻找数据库版本控制系统

php - 我想使用 php mysql 从表中检索 24 小时前发布的所有记录

mongodb - Mongodb 2013 现状

neo4j - 在 Neo4j 中递归匹配子树

orientdb - 使用文档 API 设置嵌入字段

sql - OrientDB 通过添加现有字符串来更新字段

json - 选择查询以获取 orientdb 中 JSON 中的字段

angularjs - AngularFire - 如何查询非规范化数据?

OrientDB 磁盘利用率