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 ...
随机推荐
- Alex网络
alexNet共有八层网络卷积层1:输入224*224*3 卷积核11*11*3*96 步长为4 然后是ReLU.局部归一化.3*3步长为2的最大值池化卷积层2:输入为28*28*96 卷积核5*5* ...
- Window 中杀死指定端口 cmd 命令行 taskkill
https://www.cnblogs.com/xwer/p/7780571.html
- java 关于打断点
比如:前台传过来参数中文乱码,需要decode才可以使用, 判断问题. debug 在 DispatcherServlet OncePerRequestFilter 打断点, 查看前台过来的中文在哪里 ...
- UVA1152-4 Values whose Sum is 0(分块)
Problem UVA1152-4 Values whose Sum is 0 Accept: 794 Submit: 10087Time Limit: 9000 mSec Problem Desc ...
- tensorflow错误:Shape (10, ?) must have rank at least 3
错误的代码 outputs, _ = tf.nn.dynamic_rnn(cell, X, dtype=tf.float32) 错误原因: 该错误的意思是传入的数据集X的维度只有二维,而tf.nn.d ...
- L2-012 关于堆的判断 (25 分)
就是一个最小根堆. 最小根堆的性质,根节点小于等于子树的完全二叉树吧. 构建最小根堆的过程就是一个自下向上的过程. #include<iostream> #include<strin ...
- 邮票面值设计 (动态规划+DFS)
题意:https://ac.nowcoder.com/acm/problem/16813 思路: 深度搜索:每一层枚举一个面值,然后通过dp进行检查,并通过已知面值得到最多n张得到的最大表示数. 其实 ...
- Python:Day40 html
URL包括三个部分:协议.域名.路径 htyper text markup language (html) 即超文本标记语言 前端一共包括三个内容:html.css.js html做为基础,让CSS ...
- 初学Python——集合及其运算
一.集合定义及其功能 集合是一个无序的.不重复的数据组合,和字典列表一样也是一种数据类型. 集合两个最主要的功能:①去重(把一个列表变成集合,就自动去重了) ②关系测试(测试两组数据之间的交.并.差集 ...
- linux内存源码分析 - 内存压缩(实现流程)
本文为原创,转载请注明:http://www.cnblogs.com/tolimit/ 概述 本文章最好结合linux内存管理源码分析 - 页框分配器与linux内存源码分析 -伙伴系统(初始化和申请 ...