Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Twitter has open sourced their Mysql source code.
This blog post http://engineering.twitter.com/2012/04/mysql-at-twitter.html mentions the different changes.
I have used Mysql as developer executing queries but never had to dig deep into its source code. I tried going through the source code on github https://github.com/twitter/mysql but was overwhelmed.
So thought I would post here and get some help.
I would like to better understand how Twitter's changes has improved
Mysql over the Oracle's version.
If I were to make an apples to apples comaparison between Oracle's version and Twitter's version what are specific advantages disadvantages between the two.
There are many more questions that popped into my head.
I get that this is sort of an advanced DB topic, but I would love learn about it.
They describe the changes as including:
Add additional status variables, particularly from the internals of
InnoDB. This allows us to monitor our systems more effectively and
understand their behavior better when handling production workloads.
Optimize memory allocation on large NUMA systems: Allocate InnoDB's
buffer pool fully on startup, fail fast if memory is not available,
ensure performance over time even when server is under memory
pressure.
Reduce unnecessary work through improved server-side
statement timeout support. This allows the server to proactively
cancel queries that run longer than a millisecond-granularity timeout.
Export and restore InnoDB buffer pool in using a safe and lightweight
method. This enables us to build tools to support rolling restarts of
our services with minimal pain.
Optimize MySQL for SSD-based machines,
including page-flushing behavior and reduction in writes to disk to
improve lifespan.
These are things that are important for a Twitter-scale web site. If you are building something that has to scale to that size - yes, those changes would be helpful. But, if you are building something more like every other mildly-popular web site in the world, you probably don't need to be concerned with their changes. Most large web sites that run MySQL run it straight from the distribution.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Suppose I have to run a java, c++, or python3.8 program on my machine, but I don't want these programs to access my system information, run os commands, or perform any malicious activity. Is there a way to do this for each of the aforementioned languages?
Java theoretically has a solution for this: The 'SecurityManager'. You can set one up within your java code (you can tell the system: Here is some code; load it as the manager please).
A securitymanager gets called before certain things happen and can deny the operation. It's mostly anything that feels security sensitive:
Quitting the VM
Opening any file
Opening any network connection
Setting the security manager
accessing clipboards
Printing things
Can influence certain aspects of thread loading
You'd tell java to run some class file that you wrote, that class file sets up a security manager, and will then run the application you want to restrict.
Note that you can't really restrict how much memory and/or CPU it uses with a SecurityManager, which can be quite an issue by itself.
The problem is, the primary use case for this mechanism is to run applets, and applets are long dead. Thus, it's a feature that few people in the java ecosystem are currently using, and little-used blacklist-style mechanisms are usually riddled with holes.
I'd strongly suggest you set up a virtual machine for this purpose. There are leaks in hypervisor based restrictions too, but 'host things in a VM and ensure it cant do things to the underlying machine' is a lot more common.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am using JSP/Serverlets for my upcoming web application project. It is high traffic concurrent users web site. There has been many discussion about performance issues of Java 8 and especially in Streams.
Anyone having specific knowledge about performance of streams and whether its advisable to use in High traffic Web Applications so as to not compromise on latency and response time ?
As a general statement, outside of Java 8 Streams, it is pretty much impossible to answer your question as stated because it depends.
If you've got a method that is called hundreds of times per second then you would need to be very careful about performance. You'd want to tune it the best you could. Conversely, if you've got a method that gets called once a day then you likely wouldn't spend too much time optimizing it.
Streams are a useful tool when used correctly and they are easy to abuse. I've seen developers who thought it was a great idea to read an entire database table and use filtering with streams to effectively do a SQL "where" clause. That's a bad design but it honestly wouldn't be seen in the once-a-day method call.
Don't try to make these blanket "this is good or this is bad" statements. Do a good design and use the tools where they are appropriate. Optimize the parts of your application that need it but don't do pre-mature optimizations - you'll never finish the project.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Ok, it does not need to be something 100% secure. Something simple, that will cut 80% of people from using my demo library past 30 days and contact me.
The only thing I can think of is making my code save a file somewhere, with the date that the library started and after 30 days just exit displaying a message to contact for the full version. Of course, if the user finds out where this file is, all he has to do is delete it, so it would be nice if it could be in some kind of not so easy to find place (desktop or home directory would be silly I suppose).
Of course if he decompiles the code, he can easily turn that off, but again, I want some protection, even 50%, not 100%.
Target operating system is probably linux/unix, but I can also discover dynamically to make it work in any.
You don't mention the target operating system, so it is a little bit hard to answer the question. If your target is Windows, I would store the first start time in the Registry. Maybe this can help you.
I think your file strategy looks perfectly fine.
If you want to strengthen your scheme, you will have to contact a central service of some sort where you can detect if the same server tries to restart your evaluation time multiple times. The central server could i.e. sign a token with an expiry date that the library needs to run.
On the other hand, the more complicated this kind of schemes is, the more likely they are to fail at times and create problems for your legitimate users. You should consider this against the (probably very low) volume of users that would actively sabotage a more simple scheme.
PS: remember that in some environments multiple copies of different applications that uses your library may have to run simultaneously.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I've been writing some console applications in c++ for working with audio for a little while now and I'm interested in running them on a website. Most of my programs are quite resource-hungry, however, some with execution times of up to 5-10 min, reading and writing several gigabytes to and from disk, and requiring several gigabytes of memory. I've done a few simple php-mysql pages before, but nothing like this, so before i get my hopes up and dive into learning how to get an application running on a website, i figure i should ask a few questions:
Is it even feasible to run a program like this on the web? How would performance on a server compare to my PC?
Do web hosts typically allow a single user to use this kind of memory?
I realize c++ isn't usually the first choice for web programming, but since performance will be critical would it be better than Java?
I know nothing about this, so i'm just trying to get my expectations straight.
This is my opinion:
1 - The user of your web application is probably not going to wait 5-10 min for a response. You can focus on doing the hard-work on another process and your web app later shows the results to your user in some way.
2 - Yes, they allow, but that costs money. You can see Amazon EC2 and Digital Ocean (cheaper).
3 - The programming language in this case (C++ or Java) is not that important. Focus more on your problem, architecture, deferred tasks, batch processing, etc. That will really make a difference.
No, the programming language doesn't much matter. It used to be the case that java was slower than C++ i believe, but that gap has closed pretty much as compilers have improved. If you want to run your applications better, try to design them in such a way that they are very efficient. Looking into Time Complexity may help, if you haven't already done so. The better your time complexity, the faster your program.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have a web application developed with Java (JSP, Servlets, etc) where I use MySQL as DBMS, take care:
Connection Pool
PreparedStatement
Stored Procedures
-Triggers
My question is how many changes I have to make my application (In addition to changing the name of the driver and the. Jar) for smooth functions with MariaDB.?
Or what considerations should I take for that change?
There is a compability list on MariaDBs pages so you can see that 99% is the same like in MySQL. And from Java perspective, your statements and connection pool should remain the same, however I suppose they can be minor changes in a way how to write stored procedures.
So generally, this transition shouldn't cause any problems but you still want to test this thoroughly in order to be sure that nothing really changed.
MariaDB is a direct fork of the MySQL codebase which hasn't diverged much from it yet. The developers are doing their best to avoid any compatibility-breaking changes to make sure that MariaDB can be used as a drop-in replacement for MySQL. That means switching from MySQL to MariaDB is comparable with updating your MySQL version.
It is unlikely that you will have to make any modifications at your application at all. Still, a proper integration test is definitely in order before migrating the production system, especially when your MySQL version isn't up-to-date.