Skip to content

Instantly share code, notes, and snippets.

@PavelDemyanenko
Created June 10, 2018 14:18
Show Gist options
  • Save PavelDemyanenko/a66539d1edd59d6bddd6a6a4cf668fce to your computer and use it in GitHub Desktop.
Save PavelDemyanenko/a66539d1edd59d6bddd6a6a4cf668fce to your computer and use it in GitHub Desktop.
CRDT:
https://github.com/bind-disney/spbrubyconf-2108-crdt-example
react data stores (sets are stored in vesrions vector) (vesrions vector, changes vector)
so the max index of value wins in the case of this structures
merge fucntion is applyied when the replication starts
merge function has access to the index and merge state (vectors)
real world apps: systems which use riak, akka systems (have crdt under the hood)
from version 4.0 of redis it uses crdt
RUBOCOP:
a brief history: jonas054 issue on emacs support
ripper is on github
state of unity release 0.8
- new features(formatters, conf options, better performance)
- checkout cache functionality code
- pattern matching
curernt status of rubocop:
- metrics: 100
- style: disabled
- limit cops
- different configs for different directories
- inherit configuration files
- ruboop layout feature
GRANITE
toptal dev over rails
emacs check it out
Rubocop future:
v1.0
- remove rails
- api for extensions
- moving to rubocop HQ (all is there)
- mry for rubocop
- new site of docs
emacsredux.com
EVENTS, EVENTS, EVENTS:
Event sourcing, DDD, CQRS
When some work on events need to before, after states
Event sourcing:
- events
- event storming (DDD)
- event strore (kafka, redis)
- immutable events
e.g new database with current state
pros:
- easier to communicate with domain experts
- time traveling
- restore a system
- logging out of the box
- work with events
- experemental data structures
- persistance
- easier to add instance for service
- any language
cons:
- hard to understand and complicated abstraction
- not popular in ruby and bad tooling
- developers need deprogramming
- hard to get state
- hard to understand chain
- another arch types of DB style
- async world
- versions compatibility
- evenual consistency
- updatding and deleting events
rails event store gem
sequent gem on github.com
karafka - kafka impl on ruby, it works only with kafka
hanami gem for microservices
ideas of event sourcing:
1) sync way of microservices
0ne service know about another
2) events
a lot of inforamation for event
Last part: CQRS (the most interesting part)
databases for reading and for writing
DDD:
Eriv Evans, pragprog DD modeling , Martin on Oreily
Q: cleaning cache>loose time travel
A: recalculate all the staff
Q: about message bus and events on microservices
A: comparing with message bus, cache database is not need cause u can recalculate staff
Q: message bus is a transitional arcitecture?
A: yes, and event sourcing is like a git
event-sourcing is like message bus and uses a store concept and the evalutioning the message bus
Q: Database full of events and if it is large?
A: Store last month e.g, or combine events with information
Q: e.g remove user information due to GDPR
A: user gets notification, so the data removed in combined events
TESTING WITH PETRI NETS
Approach for testins
Build a solution in Toptal on top of this approach (not oss)
1. unsufficiency of usual test
AAA (setup, execute, verify)
common mistakes over constraits in DB (delete user which has some relations :note e.g)
State combinations:
1. Write more tests?
2. Randomize test data?
3. not cool …
Mode-bases testins
1.Create mode of the system
Graphwlker (Spotify, Java and Python)
model -> test selections -> test execotions ->
Problem: finite-state machine (quite big models and complex in cocncurrency)
A big picture on that, and a waste of time
2 …
Petri nets
places store tokens -(arcs)> transitions ->
tokens for things in Petri nets
Based on tokens you can model complex things
Heisenbug 2018
RHIZOME
1. Reproducible tests using seed
2. Parallelize like ny other test framework
3. General purpose framework
rspec/ rhizome (1000 loc/100loc)
Time to write tests decreasing
where also it is used: a lot of facilities
discover about Reset arc, Inhibitor arc
merging subnets gives mutable tokens (token can be colored)
can put algorithms layes on perti nets
TRAILBLAZER WAY
Life of a rails developer
BPMN diagrams
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment