Oren Eini

CEO of RavenDB

a NoSQL Open Source Document Database

Get in touch with me:

oren@ravendb.net +972 52-548-6969

Posts: 7,598
|
Comments: 51,232
Privacy Policy · Terms
filter by tags archive
time to read 1 min | 169 words

The Advanced NHibernate Warsaw Course drew a lot of interest when I announced it, but a lot of people seemed to be thrown off by the price.

Therefore, I decided to do several additional things to make it easier for you to decide to go to the course:

  • I extended the early bird period until the 15th Sep (which represents a 20% discount).
  • All attendees to the course will receive a free license to NH Prof.
    • All companies sending attendees will receive a 20% discount for future purchases of NH Prof.
  • I intent to extend the course with a “support hour”, so we can not only go over the actual course material, but go over your actual problems and resolve them during the course.
    • If necessary, I’ll do follow up on those issues after the course as well.

I hope that with those changes, it will make it easier for your to go to the course or to convince your company to go.

time to read 2 min | 215 words

Recently I noticed that a very important feature in twitter website is broken for me. I can’t follow the entire conversation any longer, which drive me crazy.

image

It didn’t take me long to figure out what the actual issue is:

image

It appears that even though I am logged in, some parts of twitter doesn’t like this.

I then thought that this has something to do with chrome, so I used the incognito mode to try it:

image

It works!

I logged out and in again, nada. I cleared all browser history and restarted chrome, nada.

I uninstalled chrome (selecting delete all browsing history) and re-installed, and now it is working.

No idea why, and I don’t like the heavy handed approach, but at least now I got my twitter tracking back.

time to read 4 min | 791 words

We recently had a client with a similar model, and I thought that this would be a good topic for a series of blog posts. For the purpose of this blog posts series, I am going to be using EBay as the example. Just to be clear, this is merely because it is a well known site that most people are likely to be familiar with.

In our model, we have the following Concepts:

  • Categories
  • Products
  • Auctions
  • Bids
  • Sellers
  • Buyers
  • Orders

We will start from what is likely the most confusing aspect. Products and Auctions.

A Product is something that can be sold. It can be either a unique item “a mint condition Spiderman comics” or it can be something that we have lots of “a flying monkey doll”. There is a big distinction between the two, because of the way the business rules are structured.

Once an Auction has been started, it cannot be changed. This include everything about this auction, pricing, shipping information, product information, etc. But a Product may change at any time (maybe I now have the flying monkey in red and green, instead of the original red and yellow). That leads us to conclude that we actually have two instances of the Product in our domain. We have the Product Template (mutable, can change at any time) and with have the Auctioned Product (immutable).

That realization leads me to the following model for products and auctions:

{
   "Name":"Flying Monkey Doll",
   "Colors":[
      "Red & Yellow",
      "Blue & Green"
   ],
   "Price":29,
   "Weight":0.23
}
{
   "Quantity":15,
   "Product":{
      "Name":"Flying Monkey Doll",
      "Colors":[
         "Blue & Green"
      ],
      "Price":29,
      "Weight":0.23
   },
   "StartsAt":"2011-09-01",
   "EndsAt":"2011-09-15"
}
products/1 auctions/1

As you can see, the Auction is going to wholly own the product. Any change made to the product will not be reflected in the Auctioned Product. This has the advantage that we need only a single document load in order to show the auction page.

Another option would be to use the versioning bundle to do that, so we would have this:

{
   "Name":"Flying Monkey Doll",
   "Colors":[
      "Red & Yellow",
      "Blue & Green"
   ],
   "Price":29,
   "Weight":0.23
}
{
   "Name":"Flying Monkey Doll",
   "Colors":[
       "Blue & Green"
   ],
   "Price":29,
   "Weight":0.23
}
{
   "Quantity":15,
   "Product": "products/1/versions/1",
   "StartsAt":"2011-09-01",
   "EndsAt":"2011-09-15"
}
products/1 products/1/versions/1 auctions/1

The versioning bundle ensures that we can get immutable views of our documents, so we can safely reference the product by its id and version.

That is it for now, on the next post, we will deal with how to work with bids.

time to read 1 min | 94 words

That is quite nice to see:

image

One of the worries that some people has about RavenDB is that they consider it to be a sole developer effort. I wanted to make sure that everyone understood that this isn’t the case.

RavenDB has quite a big community (over 50 people have contributed code over the lifetime of the project, and has a company and a development behind it.

time to read 4 min | 625 words

Users are almost always the simplest entity in your application. I mean, they usually just look like this:

image

How complex can something like that be? The answer is that as simple as something like that is, people still get it wrong, and quite often they get it horribly wrong.

Just to set the proper context, I am talking about applications that provide Software as a Service.  For example, we may be building an Accounting SaaS system.

A user logs into the system, and gets to see his invoices, outstanding bills, etc. This sounds simple enough to do, so what is the reason for this post? The reason is that while this may sound simple, it is also wrong.

The User Is The Account

Let us introduce a few other semantics into the mix. I don’t want to do accounting, so I get Pkida to do that for me. But, since my data is tied to my user account, I would have to provide her with my username and password. Now, I am willing to let Pkida do my accounting, but I am not going to give her my credentials.

This is usually the first stumbling block for systems where “user is an account” model. You want multiple users to manage the same account. A good example of a system that for a very long time failed to handle this properly is Amazon AWS platform. For a long time, there was your AWS Account and your username, and they were pretty much one and the same. Consider the case of an IT department that wanted to use Amazon AWS. Until as recently as May 2011, they didn’t have any way to have multiple people manage the account, because they would need a single user/pass for the entire thing.

That is a huge problem for most scenarios. Sharing user/pass means that you lost control on the account:

  • You don’t know who of the people who have access to the account made a particular change (no auditing).
  • You can’t use standard approaches for detecting fraud.
  • It is much harder to change the password.

Accounts Owns The Users

The next step is to ask what happen when you have something like this:

image

Now we have a way to have an account, and it can have multiple users. And all is good in the world, right?

Not so fast. What happens when it turns out that Pkida isn’t just working for me, but actually manages the accounting for several companies, each of them is using the SaaS accounting package. In order to use the software, Pkida would now have to have a separate user account for every customer she manages. That sucks:

  • It may mean that you charge her for each account (she will go to a competitor).
  • Some users would show very little activity.
  • The amount of information you will have to do things like cross selling or targeted offers would be far reduced.
  • It is annoying for the users.

A much better option is a total separation of Users and Accounts. A user can have several accounts (usually with a default one selected), and they can use a single login to access each, and each account may have multiple users associated with it.

This brings to question how you are going to handle charging people, but that is an issue for another post, and another day…

FUTURE POSTS

No future posts left, oh my!

RECENT SERIES

  1. RavenDB 7.1 (7):
    11 Jul 2025 - The Gen AI release
  2. Production postmorterm (2):
    11 Jun 2025 - The rookie server's untimely promotion
  3. Webinar (7):
    05 Jun 2025 - Think inside the database
  4. Recording (16):
    29 May 2025 - RavenDB's Upcoming Optimizations Deep Dive
  5. RavenDB News (2):
    02 May 2025 - May 2025
View all series

Syndication

Main feed ... ...
Comments feed   ... ...
}