emGee Software Solutions Custom Database Applications

Share this

Web Technologies

2017/2018 JavaScript

CSS-Tricks - Fri, 01/19/2018 - 15:46

There has been a lot of research on the landscape this year! Here are a few snippets from a bunch of articles. There is a ton of information in each, so I'm just picking out a few juicy quotes from each here.

Perhaps the most interesting bit is how different the data looked at is. Each of these is different: a big developer survey, npm data, GitHub data, and StackOverflow data. Yet, they mostly tell the same stories.

The Brutal Lifecycle of JavaScript Frameworks

Ian Allen of StackOverflow writes:

JavaScript UI frameworks and libraries work in cycles. Every six months or so, a new one pops up, claiming that it has revolutionized UI development. Thousands of developers adopt it into their new projects, blog posts are written, Stack Overflow questions are asked and answered, and then a newer (and even more revolutionary) framework pops up to usurp the throne.

Using the Stack Overflow Trends tool and some of our internal traffic data, we decided to take a look at some of the more prominent UI frameworks: Angular, React, Vue.js, Backbone, Knockout, and Ember.

Read More

The Top JavaScript Trends to Watch in 2018

Ryan Chartrand of X-Team for Hackernoon writes:

This time last year, not many had faith that Vue would ever become a big competitor to React when it comes to major companies adopting it, but it was impossible to ignore Vue this year, even sending Angular a bit into the shadows in terms of developer hype.

Read More

The State of JavaScript 2017

Sacha Greif uses a survey rather than usage data:

We asked over a hundred questions to more than 28,000 developers all over the world, covering topics going from front-end libraries all the way to back-end frameworks.

I particularly enjoyed the opinions. Lots of people who love working with JavaScript and find it to be moving in the right direction and find it overly complex.

Read More

The State of JavaScript Frameworks, 2017

This one is from Laurie Voss of npm, which is probably the best source of data for usage but faces interesting challenges with that data:

You can use npm’s download statistics to give you insight into the amount of people actively invested in using and maintaining a package. However, probably more important than absolute popularity is growth.

Packages, once incorporated into software, have very long lives. People very seldom rip packages out of software once they’re installed. Because of this very low “churn,” packages hardly ever decline in usage. Furthermore, nearly all packages in the npm Registry grow in usage as the number of total npm users continues to skyrocket. They vary only in how fast they’re growing.

This makes measuring growth harder, since measuring absolute growth in downloads all the time makes almost everything look popular.

All in all it tells a familiar story: React is incredibly popular and Vue is the one to watch.

Read More

Top JavaScript Libraries & Tech to Learn in 2018

Eric Elliott writes:

Vue.js did do very well in 2017. It got a lot of headlines and a lot of people got interested. As I predicted, it did not come close to unseating React, and I’m confident to predict it won’t unseat React in 2018, either. That said, it could overtake Angular in 2018.

Read More

2017 JavaScript Rising Stars

Michael Rambeau's writes:

Once again, Vue.js is the trendiest project of the year, with more than 40,000 stars added on GitHub during the year.

It's far more than in 2016 (26,000 stars), and the gap with the next contender (React) is even bigger.

Read More

2017/2018 JavaScript is a post from CSS-Tricks

Categories: Web Technologies

Secure Contexts Everywhere

CSS-Tricks - Fri, 01/19/2018 - 10:55

Anne van Kesteren for Mozilla says:

Effective immediately, all new features that are web-exposed are to be restricted to secure contexts. Web-exposed means that the feature is observable from a web page or server, whether through JavaScript, CSS, HTTP, media formats, etc. A feature can be anything from an extension of an existing IDL-defined object, a new CSS property, a new HTTP response header, to bigger features such as WebVR. In contrast, a new CSS color keyword would likely not be restricted to secure contexts.

In other words, if your site isn't HTTPS, you won't get new web tech features. Holy jeepers. The reasoning is the web should be using HTTPS, so this is our way of beating you with a stick if you try to use fancy features without going HTTPS first.

It'll be fascinating to watch the first major feature drop and if they stick to their word here. The web dev forums of the internet will overflow with WHY DOESN'T grid-gap WORK WITH MY FLEXBOX? (or some likely coming-soon feature) questions and the answer will be: talk to your server team. What if they drop container queries behind this? That would be a hilarious devastating tornado of developer fury.

Direct Link to ArticlePermalink

Secure Contexts Everywhere is a post from CSS-Tricks

Categories: Web Technologies

MariaDB 5.5.59 now available

Planet MySQL - Fri, 01/19/2018 - 08:18

The MariaDB project is pleased to announce the immediate availability of MariaDB 5.5.59. This is a stable (GA) release. See the release notes and changelog for details. Download MariaDB 5.5.59 Release Notes Changelog What is MariaDB 5.5? MariaDB APT and YUM Repository Configuration Generator Thanks, and enjoy MariaDB!

The post MariaDB 5.5.59 now available appeared first on MariaDB.org.

Categories: Web Technologies

When (and when not) to use Redux

Echo JS - Fri, 01/19/2018 - 08:08
Categories: Web Technologies

Top 5 Trends in JS Development

Echo JS - Fri, 01/19/2018 - 08:08
Categories: Web Technologies

MariaDB Server 5.5.59 now available

Planet MySQL - Fri, 01/19/2018 - 08:07
MariaDB Server 5.5.59 now available dbart Fri, 01/19/2018 - 11:07

The MariaDB project is pleased to announce the immediate availability of MariaDB Server 5.5.59. See the release notes and changelog for details and visit mariadb.com/downloads to download.

Download MariaDB Server 5.5.59

Release Notes Changelog What is MariaDB 5.5?

The MariaDB project is pleased to announce the immediate availability of MariaDB Server 5.5.59. See the release notes and changelog for details.

Login or Register to post comments

Categories: Web Technologies

Shinguz: Short term notice: Percona XtraDB Cluster training in English 7/8 February 2018 in Germany

Planet MySQL - Fri, 01/19/2018 - 08:05

FromDual offers short term a Percona XtraDB Cluster and MySQL Galera Cluster training (2 days) in English.

The training will take place in the Linuxhotel in Essen/Germany on February 7/8 2018.

There are already enough registrations so it is certain the training will take place. But there are still free places for some additional participants.

You can book online at the Linuxhotel.

Important: The Linuxhotel is nearly fully booked out. So accommodation is in nearby locations. The Linuxhotel will recommend you some locations.

The training is in English.

You can find the contents of this 2-day Percona XtraDB Cluster training here.

If you have any question please do not hesitate to contact us.

Taxonomy upgrade extras:  galera Percona XtraDB Cluster training linuxhotel
Categories: Web Technologies

Enhanced replication monitoring in ProxySQL 1.4.4

Planet MySQL - Fri, 01/19/2018 - 08:00
ProxySQL and pt-heartbeat

The Percona toolkit provides a very useful script for more accurate replication lag monitoring called pt-heartbeat. The pt-heartbeat script provides replication lag metrics based on actual data that has been replicated and is more accurate than the Seconds_Behind_Master metrics gathered from the output of SHOW SLAVE STATUS. Seconds_Behind_Master relies purely on system time (i.e. current time - time the event executed on the master server). By default ProxySQL relies on the output of the SHOW SLAVE STATUS command in order to identify replicas that should be excluded from the backend connection pool when max_replication_lag has been configured for a server in the mysql_servers table.

Starting from ProxySQL version 1.4.4 a new feature has been introduced in order to leverage the data provided by pt-heartbeat and in turn much more precise replication lag monitoring, all that is required is to configure mysql-monitor_replication_lag_use_percona_heartbeat with the database and table name which pt-heartbeat is writing to.

This tutorial aims to provide a simple how-to article in order to setup pt-heartbeat and use the data provided for ProxySQL's replication lag monitoring. In order to proceed you'll need to make sure the Percona toolkit is installed on your system. Instructions can be found here. After Percona toolkit has been installed (either on a monitoring server or your master server) you can proceed with the following steps:

  • Create a percona database (on the master) to store the heartbeat data:

    $ mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7653 Server version: 5.7.19-17-log Percona Server (GPL), Release '17', Revision 'e19a6b7b73f' Copyright (c) 2009-2017 Percona LLC and/or its affiliates Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE DATABASE IF NOT EXISTS percona; Query OK, 1 row affected, 1 warning (0.54 sec) mysql> exit; Bye
  • Now we're ready to kick off the pt-heartbeat process:

    $ pt-heartbeat -D percona --update -h localhost --create-table --daemonize
  • Lets go ahead and verify pt-heartbeat is running properly on the slave:

    $ mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7653 Server version: 5.7.19-17-log Percona Server (GPL), Release '17', Revision 'e19a6b7b73f' Copyright (c) 2009-2017 Percona LLC and/or its affiliates Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select * from percona.heartbeat; +----------------------------+-----------+------------------+----------+-----------------------+---------------------+ | ts | server_id | file | position | relay_master_log_file | exec_master_log_pos | +----------------------------+-----------+------------------+----------+-----------------------+---------------------+ | 2018-01-18T17:13:42.000790 | 192168111 | mysql-bin.000020 | 51025284 | mysql-bin.000012 | 40774236 | +----------------------------+-----------+------------------+----------+-----------------------+---------------------+ 1 row in set (0.00 sec) mysql> select * from percona.heartbeat; +----------------------------+-----------+------------------+----------+-----------------------+---------------------+ | ts | server_id | file | position | relay_master_log_file | exec_master_log_pos | +----------------------------+-----------+------------------+----------+-----------------------+---------------------+ | 2018-01-18T17:13:44.001590 | 192168111 | mysql-bin.000020 | 51026250 | mysql-bin.000012 | 51026250 | +----------------------------+-----------+------------------+----------+-----------------------+---------------------+ 1 row in set (0.00 sec)

    We can see from the above output that the pt-heartbeat data is being written on the master and is replicating to the slave as well so now we're ready to configure the ProxySQL host.

  • Connect to the ProxySQL Admin interface:

    $ mysql -uadmin -padmin -h127.0.0.1 -P6032 --prompt 'Admin> ' mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.5.30 (ProxySQL Admin Module) Copyright (c) 2009-2017 Percona LLC and/or its affiliates Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Admin>
  • The next step is to enable the replication lag check on all or sum of the servers as desired:

    Admin> SELECT * FROM mysql_servers; +--------------+---------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+ | hostgroup_id | hostname | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment | +--------------+---------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+ | 10 | ubuntu-vm-nv1 | 3306 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | | | 20 | ubuntu-vm-nv2 | 3306 | ONLINE | 1 | 0 | 1000 | 0 | 0 | 0 | | +--------------+---------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+ 2 rows in set (0.03 sec) Admin> update mysql_servers set max_replication_lag = 30; Query OK, 2 rows affected (0.00 sec) Admin> save mysql servers to disk; load mysql servers to runtime; Query OK, 0 rows affected (0.40 sec) Query OK, 0 rows affected (0.00 sec)

    Here the threshold has been set to 30(s) on all servers, feel free to adjust to whatever granularity your checks require. Remember that the frequency of the check is controlled by the mysql-monitor_replication_lag_interval variable. Make sure that max_replication_lag is not smaller than mysql-monitor_replication_lag_interval.

  • Finally configure ProxySQL to use pt-heartbeat data:

    Admin> select @@mysql-monitor_replication_lag_use_percona_heartbeat; +-------------------------------------------------------+ | @@mysql-monitor_replication_lag_use_percona_heartbeat | +-------------------------------------------------------+ | | +-------------------------------------------------------+ 1 row in set (0.00 sec) Admin> set mysql-monitor_replication_lag_use_percona_heartbeat = 'percona.heartbeat'; Query OK, 1 row affected (0.00 sec) Admin> save mysql variables to disk; load mysql variables to runtime; Query OK, 93 rows affected (0.30 sec) Query OK, 0 rows affected (0.00 sec)

ProxySQL is now monitoring replication lag using Percona's pt-heartbeat!

Authored by: Nick Vyzas

Categories: Web Technologies

Creating a Vue.js Serverless Checkout Form: Configure the Checkout Component

CSS-Tricks - Fri, 01/19/2018 - 07:54

This is the fourth post in a four-part series. In Part one, we set up a serverless Stripe function on Azure. Part two covered how we hosted the function on Github. The third part covered Stripe Elements in Vue. This last post shows how to configure the checkout component and make the shopping cart fully functional.

Article Series:
  1. Setup and Testing
  2. Stripe Function and Hosting
  3. Application and Checkout Component
  4. Configure the Checkout Component (This Post)

As a reminder, here's where we are in our application at this point:

Configuring the Checkout Component

We have to do a few things to adjust the component in order for it to meet our needs:

  • Make sure the form is only displaying if we haven't submitted it—we'll deal with the logic for this in our pay method in a moment
  • Allow the form to take a customer's email address in case something is wrong with the order.
  • Disable the submit button until the required email address is provided
  • Finally and most importantly, change to our testing key

Here's our updated checkout component with the changes to the original code highlighted:

<div v-if="!submitted" class="payment"> <h3>Please enter your payment details:</h3> <label for="email">Email</label> <input id="email" type="email" v-model="stripeEmail" placeholder="name@example.com"/> <label for="card">Credit Card</label> <p>Test using this credit card: <span class="cc-number">4242 4242 4242 4242</span>, and enter any 5 digits for the zip code</p> <card class='stripe-card' id="card" :class='{ complete }' stripe='pk_test_5ThYi0UvX3xwoNdgxxxTxxrG' :options='stripeOptions' @change='complete = $event.complete' /> <button class='pay-with-stripe' @click='pay' :disabled='!complete || !stripeEmail'>Pay with credit card</button> </div>

There are a number of things we need to store and use for this component, so let's add them to data or bring them in as props. The props that we need from our parent component will be total and success. We'll need the total amount of the purchase so we can send it to Stripe, and the success will be something we need to coordinate between this component and the parent, because both components need to know if the payment was successful. I write out the datatypes as well as a default for my props.

props: { total: { type: [Number, String], default: '50.00' }, success: { type: Boolean, default: false } },

Next, the data we need to store will be the stripeEmail we collected from the form, stripeOptions that I left in to show you can configure some options for your form, as well as status and response that we'll get from communicating with the server and Stripe. We also want to hold whether or not the form was submitted, and whether the form was completed for enabling and disabling the submit button, which can both be booleans.

data() { return { submitted: false, complete: false, status: '', response: '', stripeOptions: { // you can configure that cc element. I liked the default, but you can // see https://stripe.com/docs/stripe.js#element-options for details }, stripeEmail: '' }; },

Now for the magic! We have everything we need—we just need to alter our pay() method, which will do all the heavy lifting for us. I'm going to use Axios for this, which will receive and transform the data:

npm i axios --save

...or using Yarn:

yarn add axios

If you're not familiar with Axios and what it does, check out this article for some background information.

pay() { createToken().then(data => { this.submitted = true; // we'll change the flag to let ourselves know it was submitted console.log(data.token); // this is a token we would use for the stripeToken below axios .post( 'https://sdras-stripe.azurewebsites.net/api/charge?code=zWwbn6LLqMxuyvwbWpTFXdRxFd7a27KCRCEseL7zEqbM9ijAgj1c1w==', { stripeEmail: this.stripeEmail, // send the email stripeToken: data.token.id, // testing token stripeAmt: this.total // send the amount }, { headers: { 'Content-Type': 'application/json' } } ) .then(response => { this.status = 'success'; this.$emit('successSubmit'); this.$store.commit('clearCartCount'); // console logs for you :) this.response = JSON.stringify(response, null, 2); console.log(this.response); }) .catch(error => { this.status = 'failure'; // console logs for you :) this.response = 'Error: ' + JSON.stringify(error, null, 2); console.log(this.response); }); }); },

The code above does a number of things:

  • It allows us to track whether we've submitted the form or not, with this.submitted
  • It uses Axios to post to our function. We got this URL from going to where the function lives in the portal, and clicking "Get Function URL" on the right side of the screen.
  • It sends the email, token, and total to the serverless function
  • If it's successful, it changes the status to success, commits to our Vuex store, uses a mutation to clear our cart, and emits to the parent cart component that the payment was successful. It also logs the response to the console, though this is for educational purposes and should be deleted in production.
  • If it errors, it changes the status to failure, and logs the error response for help with debugging

If the payment fails, which we'll know from our status, we need to let the user know something went wrong, clear our cart, and allow them to try again. In our template:

<div v-if="status === 'failure'"> <h3>Oh No!</h3> <p>Something went wrong!</p> <button @click="clearCheckout">Please try again</button> </div>

The button executes the following clearCheckout method that clears a number of the fields and allow the customer to try again:

clearCheckout() { this.submitted = false; this.status = ''; this.complete = false; this.response = ''; }

If the payment succeeds, we will show a loading component, that will play an SVG animation until we hear back from the server. Sometimes this can take a couple of seconds, so it's important that our animation make sense if it is seen for a short or long amount of time, and can loop as necessary.

<div v-else class="loadcontain"> <h4>Please hold, we're filling up your cart with goodies</h4> <app-loader /> </div>

Here's what that looks like:

See the Pen shop loader by Sarah Drasner (@sdras) on CodePen.

Now if we revisit the first cart component we looked at in pages/cart.vue, we can fill that page based on the logic we set up before because it's been completed:

<div v-if="cartTotal > 0"> <h1>Cart</h1> ... <app-checkout :total="total" @successSubmit="success = true"></app-checkout> </div> <div v-else-if="cartTotal === 0 && success === false" class="empty"> <h1>Cart</h1> <h3>Your cart is empty.</h3> <nuxt-link exact to="/"><button>Fill 'er up!</button></nuxt-link> </div> <div v-else> <app-success @restartCart="success = false"/> <h2>Success!</h2> <p>Your order has been processed, it will be delivered shortly.</p> </div>

If we have items in our cart, we show the cart. If the cart is empty and the success is false, we'll let them know that their cart is empty. Otherwise, if the checkout has just been processed, we'll let them know that everything has been executed successfully!

We are now here:

In the AppSuccess.vue component, we have a small SVG animation designed to make them feel good about the purchase:

See the Pen success by Sarah Drasner (@sdras) on CodePen.

(You may have to hit "Rerun" to replay the animation.)

We also put a small timer in the mounted() lifecycle hook:

window.setTimeout(() => this.$emit('restartCart'), 3000);

This will show the success for three seconds while they read it then kick off the restartCart that was shown in the component above. This allows us to reset the cart in case they would like to continue shopping.

Conclusion

You learned how to make a serverless function, host it on Github, add required dependencies, communicate with Stripe, set up a Shopping Cart in a Vue application, establish a connection with the serverless function and Stripe, and handle the logic for all of the cart states. Whew, way to go!

It's worth mentioning that the demo app we looked at is a sample application built for specifically for this purpose of this tutorial. There are a number of steps you'd want to go through for a production site, including testing, building the app's dist folder, and using real Stripe keys. There are also so many ways to set this up, Serverless functions can be so flexible in tandem with something like Vue. Hopefully this gets you on track and saves you time as you try it out yourself.

Creating a Vue.js Serverless Checkout Form: Configure the Checkout Component is a post from CSS-Tricks

Categories: Web Technologies

Percona Monitoring and Management (PMM) 1.6.0 Is Now Available

Planet MySQL - Fri, 01/19/2018 - 07:51

Percona announces the release of Percona Monitoring and Management (PMM) 1.6.0. In this release, Percona Monitoring and Management Grafana metrics are available in the Advanced Data Exploration dashboard. We’ve improved the integration with MyRocks, and its data is now collected from SHOW GLOBAL STATUS.

The MongoDB Exporter now features two new metrics: mongodb_up to inform if the MongoDB Server is running and mongodb_scrape_errors_total reporting the total number of errors when scaping MongoDB.

In this release, we’ve greatly improved the performance of the mongodb:metrics monitoring service.

Percona Monitoring and Management (PMM) 1.6.0 also includes version 4.6.3 of Grafana which includes fixes to bugs in the alert list and the alerting rules. More information is available in the Grafana’s change log.

New Features
  • PMM-1773: PMM Grafana specific metrics have been added to the Advanced Data Exploration dashboard.
Improvements
  • PMM-1485: Updated MyRocks integration: MyRocks data is now collected entirely from SHOW GLOBAL STATUS, and we have eliminated SHOW ENGINE ROCKSDB STATUS as a data source in mysqld_exporter.
  • PMM-1895: Update Grafana to version 4.6.3:
    • Alert list: Now shows alert state changes even after adding manual annotations on dashboard #9951
    • Alerting: Fixes bug where rules evaluated as firing when all conditions were false and using OR operator. #9318
  • PMM-1586: The mongodb_exporter exporter exposes two new metrics: mongodb_up informing if the MongoDB Server is running and mongodb_scrape_errors_total informing the total number of times an error occurred when scraping MongoDB.
  • PMM-1764: Various small mongodb_exporter improvement
  • PMM-1942: Improved the consistency of using labels in all Prometheus related dashboards.
  • PMM-1936: Updated the Prometheus dashboard in Metrics Monitor
  • PMM-1937 Added the CPU Utilization Details (Cores) dashboard to Metrics Monitor.
Bug fixes
  • PMM-1549: Broken default auth db for mongodb:queries
  • PMM-1631: In some cases, percentage values were displayed incorrectly for MongoDB hosts.
  • PMM-1640: RDS exporter: simplify configuration
  • PMM-1760: After the mongodb:metrics monitoring service was added, the usage of CPU considerably increased in QAN versions 1.4.1 through 1.5.3.

    1.5.0 – CPU usage 95%
    1.5.3 – CPU usage 85%
    1.6.0 – CPU usage 1%

  • PMM-1815QAN could show data for a MySQL host when a MongoDB host was selected.
  • PMM-1888: In QAN, query metrics were not loaded when the QAN page was refreshed.
  • PMM-1898: In QAN, the Per Query Stats graph displayed incorrect values for MongoDB
  • PMM-1796: In Metrics Monitor, the Top Process States Hourly graph from the MySQL Overview dashboard showed incorrect data.
  • PMM-1777: In QAN, the Load column could display incorrect data.
  • PMM-1744: The error Please provide AWS access credentials error appeared although the provided credentials could be processed successfully.
  • PMM-1676: In preparation for migration to Prometheus 2.0 we have updated the System Overview dashboard for compatibility.
  • PMM-1920: Some standard MySQL metrics were missing from the mysqld_exporter  Prometheus exporter.
  • PMM-1932: The Response Length metric was not displayed for MongoDB hosts in QAN.
Categories: Web Technologies

Pages

1 2 3 4 5 6 7 8 9 next › last »