-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Micro vs Express (or Koa) #309
Comments
What are you looking for? Performance comparisons? |
Anything & everything. Perfs come later but the main thing is how Micro differs from Express (or Koa). From googling, I got to know that Express comes with everything & Koa is minimal & u can use modules to add routing & stuff to Koa & Micro is same. So what's the difference between Micro & Koa bcz both are incremental ??? |
@shime Any insights ? |
+1, i'm interesting this too |
Why did you forget about hapi js? I think we can also add that in the comparation list. |
@AndrewLosikhin I've seen Hapi & it makes a lot of others Happy 😂 but as a personal preference I'm used to Express & Koa is much smaller & simpler & is from the same people who built Express & Micro is much smaller so thought those 2 comparisons will help me choose one without much learning curve. As with Hapi, its awesome but personally I am not gonna use it yet. After all customers need something that just works, doesn't matter which language or framework is used for that. |
Seems like you figured out the difference between Express and Koa and you're now looking for Differences:
Those are the main differences I could think of. Perhaps someone more involved in either of those projects could chime in if you still have questions. |
@shime that's a good explanation of the difference. But what do you mean by |
@sergiodxa thanks, updated. |
That was never the problem. As while skimming through Koa docs & Quora I've seen people saying Koa is more like Express 5 but with Breaking Changes. My main question is can Micro be used in a large scale application ? |
@deadcoder0904 we use Micro in a large scale microservice based application. The key is |
Awesome thanks @sergiodxa |
See #234 for disk space usage comparison. TLDR; |
@deadcoder0904 maybe you could create a wiki article 👍 |
Don't think I need to, this issue explains everything 😃 & I just Googled Problem solved 😄 |
Nice! |
Unrelated to Koa vs Micro tbh, but @sergiodxa would you be kind enough to expand on this?
Where is the border between a microservice and an traditional API? Update for posterityMicroservices are aptly named. Like... a server for auth... a server for managing S3 assets... a server for managing CRUD of product listings. The idea is to have a tiny service for every little thing (routes that are related like login and logout could/should belong to the same server). These are more tolerant to someone (you?) screwing something up. If 1 server craps the bed, or gets DDoS'd, or you accidentally merge some bad code to production, then all your stuff doesn't die—just that one server. Also, by doing this, you can scale certain services independently of each other, etc. I think Sergio was insinuating Express doesn't do this as well because Express/Koa/etc. require middleware to do a lot of the standard stuff you'd do with an api framework. For instance, Express/Koa need some body parsing middleware, whereas this is bundled into core Micro (https://github.com/zeit/micro#body-parsing) and is opt-in (e.g. On top of all that, Micro and its deps are significantly smaller/better-performing than other frameworks, which is important when you consider your API might be slammed by millions of requests. Those 10ms differences add up quick. The microservice approach has a lot of big and little benefits, but you end up writing a lot of the same boilerplate over and over for each of these repos, so a significantly smaller codebase + opt-in API saves a lot of disk space, and time in development as well. A personal note about middleware: people bloat ecosystems with it and then don't maintain their middleware. You really only need body-parsing (bundled in Micro) and routing (microrouter's approach is pretty elegant) to do pretty much anything well. I might be wrong about parts, or all, of this. Someone correct me if so. |
@sergiodxa Hey, so do you have any recommendation of service discovery and api gateway solution for micro? THX |
@sergiodxa I'm very interested in the question @ithinco asked! |
@Telokis I believe Now v2 attempts to solve this problem by deploying a monorepo with many services. See the blog post (specifically the section about the monorepo) here: https://zeit.co/blog/now-2#the-majestic-monorepo |
@ithinco @Telokis I don't have any specific recommendation for Micro, any Service Discovery and API Gateway should work fine with Micro, is just a normal HTTP server at the end of the day, nothing special. Now v2 has definitely interesting things for that like being able to define routes when deploying to match your microservices entry point, but so far is missing a Micro builder for Now. @corysimmons what you said here
Was what I meant, Micro is far smaller than other alternatives, is like building a microservice with Rails/Django/Laravel, you can but do you need a whole framework for a simple service? Nope, instead you can just code it yourself using the native HTTP module or in this case a tiny abstraction to simplify it a lot. |
Googled a lot but didn't find anything useful
So maybe someone here can give any insight ??
The text was updated successfully, but these errors were encountered: