Size: 4356
Comment:
|
Size: 4161
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 11: | Line 11: |
概述 | Introduction |
Line 14: | Line 14: |
Socrates is a Model maker tools base on RDB and ORM。 It defines the dynamic structure storage and manage funcitons by triples semantic. Triples semantic can make it easy that descrption relations between data, so it wanderful for directed graph or network graph with circle or long path releations. |
|
Line 25: | Line 27: |
项目背景 Background on project | Background on project |
Line 28: | Line 30: |
* 需要建立一个数据库,支持多个统计报表输出,每个报表都是临时性的,数据量不大,但是报表的格式和内容变化很大 * 需要支持当前不能预期的数据内容 * 需要支持一些网状关系模型,节点间的关系变更频繁,经常需要沿节点间的路径进行访问 * 游戏中的人物、道具等信息,展开为关系表会非常庞大,但是往往只有一部分字段有信息,此类稀疏数据结构用关系数据库表达比较浪费 |
* We need create a database as fast as, to supoort mulit-reporters. Every one is small and used once but unique. * Need support some unkown data types. * Need create networt model, that is varable between nodes, and often been find by path. * Characters and toys in some games, would wery huge if description by RDB table. But it is sparse. |
Line 34: | Line 36: |
需要解决的问题 Problems to solve | Problems to solve |
Line 37: | Line 39: |
* 数据表的业务信息有内在的一致性,为每种变化建立一个新的数据表不经济 | * The business information of the data sheet has its own internal consistency. it is not efficient or economic to establish a new data model for each and every change. * Modify the data table structure when every data change is not actuality. * RDB model is not good at description deep recursion as such as tree. |
Line 39: | Line 43: |
* 频繁变化结构的数据,每次调整表结构不现实 * 关系数据库的模型适合表示大量同类数据的关系,但表达深度的递归关系,如树状结构,是比较难操作的 * 一些应用,如游戏中的人物、道具等信息,展开为关系表会非常庞大,但是往往只有一部分字段有信息,此类稀疏数据结构用关系数据库表达比较浪费 项目介绍 What's socrates? |
What's socrates? |
Line 49: | Line 47: |
* Socrates bases on the triple semantic logic model. It can descript model with dynamic structure and releations easy. * The model create by two layers: subject and segment * Every segment is a triple structure as (subject, predicate, object). * A subject is a subject descripted by some segments. * The predicate is what owned by the subject. * The object is what subject is in the predicate. * Every subject is a structure like dictonary. * The predicate must be a readable string, the name is the unique title. * The object is any type if the database can use it. * Socrates override RDB's statics and strongly data type, but play as dynamic data structure model. * Socrates bases on the python ORM tools named SQLAlchemy, it can use the greate power from SQLAlchemy. * Socrates in database is a unitive creater, a little storage tables, some meta command data. The storage table can create in runtime. |
|
Line 50: | Line 60: |
* 模型分为两个层次:条目和子句 * 每个子句是一个(主语,谓语,宾语)三元结构 * 每个主语表示一个条目,每一到多个同一主语的子句描述一个完整的条目 * 谓语表示主语拥有的特征 * 宾语表示主语在当前谓语下表达的信息内容 * 每个条目可以看成一个类字典的结构 * 谓语是可读的文本,它的命名是其唯一标识特性 * 宾语可以使用数据库平台所支持的任意数据类型 * Socrates封装关系数据库的静态强类型本质,在使用接口上表现为动态数据模型 * 访问层上,Socrates基于Python的ORM工具SQLAlchemy,可以使用SQLAlchemy的强大功能进行操作 * Socrates 在数据库层表现为一个统一序列器,若干个存储表,十个元语命令的数据行,存储表可以由用户动态添加 动机 Why socrates? |
Why socrates? |
Line 75: | Line 63: |
* 小粒度数据,可以方便的对单一属性精确的访问 | * Tiny size data model, access easy for any detail. * Socrates can use as dictonary. * Every subject is a structure as dictonary, can modify without effect other. * Subject and subject can create releations use segments by a easy way. * You can uses any RDB and use its specific data type. |
Line 77: | Line 69: |
* 支持对数据进行类似字典操作的访问 * 每一个数据条目就是一个类似字典的结构,可以独立的增删数据,不影响其它条目 * 条目之间可以通过子句方便的建立关系 * 支持多种不同数据库,允许使用具体平台的特定数据类型 简单的演示 Basic recurrence |
Basic recurrence |
Line 91: | Line 72: |
* 在不同数据库平台上“On Command”建立一个Socrates环境 * 注册新类型、新谓语 * 添加条目,建立关系 |
* "One command" create Socrates environment on different database platform. * Registe new type and predicate. * Write subject, new releation. |
Line 95: | Line 76: |
进一步的演示 More sophisticated recurrence |
More sophisticated recurrence |
Line 99: | Line 79: |
* 查询子句和条目 * 沿条目关系进行访问 * 访问和操作条目中的子句 * 谓词表达式 |
* Query segments and subject * Find by relation pathes. * Access segments in subjects. * Predicate Expression. |
Line 110: | Line 87: |
* 性能讨论 * 并发和分布 * 异构数据库的多节点集群 |
* Performance * Concurrent and Distributed. * Multi node by difference databases. |
Line 119: | Line 94: |
* Socrates 提供了灵活的数据管理方式,为动态和复杂数据的管理提供了一种通用的方式 * Socrates 在DSL和分布式集群方面还可以有所发展 * Socrates 的性能还有很大的提升空间 |
* Socrates Supports a flexible way to manage data. It can manager dynamic and complex data in a unitive technique. * Socrates need improve at DSL and distributed. * Socrates can be speed boost. |
:status: 草稿 ;LX;完成度75%; .. contents:: :local: - `PyCon2010亚洲 <PyCon2010>`_ Introduction ====== Socrates 是一个基于关系型数据库和ORM的通用数据库工具。它通过三元语义表达了对动态数据结构的存储和管理功能。使得开发人员可以在关系数据库中管理结构可变的 数据。三元语义可以方便的表达单一信息之间的关系,因此它很适合用来表达有向图,甚至有向有环的网状模型,或路径长度很长的关系。 Socrates is a Model maker tools base on RDB and ORM。 It defines the dynamic structure storage and manage funcitons by triples semantic. Triples semantic can make it easy that descrption relations between data, so it wanderful for directed graph or network graph with circle or long path releations. * 预计时长:25分钟 * 难度 Level :面向中级听众 * 类别 Categories:数据库 databases 参考: PyCon2010亚洲 Socratse ========= Background on project --------------------------------------- * We need create a database as fast as, to supoort mulit-reporters. Every one is small and used once but unique. * Need support some unkown data types. * Need create networt model, that is varable between nodes, and often been find by path. * Characters and toys in some games, would wery huge if description by RDB table. But it is sparse. Problems to solve ------------------------------------ * The business information of the data sheet has its own internal consistency. it is not efficient or economic to establish a new data model for each and every change. * Modify the data table structure when every data change is not actuality. * RDB model is not good at description deep recursion as such as tree. What's socrates? ------------------------------------ * Socrates 基于三元语义模型,可以方便的表达动态的数据结构和关系 * Socrates bases on the triple semantic logic model. It can descript model with dynamic structure and releations easy. * The model create by two layers: subject and segment * Every segment is a triple structure as (subject, predicate, object). * A subject is a subject descripted by some segments. * The predicate is what owned by the subject. * The object is what subject is in the predicate. * Every subject is a structure like dictonary. * The predicate must be a readable string, the name is the unique title. * The object is any type if the database can use it. * Socrates override RDB's statics and strongly data type, but play as dynamic data structure model. * Socrates bases on the python ORM tools named SQLAlchemy, it can use the greate power from SQLAlchemy. * Socrates in database is a unitive creater, a little storage tables, some meta command data. The storage table can create in runtime. Why socrates? ------------------------ * Tiny size data model, access easy for any detail. * Socrates can use as dictonary. * Every subject is a structure as dictonary, can modify without effect other. * Subject and subject can create releations use segments by a easy way. * You can uses any RDB and use its specific data type. Basic recurrence ---------------------------------- * "One command" create Socrates environment on different database platform. * Registe new type and predicate. * Write subject, new releation. More sophisticated recurrence ------------------------------------------- * Query segments and subject * Find by relation pathes. * Access segments in subjects. * Predicate Expression. Other capabilities of socrates ------------------------------ * Performance * Concurrent and Distributed. * Multi node by difference databases. 结尾 ---------- * Socrates Supports a flexible way to manage data. It can manager dynamic and complex data in a unitive technique. * Socrates need improve at DSL and distributed. * Socrates can be speed boost. .. macro:: -- ZoomQuiet [<<DateTime(2010-01-11T10:44:45+0800)>>]