News for hackers. Stuff that matters.
Re:SQLite Is Serverless by mettamage on Sunday January 26, 2020 @11:04AM (#22152692)
Does this mean that you can hack some database storage (w/ sqlite) together on frontend only hosting platforms like Github or Netlify?

I think not, but I wonder if some hack is available by virtue of it simply being a file that you can read (and somehow) write to.

The best I came up with: let's say you have a toy project, and you call the Github API and replace the file upon every write. Implementing a read is easier as you know where the file is located. This hack shows that you somehow need write access to get any form of performance out of it, because this hack is super slow.

Re:SQLite Is Serverless by aikah on Sunday January 26, 2020 @11:25AM (#22152844)
> Does this mean that you can hack some database storage (w/ sqlite) together on frontend only hosting platforms like Github or Netlify?

You can run SQLlite in the client via webassembly therefore open a SQLite file in the browser to query it yes, you just can't write anything in it and expect it to persist somehow on the static hosting service itself.

> The best I came up with: let's say you have a toy project, and you call the Github API and replace the file upon every write. Implementing a read is easier as you know where the file is located. This hack shows that you somehow need write access to get any form of performance out of it, because this hack is super slow.

No you'll need a server for that, you can't make random HTTP requests to any server in the browser, because of CORS/SAME ORIGIN policies.

"SQLite is serverless" is meaningless buzzword. It just means that SQLite is equivalent a flat file where you'd shove some data, just that you can use SQL to query that file instead of having to index data in it yourself.

Re:SQLite Is Serverless by filleduchaos on Sunday January 26, 2020 @12:29PM (#22153325)
"SQLite is serverless" is by no means a meaningless buzzword. The term had a clear meaning before it was coopted by the current web dev fad. SQLite does not operate on a client-server architecture the way e.g. MySQL or PostgreSQL do.
Re:SQLite Is Serverless by mrmekon on Sunday January 26, 2020 @12:41PM (#22153402)
Just to back that up, it had a clear meaning because -less is a valid suffix to append to English words. When grandma runs out of cookies she is cookieless (when a website doesn't use cookies it is also cookieless). It doesn't have to be "in the dictionary" to make sense in conversation.

A quick search of usenet shows "serverless" being used in 1994. It wasn't a term or a buzzword, it wasn't common, it was just English: https://groups.google.com/d/msg/comp.os.linux.misc/r76oNl98C...

Re:SQLite Is Serverless by filleduchaos on Sunday January 26, 2020 @02:41PM (#22154224)
Yes, this is what I was trying to say. It wasn't a thing people would throw around like a buzzword but if someone used it in conversation and especially in context (like the SQLite page, which was written over a decade ago, does) people would understand what you meant.
Re:SQLite Is Serverless by qes on Sunday January 26, 2020 @02:31PM (#22154146)
> does not operate on a client-server architecture

That was never a common usage of the term serverless.

Re:SQLite Is Serverless by filleduchaos on Sunday January 26, 2020 @02:35PM (#22154186)
The linked article was written in 2007, for your information.

Software development didn't begin or end with web dev and the cloud.

Re:SQLite Is Serverless by giancarlostoro on Sunday January 26, 2020 @11:36AM (#22152929)
You could make it persist if you have it uploaded somewhere. But then I guess thats not serverless.
Re:SQLite Is Serverless by Frost1x on Sunday January 26, 2020 @11:44AM (#22153001)
"Serverless" is a garbage marketing term in general. It sounds sexy to nontechnical management folks who are used to hearing a bunch of expensive costs and the word "server" associated with them in some fashion. From that view, anything that gets rid of those pesky "servers" sounds like a win.
Re:SQLite Is Serverless by giancarlostoro on Sunday January 26, 2020 @11:53AM (#22153077)
It is, I did Azure Functions which is their "serverless" solution. It's either a type of CGI 'trigger' which is not as impressive however, another 'function' can be triggered based on Database actions or file uploads in their Blob Storage. So it's just handy if you're all in on Azure, and probably other clouds because you can have code run immediately when events happen for certain services. Outside of that, I find it wasteful.

The other buzzword is microservices. I was working a gig that involved running like 10 on a MBP with 16GB of RAM and it froze up the laptop. Java is not a language for micro anything, at least not in regards to memory. Was fun but dreadful to work with more than 3 local services at once. The creators of the framework suggested to mock services, but it was just messy to do that too.

Re:SQLite Is Serverless by pm90 on Sunday January 26, 2020 @12:23PM (#22153269)
> The other buzzword is microservices. I was working a gig that involved running like 10 on a MBP with 16GB of RAM and it froze up the laptop. Java is not a language for micro anything, at least not in regards to memory. Was fun but dreadful to work with more than 3 local services at once. The creators of the framework suggested to mock services, but it was just messy to do that too.

This seems like a strange criticism. It appears that you want a full deployment of the platform on your local machine. But Microservices aren’t optimized to run on your local machine; they’re meant to be deployed to kubernetes/docker swarm/mesosphere.

I’m also no fan of Java but I don’t think it’s the language that is preventing you here? All speculation since I don’t know the details but it sounds suspiciously like the JVM is getting stuck trying to allocate heap during startup (this is just a guess).

Re:SQLite Is Serverless by tracker1 on Sunday January 26, 2020 @03:17PM (#22154452)
And when you need to interact with other services in a disconnected way? You have to run them somewhere... and local should generally be an option, even if that's to a local single-node (mini)kube cluster.

There's nothing wrong with needing to run more than one thing while developing/testing and interacting. There are other options, but it's not a clearly bad approach.

That said, I would definitely lean towards Go or Rust myself if given the option (even though I have limited exposure to either) over Java. C#/.Net Core is in the middle imho. Even node works pretty well, but the tons of files thing bugs me sometimes. We're leveraging more node and C# where I work and I definitely prefer node... but for more services I do think that Go and Rust are probably better options.

Re:SQLite Is Serverless by pm90 on Sunday January 26, 2020 @04:54PM (#22155046)
In general, staging environments are the solution to cross service testing for Microservices. The expectation that a Microservice must be testable end to end locally is not one I would like to encourage. The whole point of splitting out a service this way is that individual services have very narrowly scoped, independent function and can be tested on their own, perhaps with mocked data.

One wouldn’t expect to run all of a companys entire pipeline locally on a single laptop. Expecting that for Microservices is similar.

Re:SQLite Is Serverless by wwright on Sunday January 26, 2020 @12:32PM (#22153343)
Java has been used on servers since 256MB was common to use — Java is not a limiting factor in how lightweight you can get on modern Intel hardware, though it might need some tuning.
Re:SQLite Is Serverless by giancarlostoro on Sunday January 26, 2020 @05:22PM (#22155213)
The bloat was in the framework used, not as much on Java itself.
Re:SQLite Is Serverless by pm90 on Sunday January 26, 2020 @12:15PM (#22153206)
Not true. While the term is hyped, it is done so for good reasons. It’s not just that management doesn’t want the pesky servers, it’s that most developers themselves don’t want or care for it. Devs want to use platforms that let them quickly deploy their code that implements business logic, and servers/kubernetes and other abstractions aren’t things many devs give a fuck about.
Re:SQLite Is Serverless by jtms on Sunday January 26, 2020 @12:01PM (#22153120)
This is overly reductive. “Serverless” might be overhyped, but amongst devs and ops it is a perfectly good way to succinctly describe a very specific architecture with real merit. Paying for exactly the compute time i use is pretty sexy to me when I want to deploy and scale a side project.
Re:SQLite Is Serverless by tracker1 on Sunday January 26, 2020 @03:19PM (#22154466)
I would say (X)aaS (whatever as a service) is probably a better term... like DBaaS in this case, vs Serverless as in in-process, which is probably a closer and better use of the term.
Re:SQLite Is Serverless by Frost1x on Sunday January 26, 2020 @01:29PM (#22153714)
What was wrong with "managed"? It's pretty generic and transfers across many domains and also, more fairly descriptive of what's going on.
Re:SQLite Is Serverless by jtms on Sunday January 26, 2020 @01:42PM (#22153791)
"managed" is an AWS instance or a digital ocean droplet. "serverless" is an entirely different thing.
Re:SQLite Is Serverless by Frost1x on Sunday January 26, 2020 @01:50PM (#22153862)
"Serverless" is another level of abstraction and management, that's it. Are you proposing that a term collision adds too much confusion?

"Managed" hosting has been around for decades as have "managed" services, in general, long before Amazon even existed. EC2 brought a new level/layer of automation and management ontop of what colo datacenters used to do, provide scaling etc. To be clear I'm not saying it's simple but "managed" describes much of it.

Re:SQLite Is Serverless by jtms on Sunday January 26, 2020 @02:36PM (#22154198)
I would argue that the architectural implications of using a "run individual functions on a remote pool of computing resources and build your client application around this pattern and only pay for the exact amount of compute time you use" is not sufficiently covered by the term "managed". I think there could have perhaps been a better name than "serverless" chosen, but that's the name enough people have agreed on to use when talking about this specific architecture that it would be difficult to use another one.
Re:SQLite Is Serverless by giancarlostoro on Sunday January 26, 2020 @12:03PM (#22153133)
Agreed, I'm not big in devops, but I can see the usefulness of it if you're already part of a cloud provider, but like I said I only know of the capabilities of it in Azure, I'm not familiar with the capabilities elsewhere.
Re:SQLite Is Serverless by wyago on Sunday January 26, 2020 @12:20PM (#22153243)
This perspective has always confused me. Would you say that structured programming was a garbage marketing term, since even though the programming language didn't have goto the compiled machine code has jumps and branches? I would hope not, because the point is that an interface is provided on top of the underlying structure so that you don't have to think about gotos outside of exceptional cases.

Not having to think about what servers in which datacenter are serving a request is pretty convenient. We can argue about whether the pricing for most serverless computing is bad, but as far as the term and the technology itself I don't see how this is different from any other abstraction.

Re:SQLite Is Serverless by Frost1x on Sunday January 26, 2020 @01:15PM (#22153620)
The criticism is on the nomenclature, not what's being provided. "Structured programming" is... pretty well named IMHO. Serverless is a misnomer at best and borders on fraud/false advertising from the name alone.

The technologies are fine and there are potentially useful cases for it. It's no silver bullet though and is overhyped IMHO.

Re:SQLite Is Serverless by ComputerGuru on Sunday January 26, 2020 @12:01PM (#22153117)
I’ve done that, by persisting to an S3 backend.. but there’s no concurrent access and it is all one big race condition.
Re:SQLite Is Serverless by pcr910303 on Sunday January 26, 2020 @12:04PM (#22153137)
> Does this mean that you can hack some database storage (w/ sqlite) together on frontend only hosting platforms like Github or Netlify?

The meaning of that 'serverless' and this 'serverless' is incompatible, since the web inherently needs servers.

I think the best you can do is uploading the SQLite file to a static hosting platform & decoding it in the browser. You can then use it as a file storage with DB capabilities. (Which is what basically really SQLite is.)

Re:SQLite Is Serverless by siscia on Sunday January 26, 2020 @01:48PM (#22153844)
I will shamelessly plug myself again.

I am the main author of RediSQL [1] and I am about to launch a managed service for it.

It will allow to write SQL (SQLite dialect) against an HTTP or Redis protocol, to make thing clearer: https://simplesql.carrd.co/

Eventually it will upload your database to an S3 bucket for backup.

[1]: https://redisql.com/

Re:SQLite Is Serverless by erezsh on Sunday January 26, 2020 @02:48PM (#22154275)
Looks pretty cool!

I can imagine it would be useful for data-science projects, if the pricing is right.

Re:SQLite Is Serverless by siscia on Sunday January 26, 2020 @03:37PM (#22154617)
What pricing would feel right to you?
Re:SQLite Is Serverless by erezsh on Sunday January 26, 2020 @04:15PM (#22154849)
I'm far from an expert on such things, but I like the adjustable fixed-price model (like digital ocean).

Whenever I see a price like 0.0002$ per hour, I feel like they're trying to mess with my intuition.

That's especially applicable to data-science, because you're not worried so much about automatic scaling, you just don't want to be surprised at the end of the month.

I don't know if you can match digital ocean's prices (they offer managed postgres, for a fair comparison), but if you can get close then you have a chance.

Re:SQLite Is Serverless by siscia on Sunday January 26, 2020 @04:28PM (#22154915)
I was thinking something based on size or performance.

1 req for second, free.

50 req for second, 5€.

Unmetered, 30€.

Maybe not counting for seconds but for hour or day so to accommodate burst.

Another option would be on features. But that will requires time.

Re:SQLite Is Serverless by erezsh on Sunday January 26, 2020 @05:17PM (#22155189)
If you have full support for SQL, it means some queries can run for a few seconds, possibly even minutes (even sqlite supports some form of bfs). So will you just time-out those requests? That would make a lot of possible uses suddenly impossible.

I might consider the unmetered option, if the performance gain is worth the 6x cost of other providers.

For web and games, maybe your existing model could work, but then always having a recent backup also becomes more important (and for most sites, the lack of acid is a deal-breaker).

The nice thing about data-science is that you interact with the workspace yourself, so you know exactly when you want to save a snapshot.

Re:SQLite Is Serverless by siscia on Sunday January 26, 2020 @06:07PM (#22155494)
Hummm, what you mean by data science?

Like running analysis in a Jupiter notebook?

Indeed I am not sure this case is a good fit...

Re:SQLite Is Serverless by erezsh on Monday January 27, 2020 @04:42AM (#22158020)
Yes, that's what I meant. And possibly for ML preprocessing.

Just out of curiosity, who do you imagine your users will be?

Re:SQLite Is Serverless by siscia on Monday January 27, 2020 @08:24AM (#22158971)
The problem with data science is that usually you have relatively big datasets, you care more about throughput than latency and you work in secure an environment where you can definitely have access to the database credentials.

Streaming over the network the result of a big select is not ideal, moreover I believe that data scientist prefer to work with common technologies. I mean that there are already adapter for SQLite or PG or MySQL, while for RediSQL it won't be as straightforward.

I am thinking to developers for the JAM stack would be interested to this sort of API. Or people that want a database without having to think too much about it.

Re:SQLite Is Serverless by erezsh on Monday January 27, 2020 @10:37AM (#22160235)
Well, many choose to do their data-science over aws and similar, so I'm not sure there's a big different. I see you point about throughput and network load, but part of DS is data analysis, where the work is mostly exploratory: finding connections in existing data, and working heavily with aggregated data and previews, rather than just using it as a pipeline for other systems.

I think for most JAMs the network is a bigger hindrance than the query time. So, I hope you know what you're doing.

Anyway, cool project. I'll make sure to check back in a while and see where it went. I'm working on an "adapter" (so-to-speak) that queries SQL, so maybe I'll add yours too when the time is right.

Re:SQLite Is Serverless by siscia on Monday January 27, 2020 @11:47AM (#22161032)
The advantages of using an API like these on JAM it would be that very sophisticated application could be written completely client side. Which is quite interesting IMHO.

What is your project?

Re:SQLite Is Serverless by erezsh on Monday January 27, 2020 @05:23PM (#22164476)
My project is an interpreted query language that compiles to SQL (with support for several backends).

It is more capable than ORMs, and provides a layer of abstraction that SQL direly needs but lacks, as well as a shorter syntax, that is in-line with other popular languages.

Here is a very early version of it: https://github.com/erezsh/preql

I've kept working on it, but privately, and I'm trying to make it into a product.

I will probably release it as open-source when it's ready. I still need to figure out the right license, financial model, etc.