JSON Support in PostgreSQL and Entity Framework
JSON 和JSONB的区别(What's difference between JSON and JSONB data type in PosgresSQL?)
- When should be used specific one?
- What's benefits or disadvantages with respect to other?
- JSON比JSONB的一个小的潜在好处是,它保留了数据的缩进。所以,如果你非常关心你的JSON的格式,或者有一些需要它在一个 特定的结构,JSON可能是有用的。(One small potential benefit of it over JSONB (which we’ll get to next) is that it preserves the indentation of the data coming in. So if you are extremely particular about the formatting of your JSON, or have some need for it in a particular structure, JSON can be useful.)Postgres的JSON类型只是在文本字段上提供了JSON验证。 如果你正在存储某种形式的日志数据,你很少需要查询,JSON可以正常工作。 因为它非常简单,所以写入吞吐量会更高。 对于任何更复杂的东西,建议使用JSONB。(Postgres’ JSON type simply provides JSON validation on a text field. If you’re storing some form of log data you rarely need to query, JSON can work fine. Because it’s so simple, it will have a lot higher write throughput. For anything more complex, I’d recommend using JSONB, which is covered below.)
- The B stands for better.JSONB是JSON的二进制表示,这意味着它不仅仅是文本,而是压缩和更高效的存储。它允许嵌套结构,使用基本的数据类型,并有一些内置的函数来处理它。尽管类似于hstore的最好的部分是索引。在JSONB列上创建GIN索引将为该JSON文档中的每个键和值创建一个索引。在文档中嵌套的能力意味着JSONB在大多数情况下优于hstore。
总结:
JSONB - 在大多数情况下
JSON - 如果你只是在处理日志,通常不需要查询,并使用更多的审计跟踪
hstore - 对于基于文本的键值看起来可以正常工作,但是一般来说JSONB在这里仍然可以工作得很好
参考文章:
1.Entity Framework: Storing complex properties as JSON text in database
3.When to use unstructured datatypes in Postgres–Hstore vs. JSON vs. JSONB(重点)
JSON Support in PostgreSQL and Entity Framework的更多相关文章
- Entity Framework 6 vs NHibernate 4
This article is dedicated to discussing the latest releases of the NHibernate and Entity Framework. ...
- Entity Framework + WCF REST JSON Service
利用EF 和WCF 建立一个REST JSON Service. 首先我们要下载一个Visual Studio 的Template 叫 "ADO.NET C# POCO Entity Gen ...
- Entity Framework 6连接Postgresql、SQLite、LocalDB的注意事项和配置文件
Postgresql Postgresql支持Code First的方式自动生成表,不过默认的模式是dbo而不是public,而且还可以自动生成自增主键. <?xml version=" ...
- Entity Framework - PostgresQL CodeFirst
经过几年的更新及业界对Entity Framework 的认同. 现在 EF 可以支持的数据库越来越多了.而PostgresQL 数据库现在也可以使用code first的方式来创建数据库了. 不多说 ...
- .NET Core开发日志——Entity Framework与PostgreSQL
Entity Framework在.NET Core中被命名为Entity Framework Core.虽然一般会用于对SQL Server数据库进行数据操作,但其实它还支持其它数据库,这里就以Po ...
- Newtonsoft.Json高级用法,json序列号,model反序列化,支持序列化和反序列化DataTable,DataSet,Entity Framework和Entity,字符串
原文地址:https://www.cnblogs.com/yanweidie/p/4605212.html 手机端应用讲究速度快,体验好.刚好手头上的一个项目服务端接口有性能问题,需要进行优化.在接口 ...
- PostgreSQL Entity Framework 自动迁移
1.依次添加NuGet包 EntityFramework.Npgsql.EntityFramework6.Npgsql,会自动生成一些配置文件,不过缺少数据库驱动的配置节点: <system.d ...
- Entity Framework 6.0 Tutorials(6):Transaction support
Transaction support: Entity Framework by default wraps Insert, Update or Delete operation in a trans ...
- Entity Framework Tutorial Basics(33):Spatial Data type support in Entity Framework 5.0
Spatial Data type support in Entity Framework 5.0 MS SQL Server 2008 introduced two spatial data typ ...
随机推荐
- android studio 定位具体的错误原因
编译一个数据监测APP的时候出现了报错: Error:Compilation failed; see the compiler error output for details. 在网上查到方法如下: ...
- Home Assistant-自动化设备
触发器(trigger) 条件(condition) 动作(action) 自动化中的模板(template) 触发器(trigger) 时间(time)触发器时间触发器在指定的时间触发规则,可以是某 ...
- day23 Pythonpython 本文re模块
re模块用于对python的正则表达式的操作. 字符: . 匹配除换行符以外的任意字符 \w 匹配字母或数字或下划线或汉字 \s 匹配任意的空白符 \d 匹配数字 \b 匹配单词的开始或结束 ^ 匹配 ...
- Luogu2792 [JSOI2008]小店购物
Luogu2792 [JSOI2008]小店购物 重题 bzoj4349 最小树形图 有 \(n\) 个物品,每个物品有价格 \(c_i\) 和所需个数 \(k_i\) ,所有物品必须恰好买 \(k_ ...
- 【vue】iView-admin后台管理系统
1.目录手册解析 2.跨域解决(axios访问服务器由于前端地址和后端地址不同源会出现跨域问题) 实例2 3.动态菜单导航+权限 4.webstorm 配置 Eslint 代码检查和自动修复
- .Net外包篇:我是怎么看待外包的(二)
延续上篇文章.net外包篇:我是如何看待外包的. 从这家公司辞职以后,得益于我校园信息平台和高校信息管理的经验,我进入了一个互联网类型公司.以前的经历,环环相扣,步步提升. 互联网时代 第四家客户(未 ...
- js中布尔值为false的六种情况
下面6种值转化为布尔值时为false,其他转化都为true 1.undefined(未定义,找不到值时出现) 2.null(代表空值) 3.false(布尔值的false,字符串"false ...
- docker创建nginx+php-fpm+mysql环境(一分钟搭建lnmp)
下载镜像 docker pull bitnami/php-fpm #下载php-fpm镜像 docker pull nginx #下载nginx镜像docker pull mysql:5.5.59 # ...
- Python入门-字符串常用方法
Python 字符串 字符串是 Python 中最常用的数据类型.我们可以使用引号('或")来创建字符串. 创建字符串很简单,只要为变量分配一个值即可. var1 = 'Hello Worl ...
- pip3 升级失败的解决方法!亲测有效
pip3 --default-timeout=10000 install -U pip 注意:由于防火长城的存在,会导致更新失败,如果你加上--default-timeout=10000 这个就ok ...