All Projects → josephg → Sephsplace

josephg / Sephsplace

Licence: other
My own version of r/place, done in a weekend

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Sephsplace

Pos
Sample Application DDD, Reactive Microservices, CQRS Event Sourcing Powered by DERMAYON LIBRARY
Stars: ✭ 207 (+73.95%)
Mutual labels:  event-sourcing, kafka, cqrs
Event Sourcing Castanha
An Event Sourcing service template with DDD, TDD and SOLID. It has High Cohesion and Loose Coupling, it's a good start for your next Microservice application.
Stars: ✭ 68 (-42.86%)
Mutual labels:  event-sourcing, kafka, cqrs
Event Sourcing Jambo
An Hexagonal Architecture with DDD + Aggregates + Event Sourcing using .NET Core, Kafka e MongoDB (Blog Engine)
Stars: ✭ 159 (+33.61%)
Mutual labels:  event-sourcing, kafka, cqrs
Digital Restaurant
DDD. Event sourcing. CQRS. REST. Modular. Microservices. Kotlin. Spring. Axon platform. Apache Kafka. RabbitMQ
Stars: ✭ 222 (+86.55%)
Mutual labels:  event-sourcing, kafka, cqrs
Dotnet New Caju
Learn Clean Architecture with .NET Core 3.0 🔥
Stars: ✭ 228 (+91.6%)
Mutual labels:  event-sourcing, kafka, cqrs
Benthos
Fancy stream processing made operationally mundane
Stars: ✭ 3,705 (+3013.45%)
Mutual labels:  event-sourcing, kafka, cqrs
Watermill
Building event-driven applications the easy way in Go.
Stars: ✭ 3,504 (+2844.54%)
Mutual labels:  event-sourcing, kafka, cqrs
Cqrs Manager For Distributed Reactive Services
Experimental CQRS and Event Sourcing service
Stars: ✭ 289 (+142.86%)
Mutual labels:  event-sourcing, kafka, cqrs
Dotnet Cqrs Intro
Examples of implementation CQRS with Event Sourcing - evolutionary approach
Stars: ✭ 113 (-5.04%)
Mutual labels:  event-sourcing, cqrs
Hacker News Resolve
React & Redux & Resolve implementation of Hacker News
Stars: ✭ 79 (-33.61%)
Mutual labels:  event-sourcing, cqrs
Bifrost
This is the stable release of Dolittle till its out of alpha->beta stages
Stars: ✭ 111 (-6.72%)
Mutual labels:  event-sourcing, cqrs
Fblazorshop
This is a port of Steve Sanderson's Pizza Workshop for Blazor by using F# and Bolero.
Stars: ✭ 58 (-51.26%)
Mutual labels:  event-sourcing, cqrs
Commanded
Use Commanded to build Elixir CQRS/ES applications
Stars: ✭ 1,280 (+975.63%)
Mutual labels:  event-sourcing, cqrs
User Bundle
A new Symfony user bundle
Stars: ✭ 116 (-2.52%)
Mutual labels:  event-sourcing, cqrs
Asombroso Ddd
Una lista cuidadosamente curada de recursos sobre Domain Driven Design, Eventos, Event Sourcing, Command Query Responsibility Segregation (CQRS).
Stars: ✭ 41 (-65.55%)
Mutual labels:  event-sourcing, cqrs
Cafeapp
A Real World Business Application using F# and Suave
Stars: ✭ 86 (-27.73%)
Mutual labels:  event-sourcing, cqrs
Go Cqrs All
All-in-one collection for Go CQRS / ES / DDD examples
Stars: ✭ 39 (-67.23%)
Mutual labels:  event-sourcing, cqrs
Nestjs Cqrs Starter
NestJS CQRS Microservices Starter Project
Stars: ✭ 80 (-32.77%)
Mutual labels:  event-sourcing, cqrs
Aspnetcore Ddd
Full ASP.NET Core 3.1 LTS application with DDD, CQRS and Event Sourcing
Stars: ✭ 88 (-26.05%)
Mutual labels:  event-sourcing, cqrs
Event Store Symfony Bundle
Event Store Symfony Bundle
Stars: ✭ 93 (-21.85%)
Mutual labels:  event-sourcing, cqrs

Reddit r/place in a weekend throwdown!

Soooo, I said I could implement r/place (minus mobile support) in a weekend. Someone called me on it, so I did it.

Go check it out

Postmortem writeup Original HN thread

Design

This was written when I started the project. You're better off taking a look at the postmortem blog post for details about how it works.

The actual image edits will all be sent to Kafka. Each server (well, kafka client) will host a snapshot of the place image which it will serve.

Now, the entire image will actually be kind of big and slow to png-encode. We can't re-encode it all the time. So instead I'm going to only regenerate the image every 100 edits or something and aggressively cache it in nginx.

That means the client will see an old version of the image. To get around that (and to allow people to see pixels change in realtime) I'm going to add a server-sent events endpoint which will allow the client to subscribe from a given image version.

So:

Reads:

  • Client gets image, which may be a bit old. Image fetch hits nginx, which will respond with a cached copy 99% of the time. Response header contains image version (eg, 1000). If the image is not in cache it is generated in the node server.
  • Client hits /edits?v=1000 or something. They get back a stream of edits from the specified version. The client applies those edits locally to the image they downloaded.

Writes:

  • Client sends a POST request with the desired edit (x, y, value) to /edit. Server sends message to kafka.
  • Client sees their own write once they get back a message from the eventstream. If I have time I'll make their edit speculatively visible in the client before they see it in the server data.

Using this architecture I can spin up as many servers as I want to handle the load. Writes are all sent through kafka, which can handle millions of edits per second.

When the server starts it needs to load the current data. Instead of replaying the entire kafka event log, the client will store a local snapshot in lmdb containing a recent copy of the image data.

There's a fair few moving parts that all need to be kept in sync: kafka, server, client, lmdb. But all the data flows one way (client -> server -> kafka -> client) and ({lmdb, kafka} -> server -> {lmdb, kafka}). So it should be mostly straightforward. I hope.


License

ISC License

Copyright (c) 2017 Joseph Gentle

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].