google-cloud

Google Cloud Platform: Clojure + {GAE, GCE, anything else on Google Platform}
qqq 2017-02-03T01:14:37.000856Z

genuine question: why do I want to use GAE instead of (1) firing up Digital Ocean servers, which offer 1TB traffic for $5.00 / month (2) having my DO servers make remote API calls to google datastore / storage / etc ... ?

qqq 2017-02-03T01:14:47.000857Z

This also gets around JVM limitations and lets me use websockets.

peterschwarz 2017-02-03T15:12:48.000858Z

If your usecase requires websockets, than you probably would want to be using your own VM

peterschwarz 2017-02-03T15:13:11.000859Z

That being said, using a compute engine instance will have very low latency with the rest of the GAE API's

nickbauman 2017-02-03T15:13:30.000860Z

Agree with Peter. Your calls to datastore will be long and unreliable with DO

nickbauman 2017-02-03T15:14:38.000861Z

We went around and around with websockets at work and we’re on AWS. We ended up using Google Realtime anyway. Websockets do not play well with the rest of our stack.

nickbauman 2017-02-03T15:15:02.000862Z

Turned out to be very finicky too

nickbauman 2017-02-03T15:16:01.000863Z

Google Realtime takes the problem one step further. Operational Transform is the algorithm you’re going to be hovering around with shared state. You’ll have to roll that yourself if you don’t use Google Realtime.

peterschwarz 2017-02-03T15:16:13.000864Z

I haven't been keeping up with Google's cloud offerings as much of late: thanks for the Google Realtime pointer 🙂

nickbauman 2017-02-03T15:16:59.000865Z

Yeah we use it. It’s amazing. Basically came out of Google Wave. It’s where you can have many people interacting with one resource in realtime.

nickbauman 2017-02-03T15:17:19.000866Z

Many-to-many too

peterschwarz 2017-02-03T15:17:42.000867Z

How well does it deal with offline/catch-up cases?

nickbauman 2017-02-03T15:38:50.000868Z

That is a use case where we don’t use realtime directly, peter.

nickbauman 2017-02-03T15:39:08.000869Z

Well, now that you mention it, we do use it.

nickbauman 2017-02-03T15:42:23.000870Z

I know a little bit about your use-case, Peter. You have a lot of offline needs. In our situation it’s a news editor’s SPA. He or she is looking at a bunch of stories and they update in realtime across multiple screens. They can edit a story and other members of the news team will see the updates in realtime as well. It does not have offline support. I’m a little surprised our reporters haven’t asked for that yet, seems important.

nickbauman 2017-02-03T15:45:29.000872Z

So I can tell you it works great but no offline support.

nickbauman 2017-02-03T15:47:05.000873Z

However, I would suggest that it would work fine with offline support except when two people are updating the same record. They you’ll need something like a 3-way merge tool in your app or something.

nickbauman 2017-02-03T15:48:39.000874Z

In our case we lock a story while a reporter, writer or editor is focused in the story (we consider them typing even if they’re only focused: made people less mad at each other, lol). It becomes read-only for everyone else.

nickbauman 2017-02-03T15:49:12.000875Z

In your case where people are working offline, this doesn’t fly.

nickbauman 2017-02-03T15:50:14.000876Z

Is that helpful?

peterschwarz 2017-02-03T18:12:34.000877Z

Makes sense

peterschwarz 2017-02-03T18:13:17.000878Z

The ideas can still work offline (i.e. Operational Transforms), but looks like the google api isn't really built around that use case.

qqq 2017-02-03T18:43:18.000879Z

@nickbauman : are OTs and state-based CRDTs the same thing, or two different approaches ?

nickbauman 2017-02-03T18:44:52.000880Z

OT?

nickbauman 2017-02-03T18:45:09.000881Z

Can you expand that acronym?

qqq 2017-02-03T18:45:42.000882Z

operational transform

nickbauman 2017-02-03T18:45:42.000883Z

Oh Operational Transform, I see, sorry I’m lame

qqq 2017-02-03T18:45:49.000884Z

I thought that' what google realtime used

nickbauman 2017-02-03T18:46:31.000885Z

Operational Transform is an algorithm. I’m not sure if calls to GRT comprise Conflict-free replicated data types though

nickbauman 2017-02-03T18:47:08.000888Z

(sorry about the edit)

nickbauman 2017-02-03T18:47:47.000889Z

I suspect they’re different, though.

nickbauman 2017-02-03T18:47:51.000890Z

Fundamentally.

qqq 2017-02-03T18:48:11.000891Z

okay, so google real time and phoenix presence (which I beliece usses state based crdts) are likely different things

qqq 2017-02-03T18:48:20.000892Z

this is an area I wish I knew more about

nickbauman 2017-02-03T18:48:44.000893Z

CRDTs are a much lower-level concept than OT. With OT you bind your system to a single resource.

qqq 2017-02-03T18:49:05.000894Z

with CRDTs, we're looking for ops that are indempotent, assocaitives, and transisitive

nickbauman 2017-02-03T18:49:09.000895Z

But underneath that resource may be a highly-available cluster of systems.

qqq 2017-02-03T18:49:11.000896Z

I don't see how can I get around that issue

nickbauman 2017-02-03T18:49:49.000897Z

Google Realtime relies on Google Drive, which is highly available.

qqq 2017-02-03T18:50:47.000898Z

yeah, but google can't solve network latency between client nd goog servers, or random disconnects

nickbauman 2017-02-03T18:50:55.000899Z

Maybe underneath you have something akin to a CRDT, but the drive API that Realtime uses doesn’t know about that.

qqq 2017-02-03T18:51:10.000900Z

is ther a recommended whit epaper on google real time OT ?

qqq 2017-02-03T18:51:16.000901Z

I feel like I'm misunderstanding the fundamentals.

nickbauman 2017-02-03T18:51:30.000902Z

I think you’ll find it in Google Wave whitepapers.

nickbauman 2017-02-03T18:51:44.000903Z

Realtime is the core thing in Wave.

nickbauman 2017-02-03T18:54:01.000904Z

Core concept of OT is super simple

nickbauman 2017-02-03T18:54:35.000907Z

You can read that code in a few minutes and understand it on an abstract level.

nickbauman 2017-02-03T18:55:16.000908Z

Then this is a specific implementation in text

nickbauman 2017-02-03T18:55:48.000911Z

(Python is a decent language to communicate this stuff, too)