Database drivers: Naughty or nice?
prequel.co
prequel.co
I came in wanting to check if any of the drivers I use were affected by any of the bugs they found. No idea!
We also think the information provided in the post is valuable as is: it's easy enough to check whether a driver you use faces any of the issues we mention.
With that said, here's a bit more color:
- the native Snowflake driver for GoLang does not implement COPY functionality (or at least it did not when we last tried to use it).
- the memory leaks are pretty prevalent across ODBC drivers. It's worth watching out for that one if you're using any ODBC driver.
- the breaking change on connection string was Databricks' GoLang driver.
- the DECIMAL one is pretty prevalent too. BigQuery only allows you to go up to DECIMAL(38,9) while most other drivers let you go to 18 on scale, and ClickHouse supports precision/scale of up to 76. Redshift complains loudly if you try to insert a DECIMAL(38,17) into a DECIMAL(38,18) column, for instance.
Hope the added color is helpful!
edit: formatting
Are they scared of pointing fingers or what?
The worst part is that it doesn't have to be name and shame. Take the "epoch" discussion, for example. The fact that "epochs" differ in implementation is something that isn't even a bug--it's just different. That alone is likely surprising to a lot of people and would probably be worth an article.
Of course, the real issue is probably that "boring" databases just work and "exciting" databases are full of bugs. If you're a database SAAS startup, slagging the databases that everybody considers cool and hip isn't going to be good for your exit.
My takeaway is that compact schema streaming data is not a well developed field. I think we can do better. Not only that, but developing both such a schema, protocol, and associated tooling is key to significantly better data-centric applications from end to end, not just the database.
Definitely a lot of room for improvement. Curious if anyone has thoughts about the best route to getting such a standard / protocol in place: it seems like a lot of stars would have to align, but would be invaluable nonetheless.
However it's early days yet.
- Much slower to cancel queries
- Still reading and buffering most of the result after canceling.
- Weird escaping issues
Glad to be done with that.
And they they still have no concept for native dev tooling for most of their services. Its always "just setup separate environments for testing, CI, development, staging, release" and pay them more money.
I hate AWS, so much.
I am not shocked their DB drivers have issues.
One recent problem I have been dealing with, which I can't detail because they'll know who I am and I am under NDA, involved a major release last year. I found two critical bugs in the stack which they had extended from an open standard. As we're a massive company with a big spend I managed to get the team leads and enterprise support on a call and I found the whole fucking thing was clearly looked after by two guys who didn't know what they hell they were doing, had never spent any time on the stack that they were extending and had never even considered a real world use case.
I have considered looking into Azure but I'm not sure that'll be any better.
- AWS is the worst of all the clouds, not just (typically) in pricing, but definitely it has the worst DX, confusion of options, and documentation out of the big 3. They're flexible I guess, and have tons of services but no easy and tight way to integrate them, and they're very configuration heavy. Just didn't care for how they presented their happy paths (WTF is up with VTL?!). I think Lambda's are overrated and idk why they have cold starts in 2022 when all their competitors don't anymore.
- Azure has some good stuff, including local emulators you can download for some services, and they have mock packages for programmatically emulation some of their services. Their biggest downfall for me was the confusion amount of options they have and sometimes their pricing is opaque what the final cost on a service will be. Both combined made it harder to use than I would have liked but it was a step up (to me) from AWS. A note of caution though, is that Azure doesn't have the per se greatest support for things not in their "stack". .NET of course works well, Node, Python, and more recently Go have seen good support (particularly Node) but it has less flexible ways to do more customized deployments in my experience. Doesn't mean you can't, but you pay alot more for the privilege. They also are more aggressive in the upsell department as well. Azure is particularly great if you're migrating older Windows Server apps and/or heavily using things like ActiveDirectory. If you're willing to pay they do have good support. I recall Azure having a pretty decent cloud SDK and they supported all the cross-cloud ones decently (Terraform, CF etc) as well. One thing I like about Azure is they have the least confusing CLIs IME
- GCP is has pretty good DX. I think they're more expensive in alot of ways, if you aren't careful, but their "main" services are pretty cost competitive. In particular, I feel like AppRunner is the underrated alternative to things like AWS Lambda or other FaaS offerings. GCP also has a good amount of emulators and Firebase is still pretty great. GCP is very happy path oriented (more so than the other cloud providers) in my experience, but generally they seem to have picked good "happy paths", again IME. BigQuery is more byzantine in cost than I'd like, same with Spanner. Their support is pretty bad IME unless you pay for big contracts, though. Even then it wasn't the best, but at least we could get a human on the phone. Also, I wouldn't trust their one click apps, there is hardly any control GCP exerts over them to ensure quality, so unless you know the vendor is specifically supporting them for your use case, avoid them. I did find their permissions model to be as confusing as AWS. Didn't like their cloud SDK as much but it was better than AWS.
What would I do if I was able to start over again in 2022 though? I'd deploy to something like Supabase and/or Cloudflare if I wanted pretty much 100% managed services. Otherwise if I just want compute and add in my own services I'd do a combo of Fly.io with Planetscale (or a similiar DB provider) and using Cloudflare services (such as R2 and workers) for files / caching or a combo of B2 + Upstash. You could proxy / load balance your HTTP / TCP traffic via Cloudflare as well (idk that fly.io autoproxies provisioned instances for load balancing. I'm pretty sure it doesn't)
On lambda, the issue I mentioned was actually because one of their services was built on top of that and maintained state between lambda runs whereas the open source product they ripped off did not. That meant their entire product was stateful when it should have been stateless. It compromised everything.
I couldn't possibly use Google after a GApps fiasco I had a couple of years back. No way.
Thanks for the rest of the info. I shall carefully decipher it.
For the next platform migration we do it might be back to a dedicated DC which is where we came from. We have stable constrained, predictable load. The TCO was cheaper, the staff were fewer, the performance was better and the licensing of some commercial products we leverage was much easier to handle and cheaper.
I've started writing most new code async and switched to asyncpg, but it's good to know there's also an alternative for sync code!
https://arrow.apache.org/blog/2019/10/13/introducing-arrow-f...
[1]: https://arrow.apache.org/docs/format/ADBC.html [2]: https://arrow.apache.org/docs/format/FlightSql.html
This [1] appears to be the SQL layer on top of Arrow Flight specifically about SQL. It seems a bit chatty, where two network requests are required for each query if I read it correctly.
That said there is a proposal for base Flight RPC to help allow embedding small results directly into the first response, that mostly needs someone to draft a prototype and push it through. (That doesn't help the case of a large-ish response from a single backend, though; that may also need some work, if we want to get rid of the second request.)
For instance, when setting a user's password in Postgres, you can do the hashing on the client side, even for non-trivial schemes like SCRAM. This means that the password itself never needs to move over the network, and that's very desirable. Speaking of authentication methods, that also opens up a big topic.
There are also important modes. For instance, the client encoding controls how strings are transcoded when they get to the server. That allows the client to not know/care what the encoding of the database is. You could demand that everything is UTF-8, and that's one philosophy, but not everyone agrees.
In practice, I think it'll be a while before there is consensus on all these points. And even when there is, the standard will need to evolve to handle new auth methods, etc.
If we invent a standard protocol, it will probably be more of a fallback for simple cases when the language framework doesn't offer a driver yet. Still helpful, though.
Off-topic, but I’m surprised more online apps don’t employ something similar.
It would all but eliminate accidental leaks that occur from logs being incorrectly stored / misconfigured, not to mention worries about MITM attacks (useful for corporate networks, or public networks).
Given how many people share usernames, emails, and passwords across sites I find it quite important to mitigate those issues as much as possible.
Also surprised by libraries not using more efficient protocols although they were defined.
Compression also doesn’t seem to be a thing.
I think its in the works but it makes me laugh that the big data folks never really cared about a number bigger than 2.4b or so.
https://www.reddit.com/r/Database/comments/p21u5d/standard_q...
What is the advantage of your hypothetical binary format (which doesn't exist), (in addition to those formats listed), over the binary formats which have existed for decades?
In addition it likely initially a) will be buggy and b) won’t support every feature of every vendor.
I think that’s a hard to win battle.
So if you use HTTP, you need a lot of boilerplate on the client side to manage that state (eg. prepared queries, transactions, session parameters).
https://arrow.apache.org/blog/2019/10/13/introducing-arrow-f...
This is a reminder to consider our use cases and vet our dependencies for those use cases carefully.
Telling as well that DuckDB fixed your issue in a couple of days.. had snowflake support even demonstrated technical understanding of your request in that time? I guess it doesn't really matter if it takes them six months or more to fix the connector bugs anyway.