a bunch of ideas by me on how to create microservices and manage microservice systems
(and my sort-of attempts to standardize the process for myself)
Just a bunch of thoughts on how to design microservices and microservice systems.
a bunch of ideas by me on how to create microservices and manage microservice systems
(and my sort-of attempts to standardize the process for myself)
sometimes we might need something that manages "jobs", something like sidekiq or kue
dump ideas on how it should work, and maybe create a PoC project
There are a few configuration options that probably every microservice should have.
Below is a list:
PORT
= What port to listen on. Note that it could differ from the LOCATION
variable, simply because some middleware (docker, nginx, reverse proxy, firewall, router, etc.) could be changing the real port the service should be communicated with.LOCATION
= How to communicate with the microservice, if someone were to connect to it. Ref: #1One thing that I do a lot is overcomplicate the system, making it overly complex, and ultimately unwieldy, or never finished. This is a design step that needs some thinking: How do we decide when we have a good MVP to start with?
One of my goals here is to provide a simple, standardized flowchart (?) of how to put the various pieces of microservices together. One size never fits all well, and because of that, we want to give people options on doing things, e.g. having a "simple but limited" way of doing things, with a "complex but powerful" way of doing things, and so forth, as well as providing ideas on how to "upgrade" to the next complexity stage fairly smoothly.
Another goal is language agnosticism, so only provide libraries as examples only.
Considering how I am working on XBPF at my full-time job, I am working on designing and then implementing a microservice system over at my job.
Currently, it's in some weird transitional state, but it's definitely something to keep in mind when braindumping ideas into this repo: Providing my experiences with implementing such a system.
this isn't really related, but i'm doing a quick braindump from a piece of paper i had:
ok
: 200 (OK) -> resource actions?security/validation
:
routing
:
error/internal
:
security/auth
:
There are sooooooo many ways to configure microservices. I'm currently thinking of the "default" way to configure them.
For starters, I really like environment variables, simply because of how flexible they are, but they definitely are inflexible. Maybe using a combination?
I don't believe you should build a system with microservices right off the bat. I feel you should start with a monolith, and then break it down more and more when you know what you will use microservices for for sure.
The question here is: How do you make it so you can write a monolithic app that can be relatively easily decomposed later? Are there any programming patterns to follow?
Eventually, you'd want to stabilize a service's API, so it doesn't change often.
The problem here is that I get stuck with API design: Is it good enough? Will it cover the cases I want it to cover? How will I be able to easily change it? I get overloaded and just locked up with those thoughts, sometimes for days on end.
So there needs to be a development process where you can just write bad code and a messy for a while to get things done, and then figure out when you want to clean it all up, and stabilize it into a clean API with good code.
This is the current process I currently thought up off the top of my head:
http status codes are annoying and there are too many of them and they're bloated and they suck
and the rest are too generic
there should be fewer, more understandable codes that specify the general (common) situation, and then let the user specify a sub-code if they want to manually handle some specific case
More questions later.
with a distributed system, it's much harder to have atomic operations, so you have to manage atomics on a more fine grained level, but also be able to consistently distribute events so the whole system is at an eventually consistent state, which includes being able to gracefully handle any error at any point in time
think about:
There are two main patterns for service discovery: Registration (and maintenance) by the service itself, and registration by a third party that pretty much monitors the service, and watches its health.
Currently, I am leaning towards service's own registration, but having the "health" part be maintained by a third party. It's kind of a mix of both, and it could be messy.
One thing that's been on my mind is: How do we do zero-downtime deployments with databases? How will the services handle migrations? How should migrations be kept track of and run?
Another thing to keep in note: How do we version the changes? What do we do in case of a breaking change? We do we do in case of a migration that needs to be run atomically, otherwise it will be in a consistent state while it's running?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.