Tuesday, February 11, 2020

Containerization via Docker. - Howto - Whento - WhenNotto

Over previous few days was taking a look at this technology.
Clearly it gives some benefits and could easily foresee this drawbacks, in enterprise applications which involve distributed data and their is a clear and definitive need for data replication/synchronicity

Here are good links, if you have to review some readings

HOW TO 
http://jasonwilder.com/blog/2014/10/13/a-simple-way-to-dockerize-applications/ 

Good usecases this solves
WHEN TO 
https://www.airpair.com/docker/posts/8-proven-real-world-ways-to-use-docker

Drawbacks/Concerns in containerizing database
WHEN NOT TO
https://vsupalov.com/database-in-docker/
https://www.channelfutures.com/open-source/when-not-to-use-docker-understanding-the-limitations-of-containers

Good qoutes
"..Docker is also not necessarily a great packaging system either. You can make something that will run on many Linux distributions but it wont be fast, efficient nor guaranteed to be entirely compatible..."

"..you can end up shipping something that as an RPM would be 10KB, becomes 100MB using docker."


Now also like to say Google search page gives this info quick on hit page with
Keyword
"drawbacks for dockerization in distributed databases application"
Enjoy

Here are just some of the use cases that provide a consistent environment at low overhead with the enabling technology of Docker.
  • Simplifying Configuration. ...
  • Code Pipeline Management. ...
  • Developer Productivity. ...
  • App Isolation. ...
  • Server Consolidation. ...
  • Debugging Capabilities. ...
  • Multi-tenancy.
Here are examples of things Docker can't do or can't do well:
  1. Run applications as fast as a bare-metal server. Docker containers have less overhead than virtual machines. ...
  2. Provide cross-platform compatibility. ...
  3. Run applications with graphical interfaces. ...
  4. Solve all your security problems.
Popularity & Benefits of Using Docker
  • Return on Investment and Cost Savings. The first advantage of using docker is ROI. ...
  • Standardization and Productivity. ...
  • CI Efficiency. ...
  • Compatibility and Maintainability. ...
  • Simplicity and Faster Configurations. ...
  • Rapid Deployment. ...
  • Continuous Deployment and Testing. ...
  • Multi-Cloud Platforms.
Until next time..







Saturday, February 8, 2020

Microservices -- Orchestration in distributed systems - challenges


A good write up by Bernd Bucker  @ Camunda
https://www.youtube.com/watch?v=GPgOeK-QytA 
A good write up in whitepaper format 
https://thenewstack.io/5-workflow-automation-use-cases-you-might-not-have-considered/

My Work around this time line
- Automated provisioning platform 

Most of these challenges, were thought off , implemented using Spring technologies
- Centralized database workflow tables tracking status of request   (be it synchronous or asynchronous , bulk or single )
- In -memory database structures for Spring boot actuators metrics
- Logging onto to filesystem in standard format at every point in execution
  (checks, validations, external system interactions )

The SRD was indeed drafted in BPMN notation and signed off  by PO in communication with client.


Wednesday, September 25, 2019

Evolution of 'java.util.Date' to 'java.time.Instant' considering date/time format specifier and timezones

Java API for datetime formatters have evolved as well
from
import java.util.Date
import java.util.Calendar;
and
import java.text.SimpleDateFormat;
import java.text.DateFormat;

to
import java.time.format.DateTimeFormatter;

Traditional code style


    public Timestamp convertStringToTimestamp(String str_date) {
       
        try {
            DateFormat formatter;
            formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
            Date date = (Date) formatter.parse(str_date);

            java.sql.Timestamp timeStampDate = new Timestamp(date.getTime());

            return timeStampDate;
        } catch (ParseException e) {
            logger.error("Exception happened here:" + e);
            return null;
        }
    }


OR

        // Must create new SimpleDateFormat and TimeZone on each method invocation since neither of these classes are thread-safe.
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX");
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
        return simpleDateFormat.format(new Timestamp(System.currentTimeMillis()));
       
Sample Output
2019-09-25T10:07:19.839Z
       

Database timestamp impendence was always there

import java.sql.Timestamp;


Newer style


private static final DateTimeFormatter TIMESTAMP_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX");
..
    public static String getCurrentTimestamp() {
        // No need to create new DateTimeFormatter or ZoneOffset on each method invocation since both of these classes are thread-safe.
        return TIMESTAMP_FORMATTER.format(OffsetDateTime.now().withOffsetSameInstant(ZoneOffset.UTC));
    }
..

Sample Output
2019-09-25T10:07:19.839Z

Plz Note: Observe the use of new formatter class (s)

import java.time.OffsetDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;


   
   
Next Generation Compact Style


import java.time.Instant;
..
System.out.println(Instant.now());


   
Sample Output
2019-09-25T10:07:19.839Z    


Non-Blocking/Asynchronous API(s) using Java 8 and above


A Good Style of explaining the evolution of Java API(s) to achieve Concurrency.

https://www.callicoder.com/java-concurrency-multithreading-basics/


Analogy/Use Scenario Visualization:
(*) If you are core busniess layer, who need to integrate with legacy Java components ( which are the actual workhorses ) and you are being called from upstream busniess layers, there is always a need for Asynchronous invocation.
This is where following article

https://www.callicoder.com/java-8-completablefuture-tutorial/
best explains concepts

Prerequistie : Java Lamba familarity, Supplier , Consumer , functional interfaces in Java 

Other Analogies:
1) SwingWorker in old AWT/applet kind of application 
2) Promise in JavaScript 
3) Work delegation and collating back (Typical Manager) 



Tuesday, March 20, 2018

Writing Application code is getting harder in the Software Industry

In 1990s
Write code to meet basic functionality.
* Optional to consider other software attributes
You were done.

In 2000s
Write code to meet basic functionality, using a MVC framework, so that extending/enhancing is modular and easy.
Are they platform independent and run on any browsers ?
* Optional to consider other software attributes
You were done.


In 2010s
Write code to meet basic functionality, using a MVC framework, so that extending/enhancing is modular and easy.
Are they platform independent and run on any browsers ?
Is application Web Security Compliant ?
Is application Internationalization Compliant ?
Is application Accessibility Compliant ?
+ Mandatory to consider other software attributes
You were done.


In 2020s
Write code to meet basic functionality, using a MVC framework, so that extending/enhancing is modular and easy.
Are they platform independent and run on any browsers ?
Is application Web Security Compliant ?
Is application Internationalization Compliant ?
Is application Accessibility Compliant ?
Is use scenarios Automated for testing ?
Is use scenarios Compliant for machine learning  ?
+ Mandatory to consider other software attributes
You were done.

So, your simple 'Hello World' or 'addition' program will mean a lot for getting it done, what it took 40 years ago.

Wednesday, September 6, 2017

Designing a database for multi-tenancy on the cloud

https://www.codeproject.com/Articles/51334/Multi-Tenants-Database-Architecture
https://purikl.wordpress.com/
https://msdn.microsoft.com/en-us/library/aa479086.aspx#mlttntda_topic1



https://www.codeproject.com/Articles/3435/Secure-Architecture-Design-Methodologies
https://www.codeproject.com/Articles/16105/A-Practical-Approach-to-Computer-Systems-Design-an



https://www.codeproject.com/Articles/124732/Software-Development-Methodologies


Followers