Softwire Blog


Scala connections to your Cassandra database


30 March 2015, by

ORMs can be a complicated part of any app that you are writing, so it is always great to find one which makes life easier. On a recent Scala project, we chose to use Phantom to connect to our Cassandra database. The advantages it offers are that it provides a very simple interface for accessing data, and also creating column families while still being based on the datastax driver. This is great as it means that your code remains very readable, but you are also still free to use any advanced features which may not have found their way into the library yet. The following examples all compile against Phantom version 1.22.0.

Here’s a simple example of a class that could be used to access a column family:

import com.datastax.driver.core.Row
import com.websudos.phantom.CassandraTable
import com.websudos.phantom.connectors.RootConnector
import com.websudos.phantom.dsl._
import java.util.UUID
import scala.concurrent.Future

class FooTable extends CassandraTable[ConcreteFoo, Foo] {
 object id extends UUIDColumn(this) with PartitionKey[UUID]
 object bar extends StringColumn(this)
 object baz extends IntColumn(this)

 def fromRow(row: Row): Foo = {
 Foo(
 id(row),
 bar(row),
 baz(row))
 }
}

abstract class ConcreteFoo extends FooTable with RootConnector {
 def insert(row: Foo): Future[ResultSet] = {
 insert.value(_.id, row.id)
 .value(_.bar, row.bar)
 .value(_.baz, row.baz)
 .future()
 }

 def getById(id: UUID): Future[Option[Foo]] = select.where(_.id eqs id).one()
}

case class Foo(id: UUID, bar: String, baz: Int)

That’s now sufficient for us to do most of the interaction we want with the database. However, before we can interact with it, we’ll also need a database connection. This can be done using the following code (don’t forget to update the connection values to be correct for one of your cassandra nodes).

import com.websudos.phantom.connectors.{KeySpaceDef, ContactPoint}

object DefaultConnector {
 val connector: KeySpaceDef = ContactPoint.local.withClusterBuilder(_.withCredentials("admin", "password")).keySpace("keyspace")
}

class Database(val keyspace: KeySpaceDef) extends Database(keyspace) {
 object foo extends ConcreteFoo with keyspace.Connector
}

object Database extends Database(DefaultConnector.connector)

The Phantom library will take care of handling database connections for you when you access data through these objects.

Now that we’ve got a connection, it’s simple to:

Create the column family in the database:

Database.foo.create.ifNotExists().future()

Put some data into the database:

Database.foo.insert(Foo(UUID.randomUUID(), "new foo", 1234))

Get some data out of the database:

Database.foo.getById(UUID.fromString("uuid1"))

This simple interface should be enough to do most things with your Cassandra database, and hopefully the code snippets above will help in setting you up for easy database interactions!

If you would like to know some more advanced tips on phantom, check out the outworkers’ blog.

The best way to manage your task list


23 March 2015, by

Check ListI’m not about to give you the perfect task list. If I could, I would, but different people have different requirements for how their task list works, where it is, and how it reminds them of upcoming actions/events. At Softwire each employee chooses how to manage the tasks they need to do. In this blog post, we take a look at 6 different options that are used within our company. It’s up to you to decide if they’re the right option for you or not!

(more…)

Our work for Yudu – A Retrospective


14 March 2015, by

Softwire built a next-generation digital publishing platform for YUDU media, which powers more than 1,000 new publications and 1,000,000 page views every day.

The Challenge

Build a bespoke, highly scalable digital self-publishing platform allowing publishers of all sizes to create feature rich, interactive publications at the click of a button.

YUDU Media asked us to build an online digital publishing platform. The system had to provide a cost effective way for publishers to take their content online, without making a major technology investment. They required a sophisticated web-based publishing interface, which could turn raw PDF, Word, Excel or PowerPoint files into an interactive experience for the reader. Publishers could enhance their publications by adding rich media elements, from videos to order forms, graphs and HTML5 interactivity, without any need for technical knowledge.

The end product had to be simple to use for all end users, both the publishers themselves and the readers. The system also needed to be able to cope with high usage volumes, with 1000’s of readers using the application at any one time.

The Solution

Softwire paid close attention to detail in the scoping phase and took an agile approach to the development phase allowing us to create a highly adaptable, highly useable end product.

Softwire’s customer-centric and agile approach to development helped us to create a product which met the rapidly evolving needs of our client. Our autonomous team kept in regular contact with YUDU’s project manager regarding requirements and carried out speculative development phases to determine fiscally viable product features where requirements were not fixed. This helped Yudu to grow their product offering to the needs of their business and their market.

The core platform was developed using Java Enterprise technologies, including JBoss application server, Spring MVCX and Java EE, and uses Oracle databases. Dedicated PDF processing servers carried out the heavy-lifting of converting PDF files to a flash compatible format. The product also included an Epublishing marketplace implemented in Ruby to allow users to organise, promote and sell their publications. It also included a statistics server with a reporting web interface to monitor reader behaviour. Publications were rendered via a browser-based flash based page turning application.

Yudu

The Outcome

Successful delivery of the system has allowed publishers across the world to digitalise their titles and YUDU have grown into a multinational award winning company.

Softwire have continued to work with YUDU to steadily build upon the original project. YUDU’s product is now used by just under 1000 publishers globally including TimeOut, Readers Digest and the Beano. More than 1000 YUDU publications are published and over 1,000,000 YUDU pages are viewed daily across the world.

Softwire’s expertise and attention to detail allowed YUDU to take a high quality product into the rapidly evolving market place of digital publishing. We have worked with YUDU as they have grown from a start-up company, to continually offer high levels of code, design and customer service.

Time Out on Yudu

Tips for managing technical people: Set a vision


8 March 2015, by

Galvanizing the geeksThe following is an excerpt from my new book, “Galvanizing the Geeks – Tips for Managing Technical People”. You can buy the full book on my website, here.

As well as goals, you may also need a “vision” for your team. These two concepts overlap slightly, but essentially by ‘goal’ I mean a description of a task or other discrete output that needs to be produced, whereas by ‘vision’ I’m talking about an overarching ethos or way of producing the output. 

Only sophisticated and well-functioning teams can be led by vision. In high-level terms, as a team, what you need to deliver is always going to be the same: high-quality code at the best value for money. There may be additional requirements in your team, or different balances between quality and productivity, which will combine to produce an overall vision. If your team is well-versed in setting their own goals and delivering in accordance with the vision, you need only communicate that vision well and sit back and watch the team deliver.

I once worked on a long lived product for a digital media client. The software ran across several mobile and desktop platforms and had a very sophisticated feature-set developed over five years. At any one point, there were many things that need to be managed: support requests on the existing platforms, development on new platforms, underlying maintenance of the code, and a long backlog of new features and enhancements that will allow the client’s sales team to sell more products.

The client provided us with a product owner. The product owner met with the technical team at least once a week and explained how the business was prioritising different development efforts. On top of that, the team had been set a vision: the product was the core of the client’s business, and needed to be both robust and scalable to keep existing users, as well as feature-rich in order to expand to new users. This vision was well understood by the team, and meant that, rather than the client product owner setting us detailed goals, the team could (and did) challenge the immediate prioritisation of work when it didn’t conform to the overriding vision that they have been set. This ability to ‘work to the vision’ resulted in, for example, critical server availability work being carried out in preference to more exciting new development. This server availability work paid off in spades when a server fault took an entire disk array out. If you have a team of highly-skilled technical staff, make sure they understand the bigger picture to which they need to deliver. This will allow them to deliver the best results.

Meet the Team; Eli – Business Development Manager


5 March 2015, by

Eli works in our sales team as a Business Development Manager. She’s responsible for handling customer accounts and finding us interesting new projects to keep our developers busy.

How long have you been working at Softwire?eli

I’ve been working at Softwire for 1 year and 5 months in sales.  I currently work as a Business Development Manager, which involves meeting with new and existing clients and discussing how Softwire might be able to help them achieve their technical needs. As a BDM (business development manager) you also manage accounts and manage campaigns. A campaign is where the BDE (Business Development Executive) generates leads through the calling data in that sector, for example my current campaigns include Pharmaceuticals & Health, Leisure & Travel and Property.

What’s it like to work at Softwire?

When I first started working at Softwire it was like I hit gold. I’ve never worked for a company that is so much fun to work for, I actually enjoy coming to work. Not only do they invest a lot of time into the staff with morale events but they care a lot about your personal development too. One of the great things about Softwire is the perks you get with the job, a chef that comes in everyday, food order twice a week, morale days, company picnic, company birthday…. I could go on and on. Something that really sticks out for me is the fact that everyone is really friendly and there isn’t any divides in the company. This is also true with the directors, I regularly have conversations with them in the chill out.

How have you found working at a software development company?

I’m not a technical person but as a sales person I’ve grown a lot just learning about all the different technologies. What I’ve learnt I use a lot in conversations I have with clients and prospects, which means I’m able to provide more value to them and answer the occasional techy question!. I’ve learnt about the different technologies in many ways, but a way that really stands out is the Lunch and Learns we have, which is where you get a free lunch and you learn about something new. The topics can be quite varied but I often find that I learn a lot of technical things.

What do your friends think about Softwire?

When I tell my friends about Softwire, they are really jealous. A couple of my friends have even asked if they can join. I think it must be a combination of enjoying my job and having a lot of perks but either way my friends always comment on how lucky I am. I’ve also been fortunate that I can invite them to most of the events that we do, so not only do they get to hear how awesome Softwire is but they get to experience it too.

If you could install any extra feature to our offices what would it be?

A roof garden! Oh and I’d love it if we could get an office pet, preferably a puppy or a kitten. On a serious note I don’t think there is anything that we could install as an extra feature. We are really lucky that the directors invest a lot of time into our happiness and if we suggest something which is reasonable, then we can usually get it. A great example of this is that the developers were getting tired of sitting in the same position for long periods of time and so somebody put forward a running desk. Now if the developers feel like it they can code whilst walking on a tread mill. 

Tips for managing technical people: Set Goals


1 March 2015, by

Galvanizing the geeksThe following is an excerpt from my new book, “Galvanizing the Geeks – Tips for Managing Technical People”. You can buy the full book on my website, here.

Micro-managing your super-bright and super-knowledgeable team isn’t going to work well for you. The alternative is to set high-level goals for output. To be meaningful these goals needs to have specified dates for completion. Development tasks will usually also have task estimates (for example, ‘this task will be successful if it takes 10 days or less’), but these are really just a variation on end dates.

It’s very tempting to make your own ‘correct’ goals for your team. If you used to be a coder, you probably know how long it would have taken you, and you don’t want to be giving the people beneath you an easy ride. If you’re not technical, it will be even worse – I have heard many cries of ‘It can’t possibly take that long!’ But rather than being motivating, tough, one-sided goals give the people responsible for delivering them a get-out clause. The goals were unrealistic, everyone knew they were unrealistic, the business requirements changed, someone else let the team down. For a goal to be an effective motivator, the person who is delivering the goal needs to be signed up to it. The best way to get someone bought in is for them to set their goals themselves.

A lot of managers will worry that their teams will set themselves goals that are too easy. Funnily enough, teams often do the exact opposite: they set goals that are too hard. And these are even worse! If you know a goal is too hard, how can it be motivating? If a team knows that whatever they do they won’t hit the goal, how can they work towards it?

Until your team is well-trained in setting goals, it may not be sensible to just leave them to get on with it. Setting goals that are achievable and challenging is very difficult. It requires a lot of understanding of exactly what is possible, and it includes (however you dress it up) the necessity of having to estimate pieces of work. You can do it via Scrum story points, or estimate in hours or days, but you do need an idea of how much work there is.

The good news is that setting and hitting goals is quite addictive. Once you get into a pattern of successfully achieving what you set out to, you start to feel like a winner – especially if other teams are often late or behind on their goals. Teams with a strong goal-hitting culture will not only deliver more reliably (‘one feature for sure’ is almost always better than ‘two features, maybe’), but will also start to increase the difficulty of their own goals as the ones that they are hitting get too easy.

Of course, your job also requires you to pass on requirements from the business. Sometimes these are the most effective goals. The business needs a new feature two weeks on Friday, otherwise we won’t be ready to launch. The business needs this extra screen, but only if it can be developed within 10 days – can you do it? This communication must work both ways. The incentive for the business is to get as much done as cheaply as possible; left to itself, the business will stipulate unachievable goals every single time. The technical team needs to feed back to the business in this case, before the business makes commitments based on deliveries that simply aren’t going to happen.

Agile development also has a concept of short-term goal-setting. All development is done in ‘iterations’, regular time periods, usually between one and four weeks long, in which the most important subset of the total functionality is developed.

A good example of how successful goal-setting can turn a project around was a team working on a payment provider. The project started slowly, with framework setup eating up more time than expected. The first stories were completed much more slowly than they should have been. There was a sense of fatalism on the team; they had a number of story points to complete each week, but they knew that it wasn’t going to happen so they didn’t even try. The project was behind, but no-one seemed to have a sense of urgency about it.

The first step to recovery was examining why the goals weren’t being hit. The most obvious reason was the one that everyone knew: the framework setup was taking too long, and the early stories were having to absorb some costs that would pay off later in the project. But by how much? By unpacking the framework points into separate stories and re-estimating accordingly, the project manager was able to communicate what was needed for the project to be successful, and the team immediately worked with more conviction towards the realistic (although still pretty tough) goal. They became one of the best-delivering teams, and turned the project round from a disaster to a triumph.