Quantcast

Storing objects in the database as JSON

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Storing objects in the database as JSON

Nick Hall
Devs,

I have started to look at the following feature request:

9392: Do we need to pickle DB-API blobs?

https://gramps-project.org/bugs/view.php?id=9392

One option would be to store objects in the database as JSON. This would
make all our data accessible in sqlite or postgres.

https://www.sqlite.org/json1.html

https://www.postgresql.org/docs/current/static/datatype-json.html

Such a change would require modifying code that currently uses the raw
object format.

I would be interested in your thoughts and opinions.

Regards,


Nick.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Storing objects in the database as JSON

manzi.sam
On 19 February 2017 at 09:03, Nick Hall <[hidden email]> wrote:
make all our data accessible

+1

I'm all for any change that makes it easier to access the data outside of GrampsĀ  without using Gramps XML.

On 19 February 2017 at 09:03, Nick Hall <[hidden email]> wrote:
Devs,

I have started to look at the following feature request:

9392: Do we need to pickle DB-API blobs?

https://gramps-project.org/bugs/view.php?id=9392

One option would be to store objects in the database as JSON. This would
make all our data accessible in sqlite or postgres.

https://www.sqlite.org/json1.html

https://www.postgresql.org/docs/current/static/datatype-json.html

Such a change would require modifying code that currently uses the raw
object format.

I would be interested in your thoughts and opinions.

Regards,


Nick.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Storing objects in the database as JSON

enno
In reply to this post by Nick Hall
Hello Nick,

> I have started to look at the following feature request:
>
> 9392: Do we need to pickle DB-API blobs?
>
> https://gramps-project.org/bugs/view.php?id=9392
>
> One option would be to store objects in the database as JSON. This would
> make all our data accessible in sqlite or postgres.
>
> https://www.sqlite.org/json1.html
>
> https://www.postgresql.org/docs/current/static/datatype-json.html
>
> Such a change would require modifying code that currently uses the raw
> object format.
>
> I would be interested in your thoughts and opinions.
To me, it looks like a waste of time. Storing JSON may make data
somewhat more accessible, but it still gives us no referential
integrity, and it still means that I'd need to use two languages (JSON
and SQL) to access my database.

I'd rather have the whole database converted to the model used by the
SQLite exporter. When that model is used through the DB-API, anyone can
use their favorite back-end, and their favorite tools, and language.

regards,

Enno


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Storing objects in the database as JSON

Luigi Toscano
In reply to this post by Nick Hall
Nick Hall ha scritto:

> Devs,
>
> I have started to look at the following feature request:
>
> 9392: Do we need to pickle DB-API blobs?
>
> https://gramps-project.org/bugs/view.php?id=9392
>
> One option would be to store objects in the database as JSON. This would
> make all our data accessible in sqlite or postgres.
>
> https://www.sqlite.org/json1.html
>
> https://www.postgresql.org/docs/current/static/datatype-json.html
>
> Such a change would require modifying code that currently uses the raw
> object format.
>
> I would be interested in your thoughts and opinions.
>

If I remember correctly this was discussed in the past without a proper
decision, but I think that it would make more sense to adapt the database
structure to store the data in a non-blob format, using the full power of
database engines.

Ciao
--
Luigi


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Loading...