Main difference is in the middleware mechanism.
Express uses callbacks, so middlewares are called separately. finish 1, next, finish 2, next etc.
With Koa the second middleware is awaited inside the first middleware. Finish middleware 1, await middleware 2 from inside middleware 1, finish middleware 2, await middleware 3 from the inside of middleware 2.
When all middlewares resolve you are going to to back to middleware 1.
The style is different, you have to know what is going on, but in practice it does not change much.
Promises are awesome and you should prefer koa. But consider that express is more mature and has been working really well for many people.
Promises might cause a bit more memory usage, it shouldn't be noticiable. I might be wrong but i think koa keeps more stuff in memory, since middleware context is maintained until the response is sent, but because it's truly async uses the processor better. I am speculating here, I have no proof.
Edit: Article I found says koa is faster. You shouldn't trust articles that benchmark node servers with 1 core i7 on a Windows 10 with an Ubuntu VM without refering to memory usage. Usually people like to deploy node servers in nano or micro AWS instances which are not much better than a dedicated raspberry pi 2. I bet that he doesn't even enabled production settings for both of them so that test is worth nothing and should be taken with a mountain of salt. Express has alot more stuff going on than koa, and without production settings it might be doing a lot more things to ease your development experience.
Not seriously. We do use Go at Raygun to orchestrate our symbolification process for iOS crash reports, but not much beyond that (we wrote a little about our use here: https://raygun.com/blog/2016/03/golang-auto-scaling/)
I did have a brief experiment with Go under load, and it looked pretty good from a performance standpoint. That would have been in early 2016, and I've been impressed with the work the Go team have done around improving the GC timings.
Part of the reason we didn't go deep on Go, was based on our core competencies. While we have experience with many languages, C# has become our core strength in terms of server side coding, so .NET Core arriving on the scene made sense to explore with their cross platform support.
Hope that helps!
There are plenty of services that will never ever reach the kind of scale where this matters.
The myth about node being some kind of speed champion is obvious bullshit, but TypeScript is a very nice language.
>After all, what choices does one have on the backend? ...
You left out .NET (C#, F#) and server-side Swift.
It is very difficult to ensure that the code has no errors, which is not only a problem faced by a blockchain project, but also a problem faced by the entire software industry. In the history of software development, even NASA's Spacecraft and the British government's EDS Child Support System, which had high requirements for system bugs, have encountered bugs and caused losses worthy of billions of dollars. The detailed info about the above two examples can be found on https://raygun.com/blog/costly-software-errors-history/. Therefore, how to detect and avoid bugs in a system has always been a matter of great concern to industry and academia. Although at present there is no way to ensure the code is 100% correct, there are some tools and practices that can effectively reduce errors. And blockchain projects also use these tools and practices.
At present, the tools and practices used in the development of Nebulas mainnet are very comprehensive. First, we will use some static analysis tools to detect possible vulnerabilities in the code, then we will use unit testing, penetration testing, regression testing, integration testing and other conventional software development practices to ensure the quality of the code. Finally, we will conduct code auditing through third parties, such as NCC, HackerOne and Knownsec, to further ensure the quality of the code. Furthermore, for smart contracts, we also cooperated with Certik and provided formal verification to ensure that there will be no loopholes in smart contracts. The relevant services will be launched in the near future.
I previously used New Relic and was never a huge fan. Too "enterprisey" for my taste. I much prefer Scout for Ruby apps. It has a better UI and is focused solely on Ruby/Rails, so transaction traces and debugging tools are actually useful - I actually found the source of multiple issues and was able to fix them. I use Raygun for error reporting.
Yes, I certainly believe that ASP.NET Core is slowly becoming more and more popular in startups. Below I'm attaching some links to prove the point:
1.) https://raygun.com/blog/dotnet-vs-nodejs/ 2.) https://www.ageofascent.com/2016/02/18/asp-net-core-exeeds-1-15-million-requests-12-6-gbps/
The first one is an Application performance monitoring software named raygun that moved from nodejs to asp.net core and the second one is a multiplayer online game named age of ascent that moved their whole backend server code to asp.net core. Plus Blazor is also maturing with time and it may become an alternative for writing single page applications in the near future.
https://raygun.com/blog/2016/06/node-performance/
And I don't have publishable numbers, but I pulled down that benchmark script and ran it against koa@2 (Which is current now, but those haven't been updated since then)
My numbers show consistent results with the final chart in that article.
i dunno if i'm supposed to post what might be a shill article?
Here it is anyways:
https://raygun.com/blog/nodejs-vs-hapi-express-restify-koa/
At first I was like, wow, this thing is faster than Koa2? Then I looked at the website and saw that it seems to encompass more plug n' play than even Hapijs, and I was like WTF? What is this framework with more out of the box shit than Hapijs while being faster than Koa that I've never heard of?
So what's the story here? This is one guy just posting articles about his own framework?
You can look up benchmarks for your stack to get an idea of the high end of throughput (here's one for NodeJS). However, in real life it varies from server to server depending on things like database used (if any) and so on, so you might have to test things out yourself. Lots of hosting/IaaS providers (including Heroku) will have a place where you can view runtime metrics for your server, and you can compare the average requests per second (or minute) to the average time it took your server to respond to get a sense of when it's being strained.
> Also, lets say an inefficient DB query takes 100ms. If 30 queries are made at the same time, does that cause a 3 second delay for the last query?
That depends on the requests/query. If it's a write operation, that will generally place a lock on the database till it's complete, meaning any requests that need to write to the database (POST
s, PUT
s, DELETE
s) will have to wait in line - but requests that just fetch data (GET
s) can read what they want just fine (that also depends on how many concurrent connections your database allows).
> No big deal, you can just redeploy a fix.
Emphasizing this. Fuck ups are okay as long as you know how to fix them in reasonable time and you don't repeat them. If you ever find yourself in situations when you feel too helpless because you feel something is fucked up, but don't quite know what it is, ask yourself this - what is the worst that could happen? If the answer is along the lines of the app may crash during the demo or app may not work for some x scenario, things are fine. You lose some time, you fix it, make it work and learn from that experience. What you are offering through this whole experience is reliability - that your boss can rely on you to show up and fix it.
The exceptions to the above are when you are writing code for real time trading systems or for space applications or apps that can result in hurting some one physically. Thankfully, there's tons of accounts of major fuck ups.
I think that's perfectly fine, first of all: pair coding is not for everyone. What I would suggest you is to have a conversation about this with your manager, as it might affect your performance and your overall well-being at the company. Try to switch the roles in pair coding, that could help as well. Many engineers learn by themselves and it's very stressful for them to be in a pair coding situation.
However, this is definitely something you can improve and feel better, you just need to have a breakthrough. Discussing this with your manager/lead can help a lot to set a growth plan and have a conversation about the expectations and next steps.
Meanwhile, I suggest the following articles that might help you:
Apart from that uncheck mesh, lights, curves in preferences>editing and check again. There is no foolproof way that i have found but when using 3d applications dont use any other application.
Not sure what I should try to log.
We have RayGun for logging/reporting on the client-side of the apps. They are showing nothing interesting from those devices. They seem to fail silently.
One of the clients has sent us one of the affected devices. Although, we're still not entirely sure what we're going to do with it once we get it...
The app is as native as v1 gets :). It's not a PWA but wrapped inside a native container, rendering the app in an Android System WebView. The app is distributed via the Play Store.
Haven't tried the Ionic forums. Good idea.
I believe RUM (real user monitoring) would give you the answers you're looking for. A couple tools I'd recommend taking a look at: Pingdom RUM, Rapidspike RUM, and Raygun RUM.
Rather than a synthetic one-off test, these tools will measure the page load speed of actual visitors to the site. You should also be able to break down the data to see how the page speed is affect by device type, browser, country, etc.
I used SoloLearn in the past to learn coding as a hobby. I really enjoyed it, but I don't know how it compares to other programs/courses out there.
As for which one to learn, what are you hoping to acheive? Do you want to build websites? Create software for computers? Code games and apps for mobiles? There's many possibilities.
Once you figure out what you want to do, and what platform you want to do it for, research which programming language is most commonly used for that purpose.
This resource seems to have some good information: https://raygun.com/blog/programming-languages/
Best of luck mate.
By 'next step' are you talking about what a task does with its results? Or the dependent next task after a precursor has completed?
Either way, I'm not sure what you'd gain by shifting stuff out to a worker. If you have code in a task that might fail in ways you can't control (for example, if the client network responds with something you don't expect), then you can handle that with begin
and rescue
, which allow you to handle the failure however you want - logging, output to console, notifying someone, etc. You can do that from anywhere - it doesn't have to be in a worker.
In general, I'd minimize splitting stuff out to workers/service objects where possible. I'd say that "a task should know how to perform itself", rather than a task just being 'data' which is operated on by a worker. There are people who prefer things the other way (thin, mostly data models with service objects manipulating them) - so it's at least partly personal preference.
One big advantage of having tasks be self contained is that they can all be processed consistently, regardless if they're a 'first task' or a 'follow up task' - all the parent HealthCheck needs to do is manipulate their status
fields, but otherwise they're all the same.
As far as error notifications go, have a look at https://raygun.com if you haven't already - it gives amazing visibility over exceptions, integrates with git, notifies via Slack - it's brilliant.
RUM with Rapidspike or Raygun. Haven't tried Sematext... I'll have to give that a go.
No idea why someone would say Node is not for that, it's very explicitly for that and argubly best in class for it. Maybe they mean doing sites with WordPress or something? There's equivalents in Node.
Content management systems need to be chosen for specific reasons rather than "I may change this content at some point". The last company I worked at had a really nice in-house CMS that integrated well with dynamic components we created. Almost nobody ever used it in years.
Only really the larger organisations with a team dedicated to producing content use them. Smaller organisations think they want it, then just call us when they want any changes making. So you end up having all this additional complexity when you could just be editting templates/css files super fast.
You can create websites that you can rapidly reuse for other projects (which is the aim of the game! Still charge the same of course):
With those three you can really rapidly create web sites and re-use components that you create in each. Then if you get into more complex client-side applications/UI's, something like VueJS (my personal preference), React, or Angular lets you do that really fast with tons of reuse.
126 is a challenging course. There's nothing quite like it in that its focus is primarily on the design rather than the functionality of your code. But it's extremely important when it comes to writing software at the industry level. But it's super common for those first few MP grades in 126 to be low, and in some semesters I believe you can redo an MP or one is dropped. Please don't be discouraged—we've all been there.
​
Also, as a tip, I don't think they teach this in 126 (and I think they should) but the SOLID principles are possibly one of the best things to learn when it comes to writing good code. If you get a grasp of these or at least have them in the back of your mind when writing code, you'll be a step ahead in both this class and for internships, work, etc. Here's a good article introducing the concepts in Java but there are tons of YouTube videos on it as well. It's definitely something I recommend looking into.
Best of luck :)
orly?
https://www.eveonline.com/article/about-the-boot.ini-issue
This game had an update which literally deleted the file your OS needed to boot at all
https://raygun.com/blog/costly-software-errors-history/
This covers software not just games, so yeah, bugs on this scale are absolutely nothing compared to some of the worst out there which eclipse it by a mile :P
This is great stuff. I would add that there's a key distinction between traditional 'logs' and what I guess you could call 'entity history'. Logs are the things that the app produces as a side effect, while entity history is actually 'business data'.
Your example of creation of an important entity is a great example of entity history. Things like users making changes, customers adding items to an order and checking out, updates of stock levels in an inventory system - they're all really useful to have - they represent the life-cycle of the models in your application. Rails convention gives you a modified_at
timestamp on records, but that only tells you the last time it changed. How many times did it change before that, and who changed it? It's super useful to know.
Logs are okay for catching exceptions, but there are much better solutions for that (I love https://raygun.com with Slack and Github integration).
Logs are the things that you can truncate sooner or later, and everything would be fine. Entity history is different. Could you imagine going through your DB and clearing all your created_at
and updated_at
fields? Yikes.
I love entity history, but I almost never care about logs.
I use Postgres nearly all of the time, and its JSONB columns are really handy for history entries - it means you can store arbitrary data for each event, while keeping things reasonably small and performant.
Informative post. Keep in mind that it's written by the people from Raygun.
TL;DR:
I googled node versus kestrel (I don't actually know what the kestrel server is, though) and found a case studyhosted on Microsoft's domain. It's an interesting article where a dev team takes their request capacity from 2,000 to 20,000/second, but I'd take it with a grain of salt considering that it's Microsoft-endorsed.
Literally first link in google search
More links.
Did you bother searching before posting?
I didn’t make the original statement, but I will say that date-fns has edged out moment in terms of compatibility. There is also the ability to import pieces instead of all. A quick search of moment vs date-fns will yield all kinds of stuff I won’t bore you with here. Here is a link to one for convenience.
Learning how to work with a team is an awesome skill to learn, so good on ya! It's a shame that is isn't taught in school, because that ends up being a major hurdle once you get your first job.
​
One idea, if you know anyone that wants to work on a project with you, is that you can look into remote pair programming tools/ideas.
​
Here's an article I found just googling a little for remote pair programming:
https://raygun.com/blog/remote-pair-programming/
​
https://raygun.com/blog/increased-throughput-net-core/
.net core and old .net stuff is way different
.net core is new, fast and exciting
.net core only really came out a year ago, and people dont really go through .net core tutorials. They upgrade from .net mvc or whatever to .net core and that's like 90% of it.
There are a few cloud tools that could help with some of this. A statsd collector pushing to something like librato can give you push based metrics monitoring, and something like raygun can be used for push based alerting.
You can't rely on push alone for alerting though. For example if a host is down then you need either a polling system, or a dead-man's alert (ie alert if you don't get a message within a certain timeframe).
I've stumbled upon an example article about animating icons just the other day. The article is pretty straight forward.
Then i would suggest you restify for your API handling, frontend delivery wise HapiJS or Express are toe to toe. I suggest you to make a simple test application in booth and chose the one that is more natural to you. On a technical point of view you have this benchmark here for performance argues (exluding that Hapi is feature richer then the others, therefore slower) https://raygun.com/blog/2016/06/node-performance/