News for hackers. Stuff that matters.
Re:Anko SQLite, a library to simplify working with SQLite on... by hasenj on Thursday September 21, 2017 @10:41AM (#15303873)
I really don't understand why majority of websites use mysql or even postgres for that matter. The vast majority of websites would run perfectly fine on sqlite.

Not only would you get rid of network latency, you would also vastly reduce your dependencies.

I have a side project to try to see if I can build a minimal micro-blogging type server application on sqlite and try to test how many requests it can handle per second (reads and writes).

I have a hunch it will be able to handle quite a lot. Specially if the server code is written in a fast language that compiles to native code (e.g. D) with some caching of the most commonly requested items in memory.

Re:Anko SQLite, a library to simplify working with SQLite on... by pmelendez on Thursday September 21, 2017 @10:48AM (#15303950)
Concurrent writes is a problem since the locking is at database level[1]. For a small to medium-low website might be OK depending on the writes volume.

[1] https://www.sqlite.org/lockingv3.html

Re:Anko SQLite, a library to simplify working with SQLite on... by cl0wnshoes on Thursday September 21, 2017 @11:38AM (#15304523)
I'd be willing to bet that 99% of the sites/apps on the web have low to medium writes and reads. Developers like to plan on needing Facebook and Uber scale for their new task list and subscription box services though. SQLite benchmarks are impressive, they beat out commercial RDMS in a lot of comparisons.
Re:Anko SQLite, a library to simplify working with SQLite on... by masklinn on Thursday September 21, 2017 @11:06AM (#15304155)
As the header of your page denotes, things got significantly improved years ago with the addition of a WAL as the default mode rather than an exclusive write lock.
Re:Anko SQLite, a library to simplify working with SQLite on... by k__ on Thursday September 21, 2017 @01:39PM (#15305743)
Also, I think most websites don't even need constant access to the DB, because the data doesn't change often.

Compile a static site from SQLite when someone enters new data, push it somewhere to be accessible and be done with it.

Re:Anko SQLite, a library to simplify working with SQLite on... by icebraining on Thursday September 21, 2017 @11:26AM (#15304394)
Network latency is only really a problem if you host your db on another machine. An Unix socket has something like 1ns. As for dependencies, the package manager takes care of that.
Re:Anko SQLite, a library to simplify working with SQLite on... by kps on Thursday September 21, 2017 @12:15PM (#15304949)

  > An Unix socket has something like 1ns. 
That seems implausible, given that you're lucky to get a context switch down to 1µs if the cache gods smile on you.
Re:Anko SQLite, a library to simplify working with SQLite on... by icebraining on Thursday September 21, 2017 @12:26PM (#15305058)
Sorry, I meant 1 microsecond.
Re:Anko SQLite, a library to simplify working with SQLite on... by hasenj on Thursday September 21, 2017 @08:32PM (#15308466)
With the complicated aws-based deployment schemes people are using these days, what's the chance that the db is on the same machine?
Re:Anko SQLite, a library to simplify working with SQLite on... by akvadrako on Thursday September 21, 2017 @10:45AM (#15303926)
SQLite does not work smoothly in many languages (like python) in regards to concurrent access. Without a controlling process (or thread) it's synchronisation possibilities are limited, so it can never scale too far.

Nonetheless I think it's a great idea to build your own single-threaded layer over SQLite and scale that, using a message bus or whatever.

But it's _not_ a drop-in replacement for MySQL based apps.

Re:Anko SQLite, a library to simplify working with SQLite on... by hasenj on Thursday September 21, 2017 @08:30PM (#15308460)
Yea my hunch/hypothesis does not apply to slow languages like python. That's why I said a fast language that's compiled to native binaries. For example, D, Swift, or Go.
Re:Anko SQLite, a library to simplify working with SQLite on... by ageofwant on Thursday September 21, 2017 @11:01AM (#15304104)
SQLAlchemy with transactions on SQLite should get you very close, probably close enough.
Re:Anko SQLite, a library to simplify working with SQLite on... by infecto on Thursday September 21, 2017 @11:23AM (#15304352)
Why get very close when I can just spin up a single micro RDS instance of MySQL or Postgres and not have to worry about it?
Re:Anko SQLite, a library to simplify working with SQLite on... by marktangotango on Thursday September 21, 2017 @11:55AM (#15304726)
Whoa! That's nearly $20 a month, if you're past the free tier, which you will be if you're not already. Edit that's t1.micro, t2 is $13.
Re:Anko SQLite, a library to simplify working with SQLite on... by infecto on Thursday September 21, 2017 @12:52PM (#15305313)
Not sure how other people do it but 1 micro RDS serves many projects for me. Well worth the money for me.
Re:Anko SQLite, a library to simplify working with SQLite on... by aianus on Thursday September 21, 2017 @11:14AM (#15304244)
It's only a few lines of terraform to spin up a mysql or pg RDS instance. It can't get any easier, so why would I jump through extra hoops to use sqlite?
Re:Anko SQLite, a library to simplify working with SQLite on... by cl0wnshoes on Thursday September 21, 2017 @11:33AM (#15304468)
Its free to host compared to other RDMS which aren't cheap on most IaaS, and spinning up an instance is as easy as deploying it alongside your code.
Re:Anko SQLite, a library to simplify working with SQLite on... by hasenj on Thursday September 21, 2017 @08:29PM (#15308455)
terraform itself is a monster I want to avoid ..

I want no dependencies .. and no dependency manager.