# "*": "https://raw.githubusercontent.com/wefindx/schema/master/intent/oo-item.yaml" # "base:title": "0oo - Document based databases" "og:title": "Document based databases" "og:description": "MarkLogic, MongoDB, couchbase are document databases. They're often very fast. But unfortunately compared to relational databases they often do not support efficient joins." "og:image": "https://avatars0.githubusercontent.com/u/28134655" "og:url": "/intent/145001/" "base:css": "/static/css/bootstrap.min.9c25540d6272.css" "base:extra-css": "/static/css/base.57997aeac1df.css" "base:favicon": "/static/favicon.acaa334f0136.ico" "base:body_class": "" "layout:logo": "/static/0oo.8d2a8bbef612.svg" "layout:index": "/" "layout:menu": "/menu/" "layout:categories": "/intents/" "layout:ideas": "/methods/" "layout:projects": "/projects/" "layout:users": "/users/" "layout:about": "/about/" "layout:help": "/help/" "layout:bug_report": "https://github.com/wefindx/0oo" "layout:login": "/accounts/login/" "layout:light-off": "/darken/?darken=true" "layout:set-multilingual": "/mulang/?mulang=true" "layout:lang": "语言" "layout:set-language-post-action": "/i18n/setlang/" "layout:csrf-token": "LEwEHC88I9W16ZwE8OUtfslsfiS38p51NdJwJ0H4lDJsH7mvHQUHnHN3AVbzCNox" "layout:input-next": "/intent/145001/" "layout:languages": [{"code": "ja", "is-active": "false", "name": "日本語"}, {"code": "lt", "is-active": "false", "name": "Lietuviškai"}, {"code": "zh-hans", "is-active": "true", "name": "简体中文"}, {"code": "en", "is-active": "false", "name": "English"}, {"code": "ru", "is-active": "false", "name": "Русский"}, {"code": "oo", "is-active": "false", "name": "O;o,"}] # "item:parent:intents": [{"title": "Database technology", "url": "/intent/144001/"}] "item:title": "Document based databases" "item:votes": +2 "item:add-vote": "#addnote" "item:intent": "/intent/145001/?l=cn" "item:base-administration": false "item:body": | MarkLogic, MongoDB, couchbase are document databases. They're often very fast. But unfortunately compared to relational databases they often do not support efficient joins. "item:permalink": "/intent/145001/?l=cn" "item:source-date": "" "item:owner": "chronological" "item:ownerlink": "/user/198/chronological" "item:created": "2022-05-10T11:20:35.007404" "item:intent:child:add": "/admin/hlog/intent/add/?parent=145001" # "item:method:items": "item:method:add": "/admin/hlog/method/add/?parent=145001" "item:comment:add": "/intents/addnote?parent=145001" "item:comment:add:csrf_token": "LEwEHC88I9W16ZwE8OUtfslsfiS38p51NdJwJ0H4lDJsH7mvHQUHnHN3AVbzCNox" "item:comment:form": |
  • 标记评论提出新问题。
  • 标记评论有潜在解决方案。
  • 标记评论有助于推理的事实。
  • 请,登录 # "item:comment:items": - "id": "r-279001" "mtrans": | 如何构建支持联接的基于文档的数据库? 文档数据库的一个共同弱点是它们通常不支持有效的连接。它们将文档记录表示为不透明的 blob。 我创建了附件项目来讨论我计划如何使用键值存储作为后端来实现基于文档的存储。文档的每个键都是一个单独的键,它们的排列使范围扫描有效,从而可以有效地进行散列连接。 "text": | How to build a document based database that supports Joins? A common weakness of document databases is that they often do not support efficient joins. They represent document records as an opaque blob. I created the attached project to talk of how I plan to implement document based storage using keyvalue storage as the backend. Each key of the document is a separate key and they are arranged so that range scans are efficient so that hash joins can take place efficiently. "owner": "chronological" "ownerlink": "/user/198/chronological" "permalink": "/intent/145001/?l=cn#r-279001" "created": "2022-05-10T12:06:49.570389" "vote": "" - "id": "r-280001" "mtrans": | 关键词是“高效”。效率与计算复杂度成反比,因此我假设您正在寻找新的算法来连接非结构化数据。 首先,这个问题已经在 SQL 数据库中解决了,对吧?为什么不看一下实现,然后从那里开始呢? 假设我们将原始数据作为 JSON(或字典、哈希图)的记录。那么您关心的是高效查询,这是索引(查询优化或查询算法)的主题。我们例行地将 SQL 数据库索引到 [ElasticSearch](https://en.wikipedia.org/wiki/Elasticsearch) 中,因为 SQL 数据库在用户关心的其他方式的文本搜索中不够好或不够灵活:我们使用其他数据系统,擅长它,并在其中保留数据副本。不是很节省空间,但很有效。我们可以对 NoSQL 做同样的事情——如果你需要类似连接的查询——只需通过专门的进程将数据“索引”到 SQL 数据库中,该进程即时解释和迁移 SQL 数据库,作为与NoSQL,总是在寻找新的字段,并在补充的 SQL 数据库中创建这些字段。当然,一次使用多个数据库并不是一个优雅的解决方案,所以我同意,我们需要改进基于文档的数据库。毕竟,模式并非不存在,每条记录都暗示着某种模式,当足够多的记录共享某些字段时,它可能证明创建新的 SQL 字段或外键是合理的。把它想象成一个大脑,当一个人看到足够多的特定类型的例子时,它就会意识到新的“物理定律”...... "text": | The keyword is "efficient". Efficiency is inversely proportional to computational complexity, and so, I assume, you look for new algorithms for joins with unstructured data. First, the problem is already solved in SQL databases, right? Why not to take a look at the implementation, and take it from there? Let's say we have raw data as records of JSON (or dictionaries, hashmaps). What you're concerned about then is efficient querying, which is a subject of indexing (query-optimizing, or query algorithms). We routinely index SQL databases into [ElasticSearch](https://en.wikipedia.org/wiki/Elasticsearch), because SQL databases are not good or not flexible enough in text search in other ways that users care about: we use another data system, that is good at it, and keep a copy of data in there. Not very space-saving, but works. We could do the same with NoSQL -- if you need join-like queries -- just "index" data into SQL databases, by specialized processes, that interprets and migrates SQL database on the fly, working as a complementary job in concert with the NoSQL, always looking for new fields, and creating those fields in the complementary SQL database. Sure, using many databases at once is not an elegant solution, so I agree, that we need improvement of document based databases. After all, schemas are not non-existent, every record implies a schema some sort, and when sufficiently many records share certain fields, it may justify creation of new SQL field or foreign key. Think of it like a brain that realizes new "laws of physics" when one sees sufficiently many examples of a specific type... "owner": "Mindey" "ownerlink": "/user/147/Mindey" "permalink": "/intent/145001/?l=cn#r-280001" "created": "2022-05-11T05:33:38.685314" "vote": "" - "id": "r-281001" "mtrans": | 我为 JSON 设计了一个键空间,它可以快速解码回 JSON,并且可以在 RocksDB 键值数据库范围扫描中快速扫描。 这让我们可以像关系数据库一样进行常规哈希连接。 这个 JSON { “名称”:“塞缪尔·斯奎尔”, “工作”: { “当前工作”:{“公司”: {"employeeCount": 2500}} } } {"_id": "1", “名称”:“塞缪尔·斯奎尔”, “爱好”:[ {“名称”:“上帝”},{“名称”:“数据库”},{“名称”:“多计算机系统”} ] } 至少变成以下keyvalue对象 0.0 = "塞缪尔乡绅" 0.1.0.0.0 = "2500" 0.0 = "塞缪尔乡绅" 0.1.0.0 = “上帝” 0.1.1.0 = "数据库" 0.1.2.0 = "多计算机系统" 基本上用键形成文件的平面结构。 “类型人”:“对象”, “键入人员。*”:“列表”, “键入人。*.0”:“字符串”, “键入人员。*.1”:“列表”, “键入人。*.1.*.0”:“字符串”, “键入人。*.1.*”:“对象”, “键入人。*.2”:“对象”, “键入人。*.2.0”:“对象”, “键入人。*.2.0.0”:“对象”, “键入人。*.2.0.0.0”:“数字”, “现场人员。*”:“列表”, "field people.*.1.*": "LIST", “现场人员。*.0”:“姓名”, "field people.*.1": "爱好", "现场人员。*.1.*.0": "姓名", “现场人员。*.2”:“工作”, "现场人员。*.2.0": "currentJob", "现场人员。*.2.0.0": "公司", "field people.*.2.0.0.0": "employeeCount", “现场人”:“人”, “现场人员。*”:“列表”, "field people.*.3": "words", "field people.*.3.*": "LIST", "现场人员.*.3.*.*":"LIST", "现场人员.*.3.*.*.*": "LIST", “键入人员。*.3”:“列表”, “键入人员。*.3.*”:“列表”, “键入人员。*.3.*.*”:“列表”, “键入人员。*.3.*.*.*”:“列表”, “键入人员。*.3.*.*.*.*”:“数字” "text": | I've designed a keyspace for JSON that is fast to decode back into JSON and is fast to scan in a RocksDB keyvalue database range scan. This lets us do a regular hash join as a relational database does. This JSONs { "name": "Samuel Squire", "job": { "currentJob": {"company": {"employeeCount": 2500}} } } {"_id": "1", "name": "Samuel Squire", "hobbies": [ {"name": "God"}, {"name": "databases"}, {"name":"multicomputer systems"} ] } Is turned into at least the following keyvalue objects 0.0 = "Samuel Squire" 0.1.0.0.0 = "2500" 0.0 = "Samuel Squire" 0.1.0.0 = "God" 0.1.1.0 = "databases" 0.1.2.0 = "multicomputer systems" Essentially form a flat structure of the document with keys. "type people": "object", "type people.*": "list", "type people.*.0": "string", "type people.*.1": "list", "type people.*.1.*.0": "string", "type people.*.1.*": "object", "type people.*.2": "object", "type people.*.2.0": "object", "type people.*.2.0.0": "object", "type people.*.2.0.0.0": "number", "field people.*": "LIST", "field people.*.1.*": "LIST", "field people.*.0": "name", "field people.*.1": "hobbies", "field people.*.1.*.0": "name", "field people.*.2": "job", "field people.*.2.0": "currentJob", "field people.*.2.0.0": "company", "field people.*.2.0.0.0": "employeeCount", "field people": "people", "field people.*": "LIST", "field people.*.3": "words", "field people.*.3.*": "LIST", "field people.*.3.*.*":"LIST", "field people.*.3.*.*.*": "LIST", "type people.*.3": "list", "type people.*.3.*": "list", "type people.*.3.*.*": "list", "type people.*.3.*.*.*": "list", "type people.*.3.*.*.*.*": "number" "owner": "chronological" "ownerlink": "/user/198/chronological" "permalink": "/intent/145001/?l=cn#r-281001" "created": "2022-05-11T05:41:54.871184" "vote": "" - "id": "r-282001" "mtrans": | 您将 SQL 数据库与文档存储同步的想法类似于我将 SQL 数据库与快速键值存储的 dyanamodb 同步的想法。 我想要最好的 NoSQL 性能,但需要 SQL 连接的强大功能。 "text": | Your idea of synchronizing a SQL database with a document store is similar to my thought of synchronizing a SQL database with dyanamodb which is a fast keyvalue store. I want the best of NoSQL performance but the power of SQL joins. "owner": "chronological" "ownerlink": "/user/198/chronological" "permalink": "/intent/145001/?l=cn#r-282001" "created": "2022-05-11T05:45:20.034132" "vote": "" "base:js": "/static/js/base.c7357c06cc89.js"