News for hackers. Stuff that matters.
Re:PostgreSQL 10 Beta 1 Released by zachmax on Thursday May 18, 2017 @10:53AM (#14367703)
I feel like this feature replaces almost all of Mongo's use cases!
Re:PostgreSQL 10 Beta 1 Released by jonknee on Thursday May 18, 2017 @11:52AM (#14368275)
As soon as Postgres adds the "random data loss" feature they will have a full superset of Mongo.
Re:PostgreSQL 10 Beta 1 Released by colanderman on Thursday May 18, 2017 @12:10PM (#14368427)
You can always turn off fsyncs…
Re:PostgreSQL 10 Beta 1 Released by knodi on Thursday May 18, 2017 @12:36PM (#14368673)
Then you might as well use pg.
Re:PostgreSQL 10 Beta 1 Released by lima on Thursday May 18, 2017 @01:04PM (#14368938)
I think he meant that you can turn off fsyncs in pg in order to add random data loss :-)
Re:PostgreSQL 10 Beta 1 Released by X86BSD on Thursday May 18, 2017 @04:49PM (#14370978)
You might be interested in this paper where the author touches on fsync.

https://people.freebsd.org/~seanc/postgresql/scale15x-2017-p...

Re:PostgreSQL 10 Beta 1 Released by htsh on Thursday May 18, 2017 @11:23AM (#14367988)
I'm interested. When you say almost, can you elaborate on any remaining use cases when you'd use Mongo?
Re:PostgreSQL 10 Beta 1 Released by byefruit on Thursday May 18, 2017 @11:32AM (#14368072)
At my previous company we made heavy use of its lossy compression feature.
Re:PostgreSQL 10 Beta 1 Released by pkhagah on Thursday May 18, 2017 @02:07PM (#14369577)
What lossy compression? Were you guys throwing bits into /dev/null?
Re:PostgreSQL 10 Beta 1 Released by infogulch on Thursday May 18, 2017 @05:54PM (#14371439)
Is that related to the cool "hash compression" technology I hear about? Apparently it can compress an arbitrarily large file into just a few bytes, amazing!
Re:PostgreSQL 10 Beta 1 Released by X86BSD on Thursday May 18, 2017 @12:42PM (#14368724)
You would get compression with Postgres running on ZFS.
Re:PostgreSQL 10 Beta 1 Released by adamzochowski on Thursday May 18, 2017 @05:52PM (#14371426)
Postgresql has compression by default on, for all large text and other large fields that get great benefit of compression. From documentation -" The technique is affectionately known as TOAST (or "the best thing since sliced bread"). "- https://www.postgresql.org/docs/8.0/static/storage-toast.htm...
Re:PostgreSQL 10 Beta 1 Released by kinghajj on Thursday May 18, 2017 @12:45PM (#14368760)
Lossy compression, not lossless.
Re:PostgreSQL 10 Beta 1 Released by sqeaky on Thursday May 18, 2017 @04:04PM (#14370639)
Database plus Copy-On-Write file systems sound like a bad idea. I am imagining a modest 100gb database being re-written for every change.

I am sure there is some way to work around this, but wouldn't this be the default behavior with a typical database and typical COW file system?

Re:PostgreSQL 10 Beta 1 Released by X86BSD on Thursday May 18, 2017 @04:51PM (#14370986)
You might be interested in reading this paper: https://people.freebsd.org/~seanc/postgresql/scale15x-2017-p...
Re:PostgreSQL 10 Beta 1 Released by sqeaky on Thursday May 18, 2017 @05:30PM (#14371265)
I am interested and I appreciate the thought and link, however these appear to be the slides to a talk without the actual talk. If so they are of limited use because the slides never have all the information the presenter has, and that information is often just a summary.

Is this the correct talk: https://youtu.be/dwMQXLOXUco?t=5380 ?

Re:PostgreSQL 10 Beta 1 Released by X86BSD on Thursday May 18, 2017 @05:49PM (#14371406)
Yes, sorry about that, that is the corresponding talk to the slides. Thanks for pointing that out.
Re:PostgreSQL 10 Beta 1 Released by cryptonector on Thursday May 18, 2017 @05:32PM (#14371281)
First, you have to make sure the page sizes for the FS and DB match. That's a critical requirement. But yes, you'll get write expansion twice.
Re:PostgreSQL 10 Beta 1 Released by crypto5 on Thursday May 18, 2017 @03:20PM (#14370228)
In random cloud provider you may not get FS with compression on your machine..
Re:PostgreSQL 10 Beta 1 Released by fnayr on Thursday May 18, 2017 @12:34PM (#14368655)
I know it's pretty popular to hate on Mongodb now (even more so than it was to love on Mongodb 4 years ago), but there are still areas where it's better than a relational db. In game development, it's extremely helpful (especially as an "indie") to change the structure on a whim so easily. Also based on the design of the game I'm working on, I believe the document structure captures the structure of the data so much better than if I was forced to make a bunch of tables. This aides in understanding the representation of our game's data, and I believe (but haven't tested) it will be faster than a relational db for my use case, but that's an ancillary benefit anyway.
Re:PostgreSQL 10 Beta 1 Released by ssijak on Thursday May 18, 2017 @12:41PM (#14368723)
But the posters above you said that JSON and JSONB types in Postgres, and functionality around them, eliminated the need to use other databases for document type data.

What you are describing can be done with PostgreSQL. One thing that is missing is better client libraries that make use of those data types. Morphia wins for now in that regard.

Re:PostgreSQL 10 Beta 1 Released by manigandham on Thursday May 18, 2017 @06:09PM (#14371514)
.NET has great support with Marten:

http://jasperfx.github.io/marten/

Re:PostgreSQL 10 Beta 1 Released by fnayr on Thursday May 18, 2017 @01:05PM (#14368940)
My claim wasn't that it didn't fulfill their needs, it was that it doesn't fulfill all needs (gamedev is one example that I'm familiar with).

Postgres storing JSON types != All mongo functionality

I'm sure I could achieve everything I'm doing in mongo by some roundabout way in Postgres, but if you're doing a large amount of reading/modifying partial fields within JSON structure, it's the exact use case for mongo.

Re:PostgreSQL 10 Beta 1 Released by jerrysievert on Thursday May 18, 2017 @01:53PM (#14369427)
https://www.github.com/JerrySievert/MongoLike

that said, I actually use partial JSONB updates on a regular basis, but I tend to use PLV8 to do the heavy lifting.

Re:PostgreSQL 10 Beta 1 Released by threeseed on Thursday May 18, 2017 @04:22PM (#14370768)
What is the point of posting that ?

(1) It's a proof of concept, (2) it hasn't been updated in 3 years and (3) it still isn't the same syntax as MongoDB.

The point still remains that PostgreSQL isn't just a 1-1 replacement for MongoDB which is pretty common sense to me anyway.

Re:PostgreSQL 10 Beta 1 Released by jerrysievert on Thursday May 18, 2017 @10:07PM (#14372545)
Wow, that's a pretty hostile response.

1) it's a proof of concept that others have improved upon to show that you can indeed replace the functionality of mongo that most developers tend to rely on.

2) neither has mongodb at that level

3) that's correct, you need to actually use the term SELECT when you use the functions

and you are correct, pg is missing the random data loss that comes with mongo. it will never be 1-1 in regards to that.

EDITING TO ADD:

the important part is the note (the bulk of the comment) that I'm updating partial JSONB data on a very regular basis, and do it using PLV8, getting rid of the need for an unreliable database and instead using exactly what this news story is about.

Re:PostgreSQL 10 Beta 1 Released by philliphaydon on Thursday May 18, 2017 @02:31PM (#14369783)
Marten for .net
Re:PostgreSQL 10 Beta 1 Released by htsh on Thursday May 18, 2017 @12:56PM (#14368860)
A small independent game is where I've used it before as well. And currently I'm working on an app/game sort of thing where it makes a lot of sense because we're iterating often and fast. I like that it kinda gets out of my way and just works, though perhaps I would not so much had I experienced the data loss others speak of.
Re:PostgreSQL 10 Beta 1 Released by fnayr on Thursday May 18, 2017 @01:10PM (#14369002)
Yeah I've read some horror stories about that too. I think that the improvements to concurrency (ala WiredTiger), will help wth that, as well as making sure to think about possible concurrency issues from the outset, as I've tried to do.
Re:PostgreSQL 10 Beta 1 Released by the_why_of_y on Friday May 19, 2017 @06:03AM (#14374181)
Have you heard of ToroDB? FWIW they have benchmarks that claim it's running faster on top of Postgres than MongoDB does natively.

"ToroDB Server

It is a MongoDB-compatible server that supports speaks the MongoDB Wire Protocol (and therefore can be used with the same drivers used to connect to any standard MongoDB server) but stores your data into a reliable and trusted ACID database."

https://github.com/torodb/server