We have been using mongo over the last three years on our project and it has been pretty smooth so far. However, lately I gave some thoughts into what our project would look like if we used PostgreSQL instead. I tried to figure out what problems Mongo solves that PostgreSQL doesn't.
I am far from being a database expert, I just know enough basics to query what I need, so feel free to correct/complete the following:
- Mongo has been built to store json objects -> Yes, but from what I understand benchmarks indicate that PostgreSQL is faster at reading/storing/indexing json/jsonb content. I don't think that it is good reason to use it.
- Mongo is schemaless -> There might be some usecases, but I bet in most cases this problem can be worked around. Especially in a database with JSONB support.
- MongoDB horizontal scaling is way easier than PostgreSQL. Yes, it seems that scaling horizontally Mongo is extremely easy compared to any other relational database.
And ... that's it. But there is probably more.
At the moment, here's how I would summarize MongoDB benefits if asked my opinion when starting a project:
- For a small projects or a prototype: ease of use, ease of configuration, don't require too much thinking into my data model while I am experimenting
- For a bigger project: horizontal scaling should be easier
Does that sound accurate to you? Am I missing anything important?
Honestly, the existence of Mongo is mostly an indictment about how user-hostile conventional RDBMS is. The fact that other DBs can do what Mongo does is not helpful when there is no easy workflow to do what Mongo does.
The fact that I theoretically implement a web-based CMS in C and it could be more performant than all these web-language CMS products doesn't mean that C is better for making a CMS.
> "Honestly, the existence of Mongo is mostly an indictment about how user-hostile conventional RDBMS is."
That's nonsense. I've taught people to use SQL before, even people with little to no programming experience. After the initial concepts were understood it was fairly easy to gradually expand knowledge over time.
The basic SQL keywords to start getting useful information out of a RDBMS are:
SELECT
FROM
WHERE
INNER JOIN
LEFT JOIN
ON
AS
AND
OR
Those 9 keywords give you a good starting point for exploring SQL. It's really not hard. You could probably learn enough to get started in a couple of hours, and it's easy to expand your knowledge as and when you need to once you've got the basics sorted.
That's after you set up users, schemas, tables, columns, oddly-named datatypes with unexpected behaviors, etc.
The RDBMS is a lie. It's a beautiful kernel of relational theory wrapped in a 60-foot ball of hacks, tweaks, duct-tape, bubble-gum, and hate. The document store doesn't lie. It doesn't pretend. It's honest that it's stupid and it's a glorified hashtable with a string in it. It doesn't make any ridiculous pretenses of having a Sufficiently Smart Query Optimizer that will inevitably let you down and leave you pulling your hair out trying to figure out why on earth a simple, straightforward query is running so goddamned slow.
Then you build a complicated model and have to figure out from the query plan why your query is slow and deal with indices and foreign keys and all that nonsense.
Meanwhile an object DB may be inefficent and clumsy, but it gets all of that stuff out of the way. Also, if you don't want to join, you can work around that by duplicating the data all over the place. Something you can't do with an RDBMS because tables are fundamentally flat and so you can't stuff a parent-child relationship into a single table.
> That's after you set up users, schemas, tables, columns
You have software engineer you similarly should have a data engineer (i.e. a DBA). Nearly 50 years has passed and we still didn't find a better way to represent data, so perhaps it is the right model. The only difficult part is to bother enough to learn it.
> oddly-named datatypes with unexpected behaviors [...] 60-foot ball of hacks, tweaks, duct-tape, bubble-gum, and hate
That's only when using MySQL
> Meanwhile an object DB may be inefficent and clumsy, but it gets all of that stuff out of the way. Also, if you don't want to join, you can work around that by duplicating the data all over the place. Something you can't do with an RDBMS because tables are fundamentally flat and so you can't stuff a parent-child relationship into a single table.
You absolutely can store data inefficiently in RDBMS for example in Postgres you can create a table with two columns one named key, and another data. The data type for the second column can be JSONB. End you're essentially have equivalent of Mongo's collection.
But in that case you store data inefficiently and if your application starts evolving and you need to make different queries things will get more complex quickly.
> "That's after you set up users, schemas, tables, columns, oddly-named datatypes with unexpected behaviors, etc."
You shouldn't jump in at the deep end when learning this stuff, getting a feel for how an existing database works before creating your own is helpful, and you can download sample databases to play around with when you start learning if you don't have access to one already. Aside from this recommendation, if you're starting out learning about RDBMS, then SQlite is a good starting point, and the setup of a SQlite database is fairly simple.
If you're starting from scratch with a brand new database, here are some of the SQL keywords you'll find useful:
CREATE TABLE
ALTER TABLE
DELETE TABLE
TRUNCATE TABLE
INSERT INTO
UPDATE
SET
DELETE FROM
VARCHAR
INT
DECIMAL
PRIMARY KEY
FOREIGN KEY
REFERENCES
Furthermore, if you're using a decent DB GUI frontend, you don't even need to remember most of the above, aside from VARCHAR (for strings), INT (for whole numbers) and DECIMAL (for numbers with a fractional element). Reason being, you can do all of the database setup graphically. Tools like SQL Server Management Studio help in reducing friction.
I am working on a product with multiple engineers and we adopted Reactiflux + SPA + Node + a bunch of fancy tools.
While I love that stack, it took me a while to realize that for most of my side projects, building alone a prototype with all those things is killing my productivity. A messy Rails api with angular1 or even Rails + ERB are way quicker.
Letting go best/latest practices and go for the the non-fancy (and sometimes a bit dirty) way is harder than it seems.
We are more and more nostalgic about everything. But I don't see how people can think TV shows were better in the 70s, 80s or even 90s. Since 2000 we live in the golden age of TV shows. We got The Wire, the Sopranos, Mad Men, the Shield, (Game of thrones?, Westworld?) and a ton of original concepts. I tend to think that nowadays there is more originality and risk taking in TV shows than in the movie industry.
This summer, I watch Twin Peaks The Return, some episodes are the weirdest things I have seen on a mainstream TV channel. I am amazed it was allowed to air at prime time.
"But I don't see how people can think TV shows were better in the 70s, 80s or even 90s. Since 2000 we live in the golden age of TV shows."
I'm on the same camp. Absolute majority of TV series from pre-Internet times were dull, boring and non distinctive. Sure, there were some amazing exceptions (mostly named throughout this thread), but I personally, find many better TV series in the span of the last 10 years than in previous 30 years or so. What impresses me most that recent series are much more realistic, characters are deep, themes are more muddy not unlike in older series where black&white characters, good vs evil themes, mandatory happy ending etc. was nearly universal. Imagine something like Game of Thrones (not that it's the paramount of our times, but more for its brutality, nudity etc.) being aired on prime time during 70s or 80s..
I am amazed that in 2017, there is still people qualifying Bitcoin or Ethereum of ponzi schemes. Crypto currencies have a lot of problems (technical, economical, philosophical, ICO are insanes) but saying they are ponzi schemes is plain wrong. And it just takes 5 minutes of reading on Ponzi Schemes signs and basic knowledges of how those currencies work to understand why.
In many cases crying "ponzi" is likely an exclamation of "something wrong here" which your comment gives several examples. But cash, check and other instruments all have something wrong.
I'll suggest that the difference isn't that people know the details of how for example checks clear, few non-experts learn all the details, BUT virtually everyone knows where to go if there is a problem (bank branch). Most non-experts at this point in crypto currency would have no idea where to even go to investigate a problem.
It may be true today but the banking system has matured to that point over hundreds of years. There have been many instances of runs on the bank, run away inflation, worthless paper currencies like the Continental in the history of cash.
Gold isn't a "Ponzi scheme". Even if you believe that investing in gold makes no sense, and it's a useless metal with no practical purposes, and it's a bubble waiting to burst and so on, that still doesn't make it a Ponzi scheme.
Even if all of those beliefs above were true, it still wouldn't be a Ponzi scheme. As someone else posted in here, Ponzi Scheme has a fairly specific definition which "Gold" doesn't meet.
[Cryptocurrency] isn't a "Ponzi scheme". Even if you believe that investing in [Cryptocurrency] makes no sense, and it's a useless [tech] with no practical purposes, and it's a bubble waiting to burst and so on, that still doesn't make it a Ponzi scheme.
Even if all of those beliefs above were true, it still wouldn't be a Ponzi scheme. As someone else posted in here, Ponzi Scheme has a fairly specific definition which "[Cryptocurrency]" doesn't meet.
Except that oil is scarce to due to the laws of nature and that gives it it's price, whereas ether is artificially scarce. You could make a new piece of software called Blether that provided the exact same service and you could instantly 'double' the supply. Whereas with oil, you can't 'magic' your way into more of the resource by deploying some code.
Ether is not like oil at all. You only somewhat need ETH. Nothing stops you from using ETC. Or starting your own fork (either private or public). Your contracts will work there just fine.
On the other hand, it is not likely you can deploy some magic oil machine in your closet with almost 0 investments and start producing $5c / barrel oil.
Yes but ETH and gas are not the same thing. You use ETH to buy your gas. The gas is burned up in use. ETH is paid to the miners, who can use it to pay their expenses.
AFAIK the definition of a Ponzi scheme is a fake investment where no actual investment in productive activities takes place and all profits are paid out from increasing intakes.
Bitcoin matches this definition exactly since pumping up the currency is not connected to any real world productive activity.
Ethereum has some theoretical practical uses but most of the ICO nonsense is pure Ponzi.
Defining a Ponzi can be difficult because in order for something to truly be a Ponzi scheme it must be engaged in with fraudulent intent.
Really stupid people who "invest" in really stupid things and waste their money on useless stupid activity don't count as a Ponzi because they don't have fraudulent intent. They are just really stupid.
Whatever participants in digital currencies are not in the first category are in the second category so it isn't much to be excited about.
Well you have a poor understanding of the definition of a Ponzi scheme. ICOs do not make any promise of a return on investment or paid dividends, the way a Ponzi operator would. Coin makers do not use the income from new investors to pay dividends to older investors, the way a Ponzi operator would.
You are buying the currency, once you receive it the contract with the coin's creators is fulfilled, you are not an investor, you do not own any shares of any company. It is a one-way transaction.
Perhaps you meant pyramid scheme, of which ICOs are also not an example.
>AFAIK the definition of a Ponzi scheme is a fake investment where no actual investment in productive activities takes place and all profits are paid out from increasing intakes.
The way to tell your understanding is wrong is that it would describe every currency, and every possible asset (land, valuables, etc).
To be fair, Ethereum looks like a scheme of some kind (not Ponzi necessarily). The vast majority of the ether is controlled by a single company, which is literally just selling it for money.
... I get the other advantages to Ethereum, but it's not Bitcoin where there is actually a distributed number of people managing it.
Some people get that impression because the majority of ETH was premined. What they miss is that most of that was sold to the general public in the presale. Only 12% of it was not; half of that went to team members (some now sold) and the other half to the nonprofit foundation which is continuing development of the protocol.
they resemble ponzi schemes in that you get in early and benefit as more people adopt it. further, like all fiat currency, there is no "underlying" value, so your success depends entirely on how many other people adopt it. so, to me, it does resemble a ponzi scheme. my guess is that you take issue with the connotation of that word, implying its a scam. i dont think it is, but i do think it resembles a ponzi scheme.
One of the reasons Fiat currency has value is because its the only currency that the U.S. Government accepts debt and tax payments in. That is tremendous power and authority behind the currency.
It is quite rare in history that a fiat currency was put in place, that didn't have a corresponding broad based tax in order to enforce its use and give the issuer, usually a sovereign or government, an advantage in being the source of the fiat.
Fiat currencies have underlying value. If you want to operate a steel mill in the US without getting arrested, you need to procure a certain quantity of US Dollars and remit it to the IRS. No, you can't pay your taxes with bitcoins. It has to be dollars. That's why the US Dollar has inherent value - you can redeem them for the right to operate a business in the US.
You can redeem them for the privilege of operating a legally distinct incorporated business entity in the US.
At a strictly technical level, I believe it may still be possible to live your life entirely lawfully, without being taxed, but the amount of legal analysis necessary to work out exactly how that may be accomplished is beyond me. It's far easier to just earn enough dollars, and then pay up.
(Note that relying on Supreme Court opinions will not get you to anywhere you might want to be if the IRS decides you need to pay them.)
What? Of course exercises of legal rights can be taxed. Taxing natural rights is problematic, of course, but the legal rights granted to you - like operating a steel mill, or enforcing the ownership rights to your home for you, or operating a motor vehicle - are completely taxable.
You have a right to vote, so levying a tax upon the act of voting is not permissible. Obviously, if it is a right, it means that even someone with zero money should be able to do it, and you can't pay a tax if you have zero money. The tax prevents poor people from fully exercising their rights.
As such, taxes that appear to be on the exercise of a right are usually worded such that they are actually excises on a legal privilege that is suspiciously similar, or upon an accessory privilege, without which the exercise of the right is largely pointless.
You can build as many steel mills as you want on your own property. But doing so is pointless if you cannot transport the steel over public roads or sell it to customers in the public marketplace, unless you have a great need for vast quantities of steel on your own property. There are quite a lot of foil-hat-wearers out there that try to tease out the line of separation between taxable privileges and untaxable rights, but the reality is that none of their opinions hold any sway unless they have millions of dollars to spend on lawyers and lobbyists, or millions of supporters to march on the capital. As such, a lot of "Sovereign Citizen" propaganda revolves around the insane idea that a state with near unlimited power may be compelled to obey its own laws, even when doing so would be contrary to its own interests.
This is the same phenomenon that results in your tabletop RPG's resident rules lawyer getting their characters killed off. For any obscure rule they can argue to their own advantage, the GM can always just roll behind a screen and say, "Oh dear, the goblin scored a critical hit. What an unlucky occurrence. Your character dies. Again."
For instance, the Supreme Court has also ruled that it is permissible to prevent someone from growing a crop on their own property, never to be exported off of that property, because that satisfies some demand that would otherwise impact prices in interstate commerce. Essentially, the state said it can prevent you from growing corn in your garden, because that means you won't buy as much corn--which could be imported from another state--at the grocery store. In order for that ruling to be consistent with the poll tax opinion, the US cannot recognize that engaging in commerce and providing for your own livelihood is a natural right. Because that would mean it couldn't be taxed, and the government needs those taxes more than you need to buy your own food and shelter.
Anyway, the point I'm trying to make is that many of the things you may call "legal right" are probably just legal privileges, and that if something is taxed, the government does not recognize that you have a right to have it or do it. This is disturbing to some people, because it provides a practical test to unequivocally show that they have far fewer rights recognized by law than they believe themselves to have.
I've asked this for quite some time and still no one was able to answer.
If the power has shifted to an elite who controls the great majority of the currency, and has the power to withdraw/dump coins (basicaly influencing the supply side of the market, and control the value) - I'm pretty sure there are people/organizations who invested into such positions - and have the power to simulate value and draw people into this gold rush...
Where is the line drawn between this and a scam/fraud?
Is it when the control party withdraws all the value from it and dumps it?
For as long as everything is being valued in a positive way, everything is fine?
If you are french working in a different country, you can contribute to the french pension plan through the "Caisse des Français de l´etranger" if you want to. However you would still have to pay the Canadian pension plan.
There is an agreement between France and several countries including Canada. Once you will retire, if you have worked 10 years in Canada and 30 years in France, then you will get 3/4 of your money from the French Pension plan, and 1/4 from the Canadian one.
This agreement works whether you are French or Canadian.
I am far from being a database expert, I just know enough basics to query what I need, so feel free to correct/complete the following:
- Mongo has been built to store json objects -> Yes, but from what I understand benchmarks indicate that PostgreSQL is faster at reading/storing/indexing json/jsonb content. I don't think that it is good reason to use it.
- Mongo is schemaless -> There might be some usecases, but I bet in most cases this problem can be worked around. Especially in a database with JSONB support.
- MongoDB horizontal scaling is way easier than PostgreSQL. Yes, it seems that scaling horizontally Mongo is extremely easy compared to any other relational database.
And ... that's it. But there is probably more.
At the moment, here's how I would summarize MongoDB benefits if asked my opinion when starting a project:
- For a small projects or a prototype: ease of use, ease of configuration, don't require too much thinking into my data model while I am experimenting
- For a bigger project: horizontal scaling should be easier
Does that sound accurate to you? Am I missing anything important?