google-cloud

Google Cloud Platform: Clojure + {GAE, GCE, anything else on Google Platform}
2017-01-15T00:26:01.000223Z

regarding "defentity" and similar: too gae-specific, imho. ideally we want a nosql api that is not tied to gae. we can do that with closure's meta-programming facilities (or so I jmagine). since a gae "entity" is nothing more than a map, and a gae key is just a vector of namespaced syms, we can in principle come up with closure abstractions that will work for many nosqls.

2017-01-15T00:31:15.000224Z

so e.g. in migae/datastore I treat entities as entity-maps, not essentially different from any other implementation of the map interface, except for the save and retrieve operations. otherwise than that, no different than hash-map.

2017-01-15T00:32:19.000225Z

so the pgmr need not be exposed to gae hidiosity.

nickbauman 2017-01-15T01:56:55.000226Z

I guess I’m not terribly interested in making a query DSL that works with any NoSQL database. I just wanted something better than the JavaAPI for Datastore.

nickbauman 2017-01-15T01:58:22.000227Z

Having said that, one of the things I hate about the Cassandra NoSQL database is that it has a SQL interface that doesn’t behave like any SQL database in earth behaves. It was a huge piece of misdirection to anyone coming to Cassandra.

nickbauman 2017-01-15T01:58:46.000228Z

This is one of the reasons why nobody I know ever uses GQL with Datastore.

nickbauman 2017-01-15T01:59:12.000229Z

The Python NDB library is much better than using GQL, for example.

nickbauman 2017-01-15T02:00:02.000230Z

I would much prefer a Clojure DSL that works with Datastore and Cassandra, if that’s part of the puzzle, mobileink!

nickbauman 2017-01-15T02:00:40.000231Z

So I support you in this effort!

qqq 2017-01-15T02:30:47.000232Z

I also support datastore specific over generic libraries for hte following two reasons: (1) iirc, datastore transactions/entities have different semantcis from simpledb / dynamodb (2) I want to be able ot read a datastore query and estimate how many read ops it takes (and how much goog is charging me) <-- a 'generic sql' layer would make this very hard

nickbauman 2017-01-15T03:55:21.000233Z

@qqq in case it wasn’t clear I wasn’t advocating for a SQL layer, either. I might not have made that clear.

qqq 2017-01-15T04:08:54.000234Z

@nickbaum: I think the only disagreement we have is "only datastore" vs "datastore + cassandra" -- I've never used Casandra; can you explain how it relates to datastore?

nickbauman 2017-01-15T04:09:29.000235Z

Cassandra is a FOSS NoSQL database written from the same whitepaper as Datastore.

nickbauman 2017-01-15T04:10:12.000236Z

It has only a SQL interface. But the underlying implementation makes your knowledge of SQL in any other database all but useless.

qqq 2017-01-15T04:11:21.000237Z

@nickbaum: interesting! what is this paper? I have always wanter to understand the theor behind datastore but never found it

nickbauman 2017-01-15T04:12:56.000238Z

I think it might be the Dynamo paper, I forget.

nickbauman 2017-01-15T04:14:10.000239Z

It hits all the checkboxes that Datastore does. Every feature is more or less there. It has been known to work at a cross-continental level, too.

nickbauman 2017-01-15T04:14:35.000240Z

But I’ve used it. It’s no where near as well designed as Datastore.

nickbauman 2017-01-15T04:29:32.000241Z

OK so there’s the BigTable whitepaper. https://static.googleusercontent.com/media/research.google.com/en//archive/bigtable-osdi06.pdf But Datastore is a combination of two technologies: BigTable + Megastore.

nickbauman 2017-01-15T04:29:51.000242Z

BigTable is the actual storage. Megastore is the indexes.

nickbauman 2017-01-15T04:30:16.000243Z

Megastore is eventual consistent. BigTable is strongly consistent.

nickbauman 2017-01-15T04:31:02.000244Z

(IOW, writing the indexes happen asynchronously to writes to BigTable)

qqq 2017-01-15T09:12:47.000245Z

@nickbauman : gae doc examples has code that auto generates login/logout urls; does your library have calls for that? ( I couldn't find any)

nickbauman 2017-01-15T16:05:07.000246Z

Nope! I'll write an issue in the template if you don't.

nickbauman 2017-01-15T16:09:00.000247Z

BTW I looked into the effort it would take to support save and delete hooks, @qqq ... Not going to be very easy because those features rely on annotations in subclasses of entity 😜

nickbauman 2017-01-15T16:10:19.000248Z

So the Clojure code will have to genclass for each save or delete hook you want.

nickbauman 2017-01-15T16:11:26.000249Z

Blech!

nickbauman 2017-01-15T16:55:59.000253Z

I imagine the syntax looking like:

(with-pre-put #((.setProperty (.getCurrentElement %) (name field) (Date.)) 
    (save! (…)))

nickbauman 2017-01-15T16:57:32.000254Z

Maybe we also need a (with-pre-puts … that takes a vector of pre-put functions?

nickbauman 2017-01-15T16:58:45.000256Z

Anyway, I have it here: https://github.com/nickbauman/cljgae-template/issues/15

nickbauman 2017-01-15T17:01:35.000258Z

@qqq I added login / logout to my issue list. https://github.com/nickbauman/cljgae-template/issues/16