by larve · 4y ago · 0 comments
* RPC = function call
* API design = function signature
* data schema = simple structs
* message queue = list
* load balancer = simple facade object
* database = hash table / in memory SQLite
Once you have a rough sketch in place, you can run your prototype and test different behaviours.
It is a bit "tricky" to tackle asynchronous and concurrency, which you should do from the start. I prefer to do everything based on callbacks, and run my simulation from a static input list of events, ticking every component with a tick() method. This way I can generate different scenarios, save them to JSON, replay them.
Here's some examples:
- https://github.com/wesen/summer-pasture-netflix
cell.py is a kubernetes prototype (blackboard system), while app.py is the start of the netflix event notification system.
I am thinking of writing a course / book about the subject, and have a bunch of (wild) notes here: https://publish.obsidian.md/manuel/ZK/Structure+Notes/2+-+So...
I also played with pymc3 where you can just place plain python inside your probabilistic model and MCMC the heck out of it. It's slow but you can use some real world input and see what distributions arise at each point of the graph.