Monday, March 30, 2015

3-30-15

Working on examples and related work:


[Quick Start] Using QBit microservice lib's REST support with URI Params
done


[Detailed Tutorial] Using QBit microservice lib's REST support with URI Params
Done

[Detailed Tutorial] Using event channels and strongly typed event bus with QBit (The employee example)

done

-------------------------------------------------------------

Links:

[Quick Start] Using QBit microservice lib's REST support with URI Params

https://github.com/advantageous/qbit/wiki/%5BQuick-Start%5D-Using-QBit-microservice-lib's-REST-support-with-URI-Params

[Detailed Tutorial] Using QBit microservice lib's REST support with URI Params

https://github.com/advantageous/qbit/wiki/%5BDetailed-Tutorial%5D-Using-QBit-microservice-lib's-REST-support-with-URI-Params

[Detailed Tutorial] Using event channels and strongly typed event bus with QBit (The employee example)

https://github.com/advantageous/qbit/wiki/%5BDetailed-Tutorial%5D-Using-event-channels-and-strongly-typed-event-bus-with-QBit-(The-employee-example)



Sunday, March 29, 2015

3-29-15

examples and related work:

[Quick Start] Using event channels and strongly typed event bus with QBit (The employee example)
done



-----------------------------------------------------------

Link
[Quick Start] Using event channels and strongly typed event bus with QBit (The employee example)

https://github.com/advantageous/qbit/wiki/%5BQuick-Start%5D-Using-event-channels-and-strongly-typed-event-bus-with-QBit-(The-employee-example)

Saturday, March 28, 2015

3-28-15

Working on examples and related readings/work:


[Detailed Tutorial] Using QBit's Event Bus System (The Employee example)

[Quick Start] Using QBit's Event Bus System (The Employee example)


-------------------------------------------------------------


Links
[Detailed Tutorial] Using QBit's Event Bus System (The Employee example)
https://github.com/advantageous/qbit/wiki/%5BDetailed-Tutorial%5D-Using-QBit's-Event-Bus-System-(The-Employee-example)


[Quick Start] Using QBit's Event Bus System (The Employee example)
https://github.com/advantageous/qbit/wiki/%5BQuick-Start%5D-Using-QBit's-Event-Bus-System-(The-Employee-example)

Friday, March 27, 2015

3-27-15

Readings:

Java Microservices Architecture

Working with Event Channels and strongly typed event bus with the QBit Microservice Java, JSON, WebSocket Lib


Preping for another example (Event Channels) 

---------------------------------------------------------

Java Microservices Architecture (good article)

http://rick-hightower.blogspot.com/2015/03/java-microservices-architecture.html

Working with Event Channels and strongly typed event bus with the QBit Microservice Java, JSON, WebSocket Lib

http://rick-hightower.blogspot.com/2015/03/working-with-event-channels-and.html

Thursday, March 26, 2015

3-26-15

More readings on spring boot 

Working on examples...

[Detailed Tutorial] Using QBit Microservice lib with Spring Boot
is done


-------------------------------------------------------------

link for 
[Detailed Tutorial] Using QBit Microservice lib with Spring Boot

https://github.com/advantageous/qbit/wiki/%5BDetailed-Tutorial%5D-Using-QBit-Microservice-lib-with-Spring-Boot

Wednesday, March 25, 2015

3-25-15

Submitted an article to dzone 

working on more examples

reading about spring boot....

more on servlets......

--------------------------------------------------------

Dzone article link http://www.dzone.com/links/qbit_is_not_only_fast_but_it_is_also_very_easy_to.html


http://www.tutorialspoint.com/servlets/servlets-overview.htm
Servlets Tasks:

Servlets perform the following major tasks:


Read the explicit data sent by the clients (browsers). This includes an HTML form on a Web page or it could also come from an applet or a custom HTTP client program.


Read the implicit HTTP request data sent by the clients (browsers). This includes cookies, media types and compression schemes the browser understands, and so forth.


Process the data and generate the results. This process may require talking to a database, executing an RMI or CORBA call, invoking a Web service, or computing the response directly.


Send the explicit data (i.e., the document) to the clients (browsers). This document can be sent in a variety of formats, including text (HTML or XML), binary (GIF images), Excel, etc.


Send the implicit HTTP response to the clients (browsers). This includes telling the browsers or other clients what type of document is being returned (e.g., HTML), setting cookies and caching parameters, and other such tasks.



Servlets Packages:

Java Servlets are Java classes run by a web server that has an interpreter that supports the Java Servlet specification.

Servlets can be created using the javax.servlet and javax.servlet.http packages, which are a standard part of the Java's enterprise edition, an expanded version of the Java class library that supports large-scale development projects.

These classes implement the Java Servlet and JSP specifications. At the time of writing this tutorial, the versions are Java Servlet 2.5 and JSP 2.1.

Java servlets have been created and compiled just like any other Java class. After you install the servlet packages and add them to your computer's Classpath, you can compile servlets with the JDK's Java compiler or any other current compiler.

Tuesday, March 24, 2015

3-24-15

Working on examples 

finalizing the article for dzone



--------------------------------------------------------


[Quick Start] Using QBit Microservice lib with Spring Boot

https://github.com/advantageous/qbit/wiki/%5BQuick-Start%5D-Using-QBit-Microservice-lib-with-Spring-Boot


dzone article on http://qbitboon.blogspot.com/ still needs some work

Monday, March 23, 2015

3-23-15

Working on examples and reading posts Rick's blog.



reread worker pools and sharded workers 




working on the rest server with URI param example a simple issue came up  

some info on Spring boot 

working on the spring boot example.




----------------------------------------------------------

Simple rest server  with URI params example, when i run it i get a lot of unnecessary outputs on the console, trying to fix it.


http://rick-hightower.blogspot.com/
Some services are CPU intensive ones and you tend to want to shard them to utilize all of your CPU cores (Sharded workers). Some services need to talk to other services on the other side of a bus (Kafka, WebSocket) or REST, or perhaps talk to a database, these IO services tend to want to be pooled (worker pool). QBit supports all of these models and in fact provides an interface so you can decide how to dispatch to a service.

Spring boot

a tool to get started with soring very quickly

exposes a lot of useful features by default

focuses attention at a single point as oppsed to a large collection of spring projects


for example a spring MVC app needs a servlet container; Spring Boot automatically configures embedded Tomcat.


Got Jetty? If so, you probably do NOT want Tomcat, but instead embedded Jetty. Spring Boot handles that for you.


Got Thymeleaf? There are a few beans that must always be added to your application context; Spring Boot adds them for you.

Sunday, March 22, 2015

3-22-15



Examples done:


[Detailed Tutorial] Building a HTTP server with WebSocket support using QBit (very easy)


[Quick Start] Building a HTTP server with WebSocket support using QBit (very easy)





prepping for new once as well.

-------------------------------------------------------

links for the examples:

https://github.com/advantageous/qbit/wiki/%5BDetailed-Tutorial%5D-Building-a-HTTP-server-with-WebSocket-support-using-QBit--(very-easy)

https://github.com/advantageous/qbit/wiki/%5BQuick-Start%5D-Building-a-HTTP-server-with-WebSocket-support-using-QBit--(very-easy)

Saturday, March 21, 2015

3-21-15

article to dzone done:

QBit is not only fast; but it is also easy to use. 

link will posted in the future.

Thursday, March 19, 2015

3-19-15

working on examples...


[Detailed Tutorial] Building a simple recommendation engine with QBit (CallBack nonBlocking)


[Quick Start] Building a simple recommendation engine with QBit (CallBack nonBlocking)


Reading :
Using Consul from QBit, the Java, JSON, WebSocket and REST microservice library, for health monitoring, clustering and service discovery
http://rick-hightower.blogspot.com/2015/03/using-consul-from-java-for-qbit.html




-------------------------------------------------------

the links for these example are below:

https://github.com/advantageous/qbit/wiki/%5BQuick-Start%5D-Building-a-simple-recommendation-engine-with-QBit-(CallBack-nonBlocking)

https://github.com/advantageous/qbit/wiki/%5BDetailed-Tutorial%5D-Building-a-simple-recommendation-engine-with-QBit-(CallBack-nonBlocking)


Wednesday, March 18, 2015

3-18-15

Working on examples...



[Quick Start] Building a simple recommendation engine with QBit (CallBack Blocking)


[Detailed Tutorial] Building a simple recommendation engine with QBit (CallBack Blocking)





-------------------------------------------------

Here are the links for these examples:

https://github.com/advantageous/qbit/wiki/%5BQuick-Start%5D-Building-a-simple-recommendation-engine-with-QBit-(CallBack-Blocking)

https://github.com/advantageous/qbit/wiki/%5BDetailed-Tutorial%5D-Building-a-simple-recommendation-engine-with-QBit-(CallBack-Blocking) 

code for this example was broken now it is working.

Tuesday, March 17, 2015

3-17-15

All QBit example are up to date and working with QBit version = 0.7.2


continue where i left off yesterday 

Mechanical sympathy - key points.


1) RAM is the new Disk.
2) Disk is the new tape back up.


3) Context switching is slow, L1, L2 cache misses are a bear


4) High-speed = running more things in one thread, less threads = more speed
5) Ways to do #4 Akka, QBit, Vertx, Node.js
6) Node.js does not scale out well (great for small, medium apps)

7) Pure Reactive does not work well with server-side apps, you need a mix
8) Reactive + Worker pools = Vertx, QBit

9) Java wins the server-side dev speed stack. Beats Go, Rust, etc.
10) Java is SLOW at SSL
11) Terminate SSL at ha_proxy, NginX, etc. 

12) Data safety = REPLICATION not transaction
13) Things are cheaper done in batches especially IO

-------------------------------------------------

All examples are working now with QBit version 0.7.2:

todo-service
todo-service-websacket-client
simple-rest-server
inproc-microservice-qbit
hello app
todo-list-app




High-speed = running more things in one thread

processes/threads are:
-CPU bound (needs lots of CPU resources)
-Memory bound (needs lots of RAM resources)
-I/O bound (Network and/or hard drive resources)


All of these resources are finite so using multiple threads could be very costly.

Ways to run things in one thread is via Akka, QBit, Vertx, Node.js

There many platfoms/ libraries that implement run thing via a single thread to run faster:

AKKA
QBit
Vertx
Node.js

Node.js: 
Node.js operates on a single thread, using non-blocking I/O calls, allowing it to support tens of thousands of concurrent connections, without worrying about the cost of context-switching between threads. The design of sharing a single thread between all the requests means it can be used to build highly concurrent applications. The design goal of a Node.js application is that any function performing I/O must use a callback.

A downside of this approach is that Node.js doesn't allow scaling with the number of CPU cores of the machine it is running on.

7) Pure Reactive does not work well with server-side apps, you need a mix
8) Reactive + Worker pools = Vertx, QBit

http://en.wikipedia.org/wiki/Reactive_programming

In computing, reactive programming is a programming paradigm oriented around data flows and the propagation of change. This means that it should be possible to express static or dynamic data flows with ease in the programming languages used, and that the underlying execution model will automatically propagate changes through the data flow.


For example, in a Model-view-controller architecture, reactive programming can allow changes in the underlying model to automatically be reflected in the view, and vice versa.

http://en.wikipedia.org/wiki/Thread_pool_pattern

n computer programming, the thread pool pattern ( worker pools) is where a number of threads are created to perform a number of tasks, which are usually organized in a queue. The results from the tasks being executed might also be placed in a queue, or the tasks might return no result. Typically, there are many more tasks than threads. As soon as a thread completes its task, it will request the next task from the queue until all tasks have been completed. The thread can then terminate, or sleep until there are new tasks available.

The number of threads used is a parameter that can be tuned to provide the best performance. Additionally, the number of threads can be dynamic based on the number of waiting tasks.

9) Java wins the server-side dev speed stack. Beats Go, Rust, etc.
10) Java is SLOW at SSL
11) Terminate SSL at ha_proxy, NginX, etc.



HAProxy is a free, open source high availability solution, providing load balancing and proxying for TCP and HTTP-based applications by spreading requests across multiple servers. It is written in C and has a reputation for being fast and efficient (in terms of processor and memory usage).


Nginx is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer, HTTP cache, and a web server(origin server). The nginx project started with a strong focus on high concurrency, high performance and low memory usage.

Nginx can be deployed to serve dynamic HTTP content on the network using FastCGI, SCGI handlers for scripts, WSGI application servers or Phusion Passenger module, and it can serve as a software load balancer.

12) Data safety = REPLICATION not transaction
13) Things are cheaper done in batches especially IO

Monday, March 16, 2015

3-16-15

Mechanical sympathy - key points.


1) RAM is the new Disk.
2) Disk is the new tape back up.


3) Context switching is slow, L1, L2 cache misses are a bear


4) High-speed = running more things in one thread, less threads = more speed
5) Ways to do #4 Akka, QBit, Vertx, Node.js
6) Node.js does not scale out well (great for small, medium apps)

7) Pure Reactive does not work well with server-side apps, you need a mix
8) Reactive + Worker pools = Vertx, QBit

9) Java wins the server-side dev speed stack. Beats Go, Rust, etc.
10) Java is SLOW at SSL
11) Terminate SSL at ha_proxy, NginX, etc. 

12) Data safety = REPLICATION not transaction
13) Things are cheaper done in batches especially IO


Updating qbit examples to work with version 0.7.2

----------------------------------------------------------
http://www.infoq.com/news/2008/06/ram-is-disk 
great article...

Jim Gray, a man who has contributed greatly to technology over the past 40 years, is credited with saying that memory is the new disk and disk is the new tape. With the proliferation of "real-time" web applications and systems that require massive scalability, how are hardware and software relating to this meme?

M]emory is several orders of magnitude faster than disk for random access to data (even the highest-end disk storage subsystems struggle to reach 1,000 seeks/second). Second, with data-center networks getting faster, it’s not only cheaper to access memory than disk, it’s cheaper to access another computer’s memory through the network.

flash forward two years and we find that the trend in hardware advances has continued for RAM and network and stayed slow for disk.

Memory is the new disk! With disk speeds growing very slowly and memory chip capacities growing exponentially, in-memory software architectures offer the prospect of orders-of-magnitude improvements in the performance of all kinds of data-intensive applications. Small (1U, 2U) rack-mounted servers with a terabyte or more or memory will be available soon, and will change how we think about the balance between memory and disk in server architectures. Disk will become the new tape, and will be used in the same way, as a sequential storage medium (streaming from disk is reasonably fast) rather than as a random-access medium (very slow). Tons of opportunities there to develop new products that can offer 10x-100x performance improvements over the existing ones.

cache - overview 

http://en.wikipedia.org/wiki/CPU_cache


When the processor needs to read from or write to a location in main memory, it first checks whether a copy of that data is in the cache. If so, the processor immediately reads from or writes to the cache, which is much faster than reading from or writing to main memory.

Most modern desktop and server CPUs have at least three independent caches: an instruction cache to speed up executable instruction fetch, a data cache to speed up data fetch and store, and a translation look aside buffer (TLB) used to speed up virtual-to-physical address translation for both executable instructions and data. The data cache is usually organized as a hierarchy of more cache levels (L1, L2, etc..)




Data is transferred between memory and cache in blocks of fixed size, called cache lines. When a cache line is copied from memory into the cache, a cache entry is created. The cache entry will include the copied data as well as the requested memory location (now called a tag).

When the processor needs to read or write a location in main memory, it first checks for a corresponding entry in the cache. The cache checks for the contents of the requested memory location in any cache lines that might contain that address. If the processor finds that the memory location is in the cache, a cache hit has occurred. However, if the processor does not find the memory location in the cache, a cache miss has occurred. In the case of:

- a cache hit, the processor immediately reads or writes the data in the cache line
- a cache miss, the cache allocates a new entry and copies in data from main memory, then the request is fulfilled from the contents of the cache.

Context switching

http://en.wikipedia.org/wiki/Context_switch

a context switch is the process of storing and restoring the state (context) of a process or thread so that execution can be resumed from the same point at a later time. This enables multiple processes to share a single CPU and is an essential feature of a multitasking operating system. What constitutes the context is determined by the processor and the operating system.

Context switches are usually computationally intensive, and much of the design of operating systems is to optimize the use of context switches. Switching from one process to another requires a certain amount of time for doing the administration – saving and loading registers and memory maps, updating various tables and lists etc.



High-speed = running more things in one thread



continue from here.....

Tuesday, March 10, 2015

3-10-15

Qbit works now with Consul; what is consul?


Qbit works with jetty; what is Jetty?

-----------------------------------------------------------

What is Consul?



all notes are from this link https://www.consul.io/intro/index.html 


It is a tool for discovering and configuring services in your infrastructure. It provides several key features:


Service Discovery: Clients of Consul can provide a service, such as api or mysql, and other clients can use Consul to discover providers of a given service. Using either DNS or HTTP, applications can easily find the services they depend upon.


Health Checking: Consul clients can provide any number of health checks, either associated with a given service ("is the webserver returning 200 OK"), or with the local node ("is memory utilization below 90%"). This information can be used by an operator to monitor cluster health, and it is used by the service discovery components to route traffic away from unhealthy hosts.


Key/Value Store: Applications can make use of Consul's hierarchical key/value store for any number of purposes, including dynamic configuration, feature flagging, coordination, leader election, and more. The simple HTTP API makes it easy to use.


Multi Datacenter: Consul supports multiple datacenters out of the box. This means users of Consul do not have to worry about building additional layers of abstraction to grow to multiple regions.


To install and get started with consul visit this link https://www.consul.io/intro/getting-started/install.html


What is Jetty?

Jetty is a Java HTTP (Web) server and Java Servlet container. While Web Servers are usually associated with serving documents to people, Jetty is now often used for machine to machine communications, usually within larger software frameworks. Jetty is developed as a free and open source project as part of the Eclipse Foundation. Jetty supports the latest Java Servlet API (with JSP support) as well as protocols SPDY and WebSocket.

Monday, March 9, 2015

3-9-15

Some of QBit's inspiration:

-AKKA
-Go Channels 
-Active Objects
-Apartment Model threading
-Actor
-Mechanical sympathy
-LMAX Disruptor
-Link transfer queue vs disruptor
-Work done by Tim Fox on Vertx

continued....
-----------------------------------------------------------

LMAX Disruptor

LMAX is a java trading platform that aims to be the fastest in the world. In order to achieve this they needed to do something to achieve very low-latency and high-throughput with their Java platform. Performance testing showed that using queues to pass data between stages of the system was introducing latency, so they focused on optimizing this area.


The Disruptor is the result of their research and testing. they found that cache misses at the CPU-level, and locks requiring kernel arbitration are both extremely costly, so they created a framework which has "mechanical sympathy" for the hardware it's running on, and that's lock-free.

This is not a specialist solution, it's not designed to work only for a financial application. The Disruptor is a general-purpose mechanism for solving a difficult problem in concurrent programming.

It works in a different way to more conventional approaches, so you use it a little differently than you might be used to. For example, applying the pattern to your system is not as simple as replacing all your queues with the magic ring buffer.

very good video to introduce this idea found here http://www.infoq.com/presentations/LMAX



Link transfer queue vs disruptor


One of the important components of a concurrent multithreaded system, distributed computing or otherwise, is the inter-thread messaging component. This link (http://php.sabscape.com/blog/?p=557) has a study that compares the performance of each of the following

Synchronized
ArrayBlockingQueue
LinkedTransferQueue
Disruptor

This study shows pretty much that the disruptor has the best performance along with TransferQueue.


Saturday, March 7, 2015

3-7-15

Some of QBit's inspiration:

-AKKA
-Go Channels 
-Active Objects
-Apartment Model threading
-Actor
-Mechanical sympathy
-LMAX Disruptor
-Link transfer queue vs disruptor
-Work done by Tim Fox on Vertx

-----------------------------------------------------------
AKKA

AKKA toolkit promise is to make building powerful concurrent and distributed applications more easy.
-AKKA-actors (integration within one machine)
-AKKA remoting and AKKA cluster (integrate between more then one machine withing your suc-system) 
-AKKA-HTTP (integration between systems outside you control.

AKKA uses the Actor Model to raise the abstraction level and provide a better platform to build correct, concurrent, and scalable applications.
AKKA adopts the "Let it crash" model (for fault tolerance) which the telecom industry has used with great success to build applications that self-heal and systems that never stop. 
Actors also provide the abstraction for transparent distribution and the basis for truly scalable and fault-tolerant applications.

Go Channels

Go is a programing language that was implemented mainly to make things faster (compiling, building etc..), type-safe and memory-safe, good support for concurrency and communication, and efficient latency-free garbage collection
https://www.youtube.com/watch?v=rKnDgT73v8s
this youtube video is a good intro to the Go language. let's move on to Go Channels.

There are two core Go features that make Go stand out: go routines and channels. Combined, goroutines and channels are Go's take on concurrency. We can think of goroutines as threads.

A channel is used to communicate between goroutines. They can be used to signal or pass data around. Anyone familiar with traditional thread-based programming knows the pain associated with sharing data. You have to carefully manage locks around data, avoiding deadlocks and avoiding serializing your threads. With channels, only one goroutine ever has access to a piece of data at a given time. There's no locking, only communication.

Consider a phone conversation. It can be difficult to coordinate who should talk, especially as more people get added to the conversation. It isn't uncommon for two people to speak at once. Conversly, it also isn't uncommon for one person to do all the talking and not let the others participate. This, to me, is what thread-based programming is like. Channels on the other hand, are more like passing notes in class. Coordination is strictly controlled by the act of passing the note to someone. There's simply no way for you and your friend to write on the same note at the same time.

channels are created with "make". A channel is created to pass a specific type. For example, we can create a channel of integers like so:

c := make(chan int, 1)

This is creating a channel that can be used to pass integers between goroutines. The1 tells us that our channel has 1 value to pass around. This is known as a buffered channel.

Active Objects

challenge: invoke a method in another thread

problem: methods invoked on an object concurrently do not block the entire process
make access to these object easy and intuitive 

solution is to use the active object which decouples method execution from method invocation for objects that each reside in their own thread of control.

You can have multiple clients requests running concurrently on a object.
https://www.youtube.com/watch?v=U9Tf7h-etl0 this video is a good intro to active objects.

Apartment Model Threading 

STA (single-threaded apartment) and MTA (multi-threaded apartment) are to do with Component Object Model (COM) components can be designed to be accessed by a single thread, in which case it they are hosted in an STA, or they can be made internally thread safe, and hosted in an MTA. A process can have only one MTA, but many STAs. If you're only going to consume COM components all that you really need to know is that you have to match the apartment to the component or nasty things will happen.

Actor Model

this video is a good intro to actor model https://www.youtube.com/watch?v=enJtcusvpzc


The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation: in response to a message that it receives, an actor can make local decisions, create more actors, send more messages, and determine how to respond to the next message received. 

Electronic mail (e-mail) can be modeled as an Actor system. Accounts are modeled as Actors and email addresses as Actor addresses.


continued ....

Tuesday, March 3, 2015

3-3-15

compiling process of java




Reading about microservices 
http://martinfowler.com/articles/microservices.html


-----------------------------------------------------

Let's say you have a main calling 2 functions:
f1()
f2()
stored in a file called main.java

f1() is stored in f1.java
f2() is stored in f2.java

the compiler will compile the 3 files and produce .class files which consists of the byte code.

There is a JVM residing onto RAM during execution using a class loader the class files are brought on the RAM, then the byte code is verified for any security breaches then the execution engine will convert the code into native machine code so you PC will understand them. 


MICROSERVICES



The microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies.


Enterprise Applications are often built in three main parts: a client-side user interface (consisting of HTML pages and javascript running in a browser on the user's machine) a database (consisting of many tables inserted into a common, and usually relational, database management system), and a server-side application. The server-side application will handle HTTP requests, execute domain logic, retrieve and update data from the database, and select and populate HTML views to be sent to the browser. This server-side application is a monolith - a single logical executable. Any changes to the system involve building and deploying a new version of the server-side application.

Monolithic applications can be successful, but increasingly people are feeling frustrations with them - especially as more applications are being deployed to the cloud . Change cycles are tied together - a change made to a small part of the application, requires the entire monolith to be rebuilt and deployed. Over time it's often hard to keep a good modular structure, making it harder to keep changes that ought to only affect one module within that module. Scaling requires scaling of the entire application rather than parts of it that require greater resource.

there's been a desire to build systems by plugging together components, a component is a unit of software that is independently replaceable and upgradeable.

Microservice architectures will use libraries, but their primary way of componentizing their own software is by breaking down into services.

we can observe that services map to runtime processes, but that is only a first approximation. A service may consist of multiple processes that will always be developed and deployed together, such as an application process and a database that's only used by that service.

The microservice community favours an alternative approach: smart endpoints and dumb pipes. Applications built from microservices aim to be as decoupled and as cohesive as possible - they own their own domain logic and act more as filters in the classical Unix sense - receiving a request, applying logic as appropriate and producing a response. These are choreographed using simple RESTish protocols rather than complex protocols such as WS-Choreography or BPEL or orchestration by a central tool.

In a monolith, the components are executing in-process and communication between them is via either method invocation or function call. The biggest issue in changing a monolith into microservices lies in changing the communication pattern. A naive conversion from in-memory method calls to RPC leads to chatty communications which don't perform well. Instead you need to replace the fine-grained communication with a coarser -grained approach.

microservices also decentralize data storage decisions. While monolithic applications prefer a single logical database for persistant data, enterprises often prefer a single database across a range of applications - many of these decisions driven through vendor's commercial models around licensing. Microservices prefer letting each service manage its own database, either different instances of the same database technology, or entirely different database systems - an approach called Polyglot Persistence. You can use polyglot persistence in a monolith, but it appears more frequently with microservices.

A consequence of using services as components, is that applications need to be designed so that they can tolerate the failure of services. Any service call could fail due to unavailability of the supplier, the client has to respond to this as gracefully as possible. This is a disadvantage compared to a monolithic design as it introduces additional complexity to handle it.

With a monolith any changes require a full build and deployment of the entire application. With microservices, however, you only need to redeploy the service(s) you modified. This can simplify and speed up the release process. The downside is that you have to worry about changes to one service breaking its consumers.

Monday, March 2, 2015

3-2-15

I found no clear tutorial/content on the web to teach you how to publish a gitbook on github, they all assume you have some sort of prior knowledge. Here will explain a way to do it, after stumbling on it for hours. 


finished and published the initial qbit wiki book at http://fadihub.github.io/qbit-wiki-book/


-----------------------------------------------------------

There many ways to do it, i found this to be the easiest:

-Create a repo on github.

-Create a branch called gh-pages this is where you will host your page, if you name it differently it won't work.

-Install npm here is a link to help with the instalation http://blog.npmjs.org/post/85484771375/how-to-install-npm

-Using npm istall gitbook with the following command on your terminal npm install gitbook.

-Download gitbook editor from here https://github.com/GitbookIO/editor/releases.

-Using the editor open an empty folder to create a new book.

-Write your content on the editor

-With your terminal gitbook publish.

-cd into ~/_book and push it onto gh-pages branch on github.

-Then you can view your page on yourUsername.github.io/yourRepoName

this quick tutorial assumes you know how to use github (pushing pulling etc....)

  

Sunday, March 1, 2015

3-1-15

To host a website on github with your username.


more about gitbook...



----------------------------------------------------------


git init is used to start using git on a project that's not under git.
you can manually configure a repo set up with git init to connect to a remote.
The .git folder manages your project's repo. Git doesn't run as a server. Instead the .git folder acts as your local 'server' that all the git commands communicate with. Basically, running a git command edits the contents of the .git folder.



To host a website on git hub create a branch called gh-pages and push the necessary files there then you can access the page on http://username.github.io/repoName/


to change between branches git checkout branchName

to create a new branch git checkout -b branchName