Categories
Resources Web Development

PHP composer links and resources.

Composer is a dependency manager for PHP. Confusing to install, easy to use.

Composer documentation – the actual documentation helps.

A gentle introduction to composer as a dependency manager – excellent resource covering pretty much everything about PHP composer you could ever want to know. Well mostly.

 

Categories
Resources Software Development

Scala Play Framework Slick resources and links

Below is a list of resources, links, videos etc. a

Play Framework and Slick example updated – very helpful article

Categories
Resources Software Development

What are Scala package objects?

Scala package objects are basically code, functions, variables, classes, objects that you want available to all of your other code/files/objects in a given package. Basically it is like a system to provide utility, helper or common code all in one place.

Instead or writing an article I’ll post links to helpful resources. No reason to waste all my time writing articles if good article exist.

A minimal coverage of Package Objects by the  Scala docs.

The following link is from alvin alexander – from Scala Cook Book if you don’t own it you should buy it, this is an excellent resource. This link goes into much deeper detail than the documentation.
How to put common code in Scala package objects

Scala Tutorial – Learn How To Use Package Objects – excellent tutorial on how to use Package Objects.

Categories
Resources Software Development

HikariCP connection pooling software resources and links

HikariCP is a connection pool software that maintains connection pool resources so your code use them to access databases.

This can be used in place of Akka and Scala execution context for database connections. This helps keep your main application code from being blocked while it does a database query to either store or retrieve information.

HikariCP is the fastest and most resource efficient connection pool technology for the JVM.

 

Links

Introduction to HikariCP – a great introduction to what HikariCP is to start out with.

HikariCP documentation – a link to the actual documentation, you have to click the version of CP you want to use.

A quick guide to connection pooling in Java

Categories
Random Resources Software Development

Interesting blog about databases

I found this link somehow. This guy has all kinds of interesting information about databases, programming and technology in general . https://aphyr.com/tags/jepsen

Categories
Resources Software Development

Links about using MySQL as a NoSQL database

I got interested in using the JSON field of MySQL so I did some googling turns out I am not the only one. Some things have changed over the years since MySQL introduced the JSON field.

MySQL is a Great NoSQL Datastore

Scaling to 100M: MySQL is a Better NoSQL

Using MySQL as a document store – from the documentation

Categories
Resources Software Development

Scala concurrent programming links and resources

A journey into concurrent programming in Scala – a good article about concurrent programming in Scala

Java Executors documentation – Scala uses Javas future system with Executors etc.

Play uses Akka so you can also use Akka dispatchers for the ExecutionContext required in the Controllers.

Link to Hikaricp library that creates connection pools for database access on JVM

Ebooks

Concepts and Technologies for Distributed Systems and Big Data Processing
Philipp Haller
Scala Futures, Async, and Actors

Categories
Resources Software Development

Scala performance issues and tuning

Exploring Scala performance – Great article pointing out some of the small things you can do to improve performance or DESTROY it.

Reactive Audit – a program to help detect where an application is using blocking code. This audit tool aims to provide help to the use of Reactive architecture in project implementations

Categories
Resources Software Development

Scala case class resources links and information

Scala case classes are used heavily in Scala code. Understanding them is very important in order to be efficient in Scala. Instead of repeating everything in the below articles, I’ll post links instead.

Scala Case Class and Case Object In-Depth (Part-1)

Scala Case Class and Case Object In-Depth (Part-2) 

Using Case Classes to Structure Your Data

Categories
Resources Software Development

Reactive web applications notes

These are my personal notes about Reactive Web Applications by Manuel Bernhardt – It was written in 2016 it is a bit dated already as it covers Play Framework 2.4 and it is currently at 2.8 some of the things in play have changed. Play and everything in Scala world is changing so quickly all books are outdated the day they are published but they are still useful.

This book contains a lot of good general information about how Play Framework works.

One problem is certain things have either been removed from play framework code API and no one bothered to leave a link in the API docs, or the code was wrong. In particular chapter 5

import play.api.libs.concurrent.Execution.Implicits._

The compiler complains Execution does not exist.

The book is still full of great information and examples that give you a good idea of why you should do things a certain way and even examples of things to avoid.

But these are my notes for me.

Good coverage of  how Plays ExecutionContext works in Chapter 5 starting on page 110 in particular. This chapter covers Futures, how to use them in Play and how the Execution context works. It covers how to create custom execution contexts for such things as DB access or for each service of a larger app.intensly

Chapter 5 page 11 covers Async Controller Actions, how to create them and why, lots of good info on pages 110 – 111.

Chapter 5 page 112 Covers Custom Error handlers, very useful information here, for handling errors when working with Futures.

Chapter 5 page 114 covers correctly configuring and using an ExecutionContext. It covers when and why you would want to do so.  Page 115 & 116 carries on and goes into deeper coverage with Specialized Execution contexts such as DB heavy code. Pages 117 & 118 continue to cover Execution context in depth  This is the best coverage of Play Frameworks Execution context I have found anywhere yet.

Page 119 & 120 covers testing futures a little

Page 120 section 5.2 talks about Designing Asynchronous business logic with Futures and identifying parallelizable elements.

Pages 121 through 128 continue to cover using Futures, the quirks associated with them and how to avoid them.

Page 123 mentions the reason Futures are better than callbacks is because futures can be composed or combined, this can make swapping things out quicker.

page 126 makes an interesting point about Futures and the order in which you declare them. This mentions a gotcha with a good example of something that wouldn’t work the way you expect it to with Futures.

Page 128 – 132 covers Handling errors when using futures.

Chapter 6 is a quick introduction to Akka Actors and how to use them in play apps.

Page 144 lists the actor methods such as tell, forward etc. and gives brief coverage.

Page 147 makes a point about using var over val for actors to make them immutable.

Pages 148 and 149 cover common beginner mistakes with actors and how to avoid them.

Page 149 quickly covers when to use an Actor vs Future, very good and useful insight here.

Page 154 Section 6.2.3 has good information about letting actors die and reviving them and other error/exception recovery information.

The rest of chapter 6 pages 155+ deal with monitoring and preventing actor service overload, circuit breakers and more on handing errors.

Page 157 – 158 address avoiding duplicate actions

Page 159 covers Actor Message priority as a way to keep an actor system from overlaoding.