Saturday, 18 October 2014

How Java Developers can get started MongoDB?

About MongoDB (from wikipedia) - In case you don't know what it is, then MongoDB (from "humongous") is a free and open-source cross-platform document-oriented database software. Classified as a NoSQL database, MongoDB avoids the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas (MongoDB calls the format BSON), making the integration of data in certain types of applications easier and faster.  It provides high performance, high availability, and easy scalability.

From java developers outlook - If MongoDB is deliberated to persist some or all data in java based application architecture, then java developers need to write java code in data access layer of application to perform CRUD and other operations with MongoDB backend using Java MongoDB Driver API or may be Spring Data MongoDB (just imagine this something like writing JDBC code to exchange data between JavaEE app and RDBMS). --- On a separate note, are you aware about the term polyglot persistence describing hybrid approach to persistence by using different data storage technologies to handle varying data persistence needs!

M101J Course: MongoDB for Java Developers

Speaking of MongoDB, recently I got opportunity to attend "M101J: MONGODB FOR JAVA DEVELOPERS" course which is a free 7 weeks online course and expects attendees to spend 6-8 hours per week as per the designed course agenda. The course delivers everything java developers need to know for getting started with building a MongoDB-based java application, which includes basic MongoDB installation, JSON, schema design, crud operations, indexing, aggregation framework, application engineering  and working with MongoDB java language drivers. The data interaction between Java app and MongoDB is practically demonstrated by building a java based blogging platform, backed by MongoDB. Moreover, one will receive a certificate of M101J course completion at the end, if achieves a 65% or above on graded material.

As a matter of fact, the quality of M101J is elegant and specially designed for java developers to get started with MongoDB. If you wish to learn MongoDB or don't have exposure of any of NoSQL database, then I highly endorse to register and attend this course.

Self-paced Getting Started with MongoDB

In case you can't manage to accomplish the M101J course, then you can get started with MongoDB as below.

Firstly I suggest to go through MongoDB@TutorialsPoint course to get fair understanding of MongoDB. Don't just read, but also try practically as you progress.

Once you become familiar with MongoDB, then I suggest to refer the sample java code snippet used in the M101J course. For this, you can setup M101J java project and explore code as below.

  1. Download / Clone "MongoDB-ForJavaApp/M101J" project to your local machine from GitHub. 
  1. Import "M101J" project in Eclipse. Fix build path errors, such as JRE configuration. This is maven based project, so it would download dependent jar files from internet.
  1. Ensure MongoD process is running.
  2. Go to "com.tengen.helloworld" package in "src/main/java" folder of the project. As per "README.md" file, create "hello" collection and insert data. Now see code of "HelloWorldMongoDBStyle.java" and run it; which should connect to "course" db in MongoDB, get data from "course" collection and finally print on console. The other hello world programs in this folder are to demo basic usage of freemarker (templating engine) and spark (micro web framework which allows to setup routes for mapping urls and having embedded Jetty) frameworks, which are used to build frontend templates and controller components of blogging app tutorial. For example - just run "HelloWorldMongoDBSparkFreemarkerStyle.java" program and access "http://localhost:8082" url in the browser, so it would fetch data from MongoDB and show on browser page.
  3. Go to "com.tengen.crud" package in "src/main/java" folder of the project to explore java code for Mongo crud operations.
  4. Finally explore sample blogging application.
    • How to run it?
      • Ensure MongoDB instance "mongodb://localhost" is up and running, otherwise you may need to change default configuration is in BlogController.java.
      • Run BlogController.java as java application or using maven command. This would run it on HTTP 8082 port using Spark framework.
      • Now you should be able to access it in browser using this URL "http://localhost:8082/" and can play with the blogging application functionality.

Also Refer

Saturday, 13 September 2014

Excellent resources to expedite your Software Architecture Skills

When I started my career as a "Trainee Developer", I was fascinated about just java coding, coding and coding... Then I learned fundamentals and principles of OOP Design and few more programming languages... As I grown my experience in software development and design; I started to get opportunities to grasp architecture of legacy systems, create architecture for proposed applications, envision high level architecture for proposals, analyze architecture and NFRs… And yeah, building architectural proficiency looks like a long journey!

In this post, I am publishing list of my favorite online resources which helping me during the journey of building my software architectural know-how. 

On a separate note,


I am greatly thankful to below mentioned assets and also endorse them for building proficiency in software architecture.

Microsoft Application Architecture Guide

Even though it is for Mocrosoft Application Architecture; the explained fundamentals, guidelines and practices of software architecture and design  is also applicable for Java Platform based Application Architecture. I simply love it! Also Architecture 101: Skyscrapr has interesting articles covering architectural perspective.




Software Architecture in Practice by Len Bass, Paul C. Clements, Rick Kazman

One would find "SoftwareArchitecture in Practice, Third Edition" to be a valuable resource for getting up to speed on the state of the art; when need to design, develop, or manage large software systems (or plan to do so). From this book, one would learn how to envision, create and analyze architectures using provided case studies and some of SEI methods explained in the book. 

One needs to purchase this book, however its second edition is available online.




Software Architecture Documentation Case Studies by SEI Wiki

The known architecture description styles are  ISO/IEC 42010 (an international standard for architecture descriptions of systems and software) / 4+1 Architectural View Model / Views and Beyond: The SEI Approach to ArchitectureDocumentation.

But for newbies to software architecture documentation, the case studies on SEI Wiki is great place to start containing the sample architecture documentation of the "Adventure Builder" and the "Java Pet Store" applications.


On a separate note,
  • One would need to understand UML, when it comes to Architecture documentation. If you don't know UML, then see http://www.uml-diagrams.org/


97 Things Every Software Architect Should Know

Great compilation of things which every software architect should know, and also published as a book by Oreilly.




Architectural Posts

Apart from systematic approach of building architectural skills, one should develop habit of exploring architectural experiences shared by intelligentsia. There are many resources for reading architectural posts, but my favorite are highscalability.com and infoq.com.



Frameworks for Enterprise Architecture

Apart from software architecture, when it comes to enterprise architecture, mainly I refer TOGAF framework documentation.




Disclaimer:
Undoubtedly there are unlimited resources for learning and building Software Architecture know-how. So I don't claim the above-mentioned are the best, but I am saying that those are my favorite and I trust recommending those to others.


Finally if you know any better available online resource for enhancing software architecture skills, then please share in comments.