Bitrix Site Manager is the industry’s most secure website management, e-commerce and e-marketing solution that delivers extreme value in performance, functionality, and ease-of-use for small and medium-sized businesses. It can be used by both corporate customers and individual web developers as the base to develop new sites from scratch and manage the existing sites. The Bitrix Site Manager allows to build as many sites as you need, using a single copy of the product. This means that you have to keep a single copy of the system and database on the server.
What is more, with the Bitrix Site Manager you can:
- manage the structure and content of your site;
- publish news, press releases and other frequently updated information;
- manage advertising shows on your site;
- create forums;
- create mailing lists and send messages to your subscribers;
- keep visitor statistics;
- control advertising campaigns;
- perform many other operations in managing your web project.
The product will minimize web site maintenance costs owing to simple process of management of static and dynamic information. You will not need any web design or programming expert service in maintaining and managing your site.
Let’s deploy this great application to Jelastic PHP Cloud!
Create an environment
1. Log in to Jelastic Manager.
2. Click Create environment at the top left corner of the dashboard.
3. Pick Apache application server, PHP v5.3 and MySQL database. Then type your environment name.
In a minute your environment with both Apache and MySQL will be created and appears in the environment list.
Upload the application
1. Go to the Bitrix web site, log in (or register if you haven’t done this yet) and navigate to Downloads -> Bitrix Site Manager -> Download 30-Day Trial (Buy Commercial Key).
2. Fill in the required form to get the download link.
3. Download the latest version of Bitrix Site Manager as a zip package.
4. Upload the package you have just downloaded to the Deployment manager.
5. Once the package is in Jelastic, deploy it to the environment you have created earlier.
Configure database
1. Once the deployment is finished, click Open in browser button for MySQL node.
2. When you created the environment, Jelastic sent you an email with credentials to the database. Create an account and the database with the application using these credentials.
Install Bitrix
1. Click the Open in browser button for your environment.
2. Accept the terms of the license agreement in order to start the installation process.
3. Register your copy of the program and get updates (if you wish).
4. Check system requirements.
5. Configure your database: specify database server hostname, your database username, password and name.
6. After system installation create your administrator account.
7. Select the solution to install: manufacturer website, corporate service site or download the most suitable for you from the marketplace.
8. Select the template, color theme etc. and configure your solution.
9. Now you can open your site and start edit it. Enjoy!
As you can see it is very easy way to get Bitrix up and running in the cloud. Just give it a try!
If you have any other methods of doing this I’d love to hear them.
This article was originally posted by Ted Neward at his blog.
Elliott Rusty Harold is blogging that functional programming in Java is dangerous. He’s wrong, and he’s way late to the party on this one–it’s coming to Java whether he likes it or not.
Go read his post first, while I try to sum up the reasons he cites for saying it’s dangerous:
- Java is not a lazy-evaluated language. Programmers in Java will screw up and create heap and stack errors as a result.
- See? Here’s a naive implementation of Clojure code taken directly over to Java and look how it blows up.
- Programmers can do bad things with this idea, so therefore we should avoid it.
- Oh, and by the way, it’s “dangerously inefficient” in Java/JVM, even though I offer no perf benchmarks or comparisons to back this statement, and I’m somehow ignoring that Clojure and Scala run on the JVM as well, apparently without problem.
That kind of about sums it up, I think.
Look, as Elliott points out, Java is not Haskell. Neither is it Lisp. It’s its own language, rooted in imperative and object-oriented history, but no less able to incorporate functional features into its development than Lisp could incorporate object-oriented features. However, if you do stupid things, like trying to re-create an infinite (implicitly lazily-evaluated) list in Clojure by creating an actualized list that stretches to infinity… you’re going to blow the JVM up. Duh. Not even the supercomputer on the USS Enterprise five hundred years from now will be able to construct that list.
Porting code from one language to another is not a trivial exercise. If you attempt to port line-for-line and expression-for-expression, you can expect that your ported code will not be idiomatically correct. (I know this already, having done the exercise myself.) The root of the problem in his ported code is twofold. One, he (rather foolishly and in elegant strawman fashion) badly simulates what an infinite list would look like in Java–a commenter does the better job by showing how an Iterator can be made to perform the same thing that Haskell actually does under the hood by producing the next value on demand, rather than trying to create a list of Integers stretching to infinity. For someone who professes to have some Haskell experience and love, it surprises me that Elliott makes this kind of mistake, which leads me to conclude that he’s trying to create the strawman. Two, he assumes that anyone who programs in Java functionally will have to create all of their functional tools by hand, and frankly, using Guava or FJ here would make this code sample a LOT easier to swallow. The fact that he ignores both of these in his stawman again sort of reinforces the idea that he’s deliberately crippling his strawman to make his point.
His underlying point, though, seems to be simple: “I work with bad programmers, who don’t seem to understand how to write code functionally in Java without screwing it up.” Dude. Sucks to be you. “Bad programmers will move heaven and earth to do the wrong thing.” –Glenn Vanderburg.
What really sucks for him is that these features are coming in Java 8, including lambda expressions and library support including a Stream interface that will allow for exactly this kind of code to be written without pain. Those programmers Elliott is working with are going to be even more on fire to use their functional approaches (and all the associated goodness of doing so, including composability and what-not) in their Java code. What might make Elliott more happy is that at least they won’t have written it; it’ll all be written by guys much smarter than any of them.
* The views expressed in this article are those of the author and do not necessarily represent the views of, and should not be attributed to, Jelastic or its technology and distribution partners.
We are extremely excited about Jelastic’s launch in the Netherlands, and proud to have a great partner like Info.nl, one of the most innovative and technically advanced online agencies in the country. Jelastic is the only truly global PaaS available through the best local hosting providers in various countries. Netherlands is the hosting hub of Europe, and adding it to the Jelastic family is a major milestone for us.
“We are very delighted to announce Jelastic’s availability in the Netherlands,” said Info.nl CEO Jann de Waal. “As a technology partner, Jelastic brings us a next-generation Java and PHP cloud platform. It integrates seamlessly within our services and reduces the cost of ownership of online platforms, while increasing flexibility.”
“Jelastic helps us develop faster and cheaper,” said Info.nl System Architect Edgar Vonk. “A particularly nice feature is that it is not necessary to communicate with an API. Using the web interface, we are able to deploy applications and to build and maintain test and integration environments. Jelastic represents the next step in automated deploys, and will be vital for DevOps teams.”
Now Dutch developers can enjoy with a wide range of Java and PHP software stacks such as Tomcat, GlassFish, TomEE, Jetty, Apache, NGINX application servers, as well as SQL (MariaDB, PostgreSQL, MySQL) and NoSQL (MongoDB, CouchDB) database servers and Memcached. Integration with popular build systems (Maven, Ant, Hudson, and Jenkins) and IDEs (Eclipse IDE and IntelliJ IDEA IDE) is also supported.
Jelastic is available through a global network of hosting service providers: in the USA through ServInt, in Germany through dogado, in Russia through Rusonyx, in Japan through Tsukaeru, in Finland through Planeetta, in the UK and Ireland through Layershift, in Brazil through Websolute, in Sweden through Elastx, in Switzerland through Innofield, and now in the Netherlands through Info.nl.
You’ve been waiting for it… And here it is! Jelastic now supports FTP! Thanks to all of our active users, this feature got 2017 votes and it is now available in Jelastic PaaS.
So now you get easier access to your application files and a fast, easy, and reliable way of file sharing and data transfer to and from your servers in Jelastic environments.
File Transfer Protocol (FTP) is a standard network protocol used to transfer files from one host to another over a TCP-based network. It is built on a client-server architecture and uses separate control and data connections between the client and the server. For secure transmission that hides (encrypts) the username and password, and encrypts the content, it is used FTP secured with SSL (FTPS). BTW Jelastic supports both FTP and FTPS. Unlike HTTP, the FTP protocol is stateful: you establish a control connection for the duration of an FTP session that typically spans multiple data transfers.
FTP usage in Jelastic allows you easily to upload/download necessary resources to corresponding folders. You can work with a group of files instead of uploading/downloading each file separately through dashboard. Also there is no necessity to redeploy your application after applying your edits.
As you know Jelastic supports log rotate which is designed for easy administration of systems that generate large numbers of log files. It allows automatic rotation, compression, and removal of log files. Through Jelastic dashboard you can read only new logs, but not already compressed ones (in .gz format). Now to look through your old logs you can use any FTP-client.
It is very easy to enable synchronization between your local machine and your server in Jelastic through FTP. You can access and edit most of config files, even those you can’t through dashboard, using FTP-client. Moreover you can use config editor you used to work with, not the inbuilt one. And finally you can easy deploy your applications to Jelastic via FTP.
Let’s examine how you can get all these benefits using the instructions below:
Create an environment
1. Go to Jelastic.com and sign up if you haven’t done it yet or log in with your Jelastic credentials by clicking the Sign In link on the page.
2. While in Jelastic dashboard, click the Create environment button.
3. In the Environment Topology dialog, pick your application server (for example, Tomcat 7 or 6) and switch on PublicIP. Then type your environment name, for example, ftptest.
It will take just a minute for your environment to be created.
Install FTP
1. Click Add-ons button for your application server.
2. In the opened tab you’ll see the list of all applications available for adding to your environment. Find FTP and click Install.
3. Сonfirm the installation by clicking Install button in the opened window.
After adding FTP to the Jelastic environment you’ll get the email with credentials for accessing (FTP links, Login, Password, IPs etc.).
Transfer files
1. Install and open any FTP client (we use FileZilla as an example).
2. Enter your Host, Username and Password using the FTP credentials you’ve got via email after FTP installation. Perform the connection by clicking Quickconnect.
3. You can upload or download files simply by double-clicking on them. To transfer directories and/or multiple files select them, right-click the selection and then click on Upload/Download in the popup menu.
4. You can simply drag the files from one directory and drop them on the other one for transferring.
5. Add your files to the queue if you want to transfer them later.
6. One more useful feature is directory comparison. To quickly see differences between files on the local machine and the server, choose View > Directory Comparison, select either compare file size or compare modification time and click Enable.
Download log files
1. Install and open any FTP client (we use FileZilla as an example).
2. Enter your Host, Username and Password using the FTP credentials you’ve got via email after FTP installation. Perform the connection by clicking Quickconnect.
3. Now you can simply download your logs: navigate to the logs folder, select the log file you need, download it as it’s shown in the screenshot below and open in any convenient editor to review.
Sync files
1. Start GoodSync and click the Browse button on the left side.
2. In the opened window choose the FTP tab, fill in the required fields (Host, Username, Password) and click Go button.
3. Then choose the necessary folder on your server and click OK.
4. After that click the Browse button on the right side and choose the local folder you would like to back up or sync your data to.
5. Then in the main window click the Analyze button. You will be shown all the differences in the chosen folders.
6. Click the Sync button to perform the synchronization.
Edit configuration files
1. Open your config editor (we use Sublime Text 2 as an example).
2. Connect to your server via FTP (if you use Sublime click File->FTP/SFTP->Browse server) and you can start edit your files.
Deploy application via FTP
Note: We don’t recommend to deploy your apps in such a way because application you’ve deployed won’t be shown in Jelastic dashboard, so if you want to redeploy or delete your application you have to do this manually. Also such a deployment procedure is not suitable for GlassFish application server.
Let’s consider a short example on how to deploy Railo to your Jelastic Environment through FileZilla.
1. Install and open any FTP client (we use FileZilla as an example).
2. Connect to your environment via FTP: Enter your Host, Username and Password and click on Quickconnect button.
3. Copy your application files into the ROOT folder (or create another context for your app and copy your files in it).
4. Now you can return to Jelastic dashboard and make sure that everything is ok. For that click Open in browser button for your environment.
That’s all for today! As you can see thanks to you our platform is getting better!
Don’t hesitate to tell us what you need from Jelastic and vote for other’s ideas here. The more votes a feature gets – the higher priority it gains in the roadmap.
Thanks again for being a part of Jelastic community and keep your suggestions coming!
This Spotlight comes to you from North Carolina! We got a chance to interview one of our users Erik Rasmussen, the president of Jyst. The app he is currently working on is a product which is the dream of all social network fans.
Thanks for taking the time to chat with us, Erik. So, where did you grow up?
I grew up in western North Carolina and went to college in Raleigh.
Where are you based now?
I’m based in western North Carolina.
What’s your background?
Java and e-commerce.
Before this, what were you doing?
I’ve been programming in Java and JavaScript for over ten years now, building e-commerce sites to sell various products.
Tell us about Jyst.
I’ve long been frustrated with the UI of social networking sites, and especially having to visit multiple websites to see all the information from the people I want to follow. There’s something boring and unappealing about the normal way Twitter and Facebook feeds are displayed. So much scrolling! The “pinboard” layout of Pinterest, on the other hand, is immediately captivating, drawing your eye to the items that most interest you without quite so much scrolling. Immediately I suspected there was a market for visualizing Twitter and Facebook feeds in the pinboard format.
While we at Jyst feel that the Jyst interface is superior to that of either Twitter or Facebook, and would be worth using with only one social networking account, the true power of Jyst comes from the ability to merge social feeds, presenting data from both Twitter and Facebook together on one page. Jyst’s power of combining social networks is not only for reading, but also for broadcasting. Sharing a status update or link to both your Twitter and Facebook accounts is simple and easy with Jyst’s sharing bookmarket. Other sites that do broadcasting to multiple social networks cost $10/month or more. When we do finally switch to a freemium model, after our beta period, we hope to undercut such prices by a very large margin.
Jyst was built from the ground up with scalability in mind. The server-side component is very minimal, merely proxying requests to Twitter or Facebook. Due to the nature of OAuth2, in fact, after the initial authentication, 100% of the requests to Facebook are direct from the browser, bypassing Jyst’s servers entirely, making Jyst’s Facebook access as scalable as Facebook itself. All the processing and GUI work is done in pure Javascript.
Which other PaaS or hosting options did you evaluate or use and what made you pick Jelastic?
I started out with Google’s App Engine, and I made it all the way to the authentication and account creation part of my application before I realized that they didn’t allow even basic relational database operations. What??? That was when I realized I needed some real Tomcat hosting with a real database behind it.
After that, I evaluated a few options, but only set up trial accounts with CloudBees and Jelastic. I liked the interface and available services (e.g. PostgreSQL instead of MySQL) of Jelastic a lot more than CloudBees, and for the architecture I needed, Jelastic was slightly cheaper. There were a variety of other minor factors, such as CloudBees wanting me to use a specific Maven plugin to deploy, whereas Jelastic needing only my build WAR file. In the end, it was a pretty clear choice.
What were your specific needs/challenges?
I just wanted a place to host a WAR file that I knew would be scalable, should Jyst be successful, without incurring excessive fees. Jelastic impressed me very much by the wide menu of scalability options available.
How did Jelastic address those needs or challenges?
Getting up and running was incredibly easy. It was literally just a matter of selecting my WAR file from my build directory and uploading it, via the Jelastic web interface.
Did Jelastic save you money? Up front? Ongoing? How much?
If I had gone with another hosting platform first, I’m sure Jelastic would’ve saved me money, but I did my research and chose Jelastic right out of the gate. I’d rather not think about how much more money I’d be paying to host elsewhere.
Have you used Jelastic’s technology in any new, unique, or surprising ways?
Not yet, but I look forward to having to use load balancing and replication.
So far, how do you like Jelastic? Is there anything in particular that stands out to you?
I’ve written some apps myself using Sencha’s ExtJS, and there are some UI’s that benefit from it and others that do not, but Jelastic’s is definitely one of the former. The UI is very professional and easy to use. Designing my “environment topology” was straightforward and simple.
What are your plans for the future with respect to your application?
We’re in the growth stage at the moment, looking to get the word out to more users and for suggestions on how to improve our application. We encourage people to email us or contact us on Twitter or Facebook.
Eventually we will monetize it into a very cheap, undercutting the competition, subscription-based freemium service. We also plan to add other social networks, as we only support Twitter and Facebook at the moment.
What’s your favorite hobby?
I love golf. It’s so challenging, fun, and nice to be outside.
What do you like most about your work?
I like making elegant solutions to complex problems.
Do you have a favorite website?
As you might imagine, I’m a bit of a social networking addict.
Do you have a philosophy by which you live, something that you rely on when making decisions or use to guide you in tough times?
After waiting for years for someone to build a social networking client that I really liked, I decided it was time to just buckle down and build it myself. No software is ever perfect or finished, but we’re proud enough of Jyst to show it to the world and we think people might find it useful enough to use on a daily basis.
Well, thanks for your time, Erik. We appreciate you sharing with us.
If you are interested in learning more about Jyst you can learn more at jyst.us.
Neo4j is a robust (fully ACID) transactional property graph database. A graph database stores data in a graph, the most generic of data structures, capable of elegantly representing any kind of data in a highly accessible way. Due to its graph data model, Neo4j is highly agile and blazing fast. For connected data operations, Neo4j runs a thousand times faster than relational databases.
The main benefits of using Neo4j are:
- intuitive, using a graph model for data representation
- reliable, with full ACID transactions
- durable and fast, using a custom disk-based, native storage engine
- massively scalable, up to several billion nodes/relationships/properties
- highly-available, when distributed across multiple machines
- expressive, with a powerful, human readable graph query language
- fast, with a powerful traversal framework for high-speed graph queries
- embeddable, with a few small jars
- simple, accessible by a convenient REST interface or an object-oriented Java API
And today we’ll show you how to get all these benefits in the cloud very fast and easy. Let’s get started!
Create the environment
1. Go to jelastic.com and sign up if you haven’t done it yet or log in with your Jelastic credentials by clicking the Sign In link on the page.
2. Ask Jelastic to create a new environment.
3. In the Environment topology dialog which opens, pick Tomcat 7 as your application server, set your cloudlet limits and type your environment name, for example, neo4jtest. Then click Create.
Wait just a minute for your environment to be created.
Deploy application
1. It’s very easy to use Neo4j embedded in Java applications. Create the application with Neo4j as you usually do and build the war file.
In our case we use simple HelloWorld application and a graph that looks like this:
Here’s the code:
package com.example.neo4jjelastic;
import java.io.File;
import java.io.IOException;
import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
import org.neo4j.kernel.impl.util.FileUtils;
public class EmbeddedNeo4j
{
private static final String DB_PATH = System.getProperty("user.home") + "/neo4j_db";
String greeting;
// START SNIPPET: vars
GraphDatabaseService graphDb;
Node firstNode;
Node secondNode;
Relationship relationship;
// END SNIPPET: vars
// START SNIPPET: createReltype
private static enum RelTypes implements RelationshipType
{
KNOWS
}
// END SNIPPET: createReltype
void createDb()
{
clearDb();
// START SNIPPET: startDb
graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( DB_PATH );
registerShutdownHook( graphDb );
// END SNIPPET: startDb
// START SNIPPET: transaction
Transaction tx = graphDb.beginTx();
try
{
// Updating operations go here
// END SNIPPET: transaction
// START SNIPPET: addData
firstNode = graphDb.createNode();
firstNode.setProperty( "message", "Hello, " );
secondNode = graphDb.createNode();
secondNode.setProperty( "message", "World!" );
relationship = firstNode.createRelationshipTo( secondNode, RelTypes.KNOWS );
relationship.setProperty( "message", "brave Neo4j " );
// END SNIPPET: addData
// START SNIPPET: readData
System.out.print( firstNode.getProperty( "message" ) );
System.out.print( relationship.getProperty( "message" ) );
System.out.print( secondNode.getProperty( "message" ) );
// END SNIPPET: readData
greeting = ( (String) firstNode.getProperty( "message" ) )
+ ( (String) relationship.getProperty( "message" ) )
+ ( (String) secondNode.getProperty( "message" ) );
// START SNIPPET: transaction
tx.success();
}
finally
{
tx.finish();
}
// END SNIPPET: transaction
}
private void clearDb()
{
try
{
FileUtils.deleteRecursively( new File( DB_PATH ) );
}
catch ( IOException e )
{
throw new RuntimeException( e );
}
}
void removeData()
{
Transaction tx = graphDb.beginTx();
try
{
// START SNIPPET: removingData
// let's remove the data
firstNode.getSingleRelationship( RelTypes.KNOWS, Direction.OUTGOING ).delete();
firstNode.delete();
secondNode.delete();
// END SNIPPET: removingData
tx.success();
}
finally
{
tx.finish();
}
}
void shutDown()
{
System.out.println();
System.out.println( "Shutting down database ..." );
// START SNIPPET: shutdownServer
graphDb.shutdown();
// END SNIPPET: shutdownServer
}
// START SNIPPET: shutdownHook
private static void registerShutdownHook( final GraphDatabaseService graphDb )
{
// Registers a shutdown hook for the Neo4j instance so that it
// shuts down nicely when the VM exits (even if you "Ctrl-C" the
// running application).
Runtime.getRuntime().addShutdownHook( new Thread()
{
@Override
public void run()
{
graphDb.shutdown();
}
} );
}
// END SNIPPET: shutdownHook
public void runNeo4jInJelastic(){
EmbeddedNeo4j hello = new EmbeddedNeo4j();
hello.createDb();
hello.removeData();
hello.shutDown();
}
}
As you can see in this case our database will be stored in the home folder of Tomcat in neo4j_db directory.
2. Upload your war file to the Deployment manager.
3. Once the package is in Jelastic, deploy it to the environment you have created earlier.
4. Now you can open your application in a browser.
5. Check your application server’s log to check the results of program processing.
6. Click Config button for Tomcat and navigate to the home folder and you’ll see your Neo4j database files.
That’s all you have to do! Now you have highly agile and fast database right in the cloud. Enjoy with Neo4j and Jelastic!
Don’t forget to tell your friends about Neo4j on Jelastic:)
Many supposedly competitive PaaS’s and cloud hosting providers attract developers by making it seem easy to start running new apps. They start by offering a small “dose” of resources for free. The accompanying marketing campaigns sometimes seem to be saying: “Take it – it’s free forever”.
But as apps start growing, they need more and more resources. And those additional resources are far from free. In fact, at that point the formerly “free” pricing usually becomes very expensive.
In short, it makes no sense to host production applications on the kind of PaaS’s that offer a small amount of resources for free, but are too expensive for real usage. Because when your app is ready for production, you have to migrate it to dedicated servers. And then you lose all benefits of PaaS automation. It’s even worse if the PaaS you’re using has lock-in features, because it will be very painful to migrate your app. In some cases it will be impossible, so you will have to stay and continue paying outrageous prices.
Recently Jelastic introduced a revolutionary pricing model designed explicitly for production applications and extensive scaling. It also includes great discounts for reserved resources and volume usage.
Let’s take a look how it works inside. I will describe the most important details.
DYNAMIC RESOURCES
One of the main benefits of Jelastic Java and PHP Cloud Hosting is the ability to dynamically scale resources up and down for your servers automatically – based on application demand.
Dynamic resources make that magic happen – they’re added when you need them, and removed again as soon as you’re done with them. This helps you to cope with celebrity endorsements (e.g. Twitter or Facebook mentions), or any other unexpected surges in demand, without any pre-planning or special coding.
Thanks to the hourly billing, you only pay for those additional resources for the limited amount of time that you need them. So you no longer need to upgrade your entire hosting package for a month or a year just to cope with a short term spike in demand!
RESERVED RESOURCES
With the introduction of Version 1.9, you can now configure Reserved resources for your servers to “pre-book” resource usage in advance. You always pay for Reserved resources, even if your actual resource usage is lower. But in exchange you get a great discount compared to Dynamic resources.
And if you want, you can get fixed pricing for your usage by simply setting all of your servers to only use Reserved resources.
HYBRID PRICING – THE BEST OF THE BOTH WORLDS
But I personally prefer a mix of the two kinds of resources described above. The best approach is to use Reserved resources for your typical usage (to pay the minimum price), combined with the powerful automatic scaling provided by Dynamic resources to handle your unexpected peaks in demand. So you can get a great discount for Reserved resources and still be ready when load spikes.
EVEN MORE DISCOUNTS FOR HIGHER-VOLUME USAGE
Jelastic can also give you automatic discounts for your usage depending on the amount of resources that you consume – so higher-volume usage is automatically cheaper. The availability and the level of discount depends on your chosen hosting provider and the specific resource: cloudlets (RAM and CPU), disk space and traffic. When your app grows, the base price becomes cheaper. In other words, if your app consumes more resources, you pay a lower base price. This allows you to get big discounts for volume of usage.
Compared with other PaaS providers, Jelastic offers the most elastic and flexible cloud hosting platform, while providing fair pricing through a combination of Reserved and Dynamic resources.
And do not forget – Jelastic is the only Global PaaS that does not impose any kind of lock-in features.
This article was originally posted by Javin Paul at Javarevisited.
We often here the term “production quality code”, some times in interview where interviewee asked to write production quality code for a particular function, some time discussion between developers and programmers and some time during code review. I know most of you familiar with term but for those who wonder what is production quality code in simple terms its code which can bear the test of time in production environment.
We all develop code in development, than test in QA and finally it gets released in production. But there are lot of difference between test and prod and if you have not coded taking prod environment in mind most likely code will fail in prod or result in exceptions. So what makes production environment different than development environment? Here are few things which I noted:
1) Production is all about load which will expose concurrency issues, load issues, memory and CPU issues.
2) You will get a lot many scenarios in production that you might have thought in development. If think through process is not applied than most likely those scenario has not handled in production.
3) Different data input or incorrect data, one of classic problems in production is the data which gets input to your program, be it from upstream system or any other place you will get all sort of data and if your program doesn’t handle those very likely it will suffer.
4) Boundary conditions, this is some what related to above point data and scenarios but most of the boundary condition e.g. null, empty etc exposed in production.
So if a code is written all these things and potentially domain specific things and can sustain test of production than it called a production quality code and believe me it takes a lot of experience, skill and think through process to write production quality code not just in first time even after two or three iteration but as a developer we should always strive for writing production quality code in first attempt.
Now let’s see how we can do that, what are the things we should keep in mind:
1) Get your requirements right, understand the problem , talk to user or business person as much as possible this will help you to find different scenario as early as possible. Many times business or user not tell you everything its not there fault but it doesn’t come in mind right through. So if you are frequently speaking, discussing and presenting solution to them most likely they will ask questions, give feedback which eventually expose more scenario and subtle details. Here experience plays an important role. More experience or domain knowledge you, much better code you will write.
2) Think through, Think through and Think through. There is no substitute of this, it is more of a skill and art than science but you will get hold of this when you get more experience. For example if user says that you need replay capability in your program. You should be able to think of all possible scenarios where you need to replay and what could be required for that, what would be side effect of that. Does replay would be requested, what if the requesting system went down again, will you be able to replay etc.
3) Boundary condition, always think that you will get bad input , you will get null or empty, small or very large numbers, function may get called at wrong time etc. You can get rid of this by writing unit test for each boundary condition.
4) Concurrency, this is is the major culprit and big problem which exposes itself in production when due to load multiple thread gets triggered and access your program concurrently. With high speed low latency electronic trading system and with many other java system where its requirement to have a concurrent application this can only be addressed by proper design, if you get the design right you will safe other wise you will need to bear the pain of redesigning or rewriting code. You can also expose concurrency issue by doing load testing in early QA cycles.
5) Exception handling, this is by far most important characteristic of production quality code, it must be able to handle exceptional scenario in clear cut predefined way. Whole program should never be crashed due to one single bad input or scenario.
6) Recoverable, code should be able to recover itself in case of premature closing or crash.
Though these are just some points which I am able to thought, there are lots more and it’s a constant process of improving yourself and I always strive for this. Please share how you guys write production quality code, what are things you guys keep in mind, what questions you guys ask to yourself and to user?
Thank you.
* The views expressed in this article are those of the author and do not necessarily represent the views of, and should not be attributed to, Jelastic or its technology and distribution partners.
We are very pleased to announce that yesterday we launched Jelastic commercially in Sweden with one of our most advanced hosting partners Elastx.
Since we launched our public beta last month, that was announced at Jfokus, Sweden’s largest Java event, we have already seen an extremely positive reaction from Swedish users. Now full Jelastic version 1.9 is available in Sweden, with all its features, add-ons and flexibility to host and scale complex Java and PHP applications. This will allow Swedish developers and SMBs to have access to a world-class Java and PHP host without any limitations. Elastx is offering users a free two week trial to value full compatibility with all major Java and PHP software stacks, including Tomcat, GlassFish, Jetty, TomEE, Apache and NGINX application servers, as well as with SQL (MariaDB, PostgreSQL, MySQL) and NoSQL (MongoDB, CouchDB) databases.
“We are very excited that we now can offer the full version of Jelastic’s platform. Finally we can offer the best cloud-based Java hosting platform available today”, said Joakim Öhman, CEO of Elastx. “I believe hosting the platform in Sweden gives all Swedish customers an interesting alternative, especially for everyone that require data to never leave Sweden. That in combination with our cloud optimized infrastructure will provide an outstanding performance and stability for our customers!”
Jelastic is a truly global PaaS offering. It is hosted in nine countries with more than 40 000 end-users for now and it’s only beginning! Become a part of our big family today!
Woohoo! We are the first public PaaS which offers Apache TomEE, one of the fastest and the most user-friendly enterprise-ready application servers available.
TomEE has long been among the top requests that we have been getting from our community. TomEE is a natural fit for any cloud platform that offers Tomcat, as it offers Java EE compliance, but with the footprint and startup time of Tomcat. And since we pre-announced our intention to include TomEE in Jelastic late last year, the feedback we have been getting was overwhelmingly positive. It is lightweight yet powerful, which makes it a perfect choice for cloud hosting.
“Jelastic’s support of Tomcat has always been top-notch, and their support of TomEE shows real vision,” says David Blevins, founder of the TomEE project. “TomEE joins the family of Tomcat, Glassfish, Jetty, Apache and NGINX already offered by Jelastic. But they aren’t just combining the usual suspects into a platform that is identical to all other cloud platforms – they have put a significant amount of time into offering TomEE users the best experience possible. It’s very tightly integrated with the functionality of all the other layers of their stack including load-balancing, replication, persistence to SQL or NoSQL databases and more. Jelastic’s integration of TomEE is the best I’ve seen.”
Apache TomEE is full-blown application server that combines several enterprise projects including Apache OpenEJB, Apache OpenWebBeans, Apache OpenJPA, Apache MyFaces and more. Put briefly, Tomcat + Java EE = TomEE. There’s a definite “less is more” philosophy in Apache TomEE. That’s important because it’s easy for developers of app servers to go too far. The result is usually a slow-starting, memory-hogging beast. Unlike other JEE application servers, TomEE avoids architecture overhead and stays lightweight and as simple as possible. With Jelastic, it takes just one click to get an automatically scaled cloud based on TomEE.
So, with TomEE, you get:
- An enterprise-ready application server that nonetheless remains simple
- A lightweight server – developers can run applications without any additional runtime requirements or startup time even when the applications are large
- Full compatibility with most Tomcat-aware and Tomcat-tested tools
- An environment that will be completely familiar for Tomcat users, with no need to learn anything new
- Embedded OpenEJB, which makes it great for testing EJBs
- The ability for servlets to get access to JPA and Transactions
- The ability to view or modify any Tomcat-provided resource files
With Jelastic, getting an automatically scaled cloud based on TomEE is very easy. Let’s consider a short example on how to deploy simple HelloWorld EJB app.
*Note: TomEE is available in Jelastic beginning from version 1.9.
Create the environment
1. Go to jelastic.com and sign up if you haven’t done it yet or log in with your Jelastic credentials by clicking the Sign In link on the page.
2. Click Create environment to set up a new environment in Jelastic.
3. In the Environment topology window, select TomEE as your application server, set the Cloudlets limit (e.g. 16), type your environment name, for example, ejbtest, and click Create.
In a minute your environment will be created and will appear in the environments list.
Upload Java package
1. Upload your EAR archive to the Deployment manager.
You can download our sample application for testing here.
2. Deploy your archive to the environment you have created earlier.
That’s all you have to do! Now you can open your application in a web browser and enjoy!
We’ll continue to publish more interesting and helpful scenarios with TomEE usage. So, stay tuned to our blog for even more exciting stuff!
As you see we always consider our customers’ opinion and try to satisfy all their needs. Thanks to our users we are getting better!
So, don’t hesitate to tell us what you need from Jelastic and vote for other’s ideas here.



















































Habrahabr
Google+
Facebook
YouTube
Twitter
Blog