11. WHERE IS OUR SOFTWARE?
• Brain is a giant neural network (85B neurons)
• Responsible for peristence and decision making
• There is theorem about equivalence between neural networks and Turing
machines
12. WHERE IS OUR SOFTWARE?
• Brain is a giant neural network (85B neurons)
• Responsible for peristence and decision making
• There is theorem about equivalence between neural networks and Turing
machines
• Does it mean all human beings are creatures with deterministic behavior?
13. WHERE IS OUR SOFTWARE?
• Penrose-Lucas argument as a basis of
non-computable behaviour in the brain
• Penrose says – Human mathematicians
are not describable as formal proof
systems and are therefore running a non-
computable algorithm.
• Wave Function collapse was a prime
candidate for a non-computable process.
14. WHERE IS OUR SOFTWARE CODE?
• DNA is a blueprints, including instructions
to create proteins
• DNA ia sequence of nucleotides
(biological bits)
• 4 major nucleotides A,G, C, T/U
• Codon is 3 sequential nucleotides and is
biological byte
• Max codon cardinality 64 unique values
15. WHERE IS OUR SOFTWARE CODE?
• DNA consists of genes
• A gene is a variable sequence of DNA that contains
instructions (program) like building protein
• Promoter is a magic hash-sum identifying specific protein’s
program
• Reserved Stop codon to determine the end of program
• Ordinary codon specifies particular amino-acid (able to
code 20 values)
• Sequence of codons defines order of amino-acids in the
protein.
16. STAGE 1 – EXTRACT PARTICULAR PROGRAM
RNA polymerase knows which protein need to build
RNA polymerase finds corresponding promoter and
starts melting DNA after it
RNA polymerase unravels one fiber which should
be protein program (I-RNA)
At the same time it “fixes” DNA behind
RNA polymerase finalizes the process once met Stop
codon.
17. STAGE 2 – RUN PROGAM AND BUILD PROTEIN
Ribosome is kind of Turing machine.
Fom left to right Ribosome finds Kozak
consensus sequence and the next Start Codon
Ribosome starts interpreting instructions one by
one and building protein.
Evey instruction (codon) defines amino-acid
delivered by related tRNA.
Once Ribosome finds Stop Codon it finalizes
protein.
Protein is ready to use.
18. ANALOGY
DNA -> File System
Gen -> Executable application file with bytecode
Transcription -> Reading application file from FS to RAM
Translation -> Executing application file
25. INVENTING MICROSERVICES – LESSONS
• Introduce functional bounded contexts
• Wrap bounded context into dedicated microservice
• Introduce strong internal organization -- use DDD.
• Emit events about changed state and decouple services.
26. BIOLOGICAL DATA PLATFORM
• Brain is a central place where historical
data lives and all data come to.
• Spinal cord is responsible for transmitting
nerve signals from motor cortex to the
body and from sensory neurons to
Sensory cortex
• Spinal cord is kind of API façade to
control body periphery and do infra stuff
like amplifying signals.
27. ANALYTICAL DATA PLATFORM
• Data Platform is that organ which
ingests input events and data,
organizes data and exposes
aggregated dashboards, reports
and data export.
• Isolate ingestion & export into
dedicated subsystem [aka Spinal
cord]
29. CAP THEOREM, WHAT NATURE’S CHOICE?
Availability
• Organs’s HA scale-up examples (kidneys, lungs etc.)
• Latency limitations on oxygen and blood delivery to brain and other subsystems.
• If constraint is partially met, human is slow but available.
• Strong feedback system driven by monitoring (sensors, glands etc.)
Partition Tolerance
• Possible to live with certain organ/peripheral disabilities
• Every cell has copy of DNA and cell regeneration is autonomous
Consistency
• DNA copies might be corrupted and cause uncontrollable degeneration
processes (cancer etc.)
• Eventual consistency nature of signals that can be corrupted or lost
• Inconsistency examples, e.g. VR affects hippocampus (brain’s GPS)
• Biological systems prefer eventual consistency
30. CAP THEOREM, WHAT NATURE’S CHOICE?
Availability
• Organs’s HA scale-up examples (kidneys, lungs etc.)
• Latency limitations on oxygen and blood delivery to brain and other subsystems.
• If constraint is partially met, human is slow but available.
• Strong feedback system driven by monitoring (sensors, glands etc.)
Partition Tolerance
• Possible to live with certain organ/peripheral disabilities
• Every cell has copy of DNA and cell regeneration is autonomous
Consistency
• DNA copies might be corrupted and cause uncontrollable degeneration
processes (cancer etc.)
• Eventual consistency nature of signals that can be corrupted or lost
• Inconsistency examples, e.g. VR affects hippocampus (brain’s GPS)
• Biological systems prefer eventual consistency
31. CAP THEOREM, WHAT NATURE’S CHOICE?
Availability
• Organs’s HA scale-up examples (kidneys, lungs etc.)
• Latency limitations on oxygen and blood delivery to brain and other subsystems.
• If constraint is partially met, human is slow but available.
• Strong feedback system driven by monitoring (sensors, glands etc.)
Partition Tolerance
• Possible to live with certain organ/peripheral disabilities
• Every cell has copy of DNA and cell regeneration is autonomous
Consistency
• DNA copies might be corrupted and cause uncontrollable degeneration
processes (cancer etc.)
• Eventual consistency nature of signals that can be corrupted or lost
• Inconsistency examples, e.g. VR affects hippocampus (brain’s GPS)
• Biological systems prefer eventual consistency
32. CAP THEOREM, WHAT NATURE’S CHOICE?
Availability
• Organs’s HA scale-up examples (kidneys, lungs etc.)
• Latency limitations on oxygen and blood delivery to brain and other subsystems.
• If constraint is partially met, human is slow but available.
• Strong feedback system driven by monitoring (sensors, glands etc.)
Partition Tolerance
• Possible to live with certain organ/peripheral disabilities
• Every cell has copy of DNA and cell regeneration is autonomous
Consistency
• DNA copies might be corrupted and cause uncontrollable degeneration
processes (cancer etc.)
• Eventual consistency nature of signals that can be corrupted or lost
• Inconsistency examples, e.g. VR affects hippocampus (brain’s GPS)
• Biological systems prefer eventual consistency
34. MESSAGE DRIVEN
Circulatory system
• Circulatory delivers oxygen, amino-acids, simple carbohydrates and
hormones
• Hormones are broadcast commands from glands (sensors), example
– adrenalin to narrow blood vessels
• Circulatory has own pump – heart
• Heart is designed to handle еtwo circles small and big ones one by
one
• High throughput – 5-25 liters/min, with data latency (round trip) –
5s + 25s
• Total length of all blood vessels 100 000 km
35. MESSAGE DRIVEN
Neural system
• Services to deliver commands to organs or convert to other
commands (glands to generate specific hormones) and
consume events
• High SLA and high throughput and low latency
• Implements Queue interface
• Brain has incoming 2.6M individual neuron fibers and has 140K
outgoing neuron fibers
• Most controlled organ – eye, 2M incoming fibers to consume
eye data, half of outgoing neuron fibers control eyes
• length of all neurons – 75km
36. MESSAGE DRIVEN
Lymphatic system
• Services as a “Canalization”
• Does not have own pulp (relies on side
muscle contractions *)
• Now SLA, low priority and low-throughput
37. MESSAGE DRIVEN – LESSONS
• Think about designing solutions to be fully message driven
• Backpressure-enabled by design
• Separate commands and events
• Introduce priorities and SLA to certain message types
• Nature proves it is extensible and scalable J
39. • Perfectly designed tiers with no
abstraction leaks
• Every tier has own well
minimalistic DSL able to build
upstream things
• Nature proves that systems can
be designed in that way
• Software Engineers know several
“not-bad” examples
Human Body
Organs & systems
Cells
Molecules
Quantum
ABSTRACTIONTIERS
40. WEB SERVICE – WEAK DESIGN
• No SOLID respected
• No criteria to detect if
method truly belongs
to class
• Plain structure
Controller A
Controllers
Application Sevices
Entities
Domain
Application Service
A
Repositories
Repositories
DAL
Controllers
DAO
Controller B
Application Service
B
Application Service
C
41. interface UserRepository {
List<User> getAllUsers();
List<User> getUsersByStatusEnabled();
List<User> getUsersByType(UserType userType);
User getUser(Id userId);
List<Role> getUserRoles(Id userId);
...
}
WEB SERVICE – WEAK DSL
42. DSL-DRIVEN DEVELOPMENT
• Introduce horizontal tiers (levels of
abstractions) and vertical slices (stories)
• Address API of every abstraction tier as a
custom DSL
• For every tier’s slice determine story and
write it in downstream DSL
• Scalable DSL means minimalistic grammar
and story size over time
• DDD again!
• The same principles applied on top of
microservices level and even higher
Controllers
Application Sevices
Entities
Domain
Controller A Controller B
Command
Handler A
Command
Handler B
Command
Handler C
Repositories
Entities Repositories
Entities Repositories
Entities Repositories
Bounded sub-context [Aggregate API] Bounded sub-context [Aggregate API]
events
43. SUMMARY
• Look around and learn from nature
• Not just human body – whole nature has
beautiful and sophisticated design polished
with million years of evolution