Is $A \times B$ the same as $A \oplus B$? When $A, B$ are $K$-modules, then $A \times B$ is the same as $A \oplus B$. 

Let $A, B$ be two $K$-algebras, where $K$ is a field. Is $A \times B$ the same as $A \oplus B$? 

Thank you very much.
Edit: $A \times B$ is direct product and $A \oplus B$ is direct sum.
Edit: I am asking this question because I am confused with Lemma 1.6 on page 46 of the book Elements of representations of associative algebras. It is said that $\{e_1, \ldots, e_n\}$ is a complete set of primitive orthogonal idempotents. This means that $A=e_1A\oplus \cdots \oplus e_nA$. But it is said that $A$ is not nessesarily connected (connected means $A$ is a product of two non-trivial algebras, the definition of connected is on page 18 of the book, above example 4.1). 

 A: To my very regret, old-fashioned terminologies are all over the place in mathematics and still prevent us from using the universal benefit of (the deep idea of) category theory, for example the unification of various scattered notions in mathematics. So let me answer what $A \times B$ and $A \oplus B$ should denote (although most books have not adopted this yet).
In any category, $\times$ denotes the product, and $\oplus$ or $\sqcup$ denotes the coproduct. Even in the category of $K$-modules, they are not the same. Only the underlying objects are the same. A (co)product is more than just an object, it is a a special (co)limit (co)cone. Thus, a product comes equipped with projections, and a coproduct comes equipped with inclusions. Of course there is this usual abuse of notation. But in this case, in my opinion, it is important to realize that (even the underlying objects) $A \times B$ and $A \oplus B$ really have a different flavor, and that it really is a coincidence that they agree. Instead of being surprised that they don't agree for, say, groups, one should be surprised that they agree for abelian groups. Unfortunately, the current literature and courses for beginners do not support this. The only reason why one can write $A \times B = A \oplus B$ safely is that there is a canonical isomorphism between the underlying objects, and in fact there is the notion of a biproduct which fuses product and coproduct in arbitrary linear categories.
Now let $k$ be a commutative ring. For me, rings are always unital unless otherwise specified. The product in the category of $k$-algebras is as usual: We just take the cartesian product of the underlying sets, and then declare addition, scalar multiplication, multiplication and unit pointwise. This works for every algebraic category. So the elements of $A \times B$ are easy to understand and easy to manipulate. The coproduct $A \oplus B$ is more complicated. The underlying $k$-module is some quotient of $k \oplus A \oplus B \oplus A \otimes_k B \oplus B \otimes_k A \oplus A \otimes_k A \otimes_k B \oplus \dotsc$, where we basically identify $x$ with $x \otimes 1$ and $1 \otimes x$. The multiplication is defined in an obvious way. Of course, in the category of commutative $k$-algebras this simplifies a lot, namely we may reduce to $A \otimes_k B$.
Many people still write $A \oplus B$ for what should be denoted by $A \times B$, because the elements of $A \times B$ may be written as $(a,0) + (0,b)$ and there is no harm in identifiying $(a,0)$ with $a$ etc. But meanwhile it should be well-known that morphisms are as important as elements, in the context of universal constructions even far more important than elements, and more importantly it glosses over the fact that $a \mapsto (a,0)$ is not a homomorphism of algebras, since it does not preserve the unit. So this construction usually denoted by $A \oplus B$ actually takes place in the category of non-unital $k$-algebras:
Let more generally $(A_i)_{i \in I}$ be a family of non-unital $k$-algebras. As a $k$-module, their coproduct $\oplus_{i \in I} A_i$ is again a large direct sum of tensor products (for example $A \oplus B = A \oplus B \oplus A \otimes_k B \oplus B \otimes_k A \oplus \dotsc$ with a suitable multiplication). But many people denote by $\oplus_{i \in I} A_i$ the subalgebra $C$ of $\prod_{i \in I} A_i$ consisting of those tuples with finite support (see Frank McGovern's answer). But this is not a coproduct and therefore I find it confusing to denote it as such, contradicting the usual use of this symbol (I will suggest a new symbol below). Nevertheless, it has an interesting universal property. In some sense, it is the universal coproduct with the additional requirement that $A_i \cdot A_j = 0$ for $i \neq j$. More precisely, there are inclusions $A_i \to C$ such that $A_i \otimes_k A_j \to C$  is zero for $i \neq j$, and for every family of homomorphisms of non-unital $k$-algebras $A_i \to B$ such that $A_i \otimes_k A_j \to B$ is zero for $i \neq j$, there is a homomorphism $C \to B$ making the obvious diagrams commute. Sometimes elements $x,y$ of a ring with $xy=0$ are called orthogonal (motivated by the case of projections on some space). Therefore, I would call $C$ the orthogonal coproduct and denote it by $\oplus_{i \in I}^{\perp} A_i$. What do you think?
See here for a quite similar construction for groups.
Notation should be consistent and work for all categories. It only gets confusing when for different categories the notation differs.
Edit: Surprisingly, my point of view also appears on Wikipedia: Direct sum of rings
A: Yep! There's only a difference in the direct product and the direct sum in the infinite case.
For example, if $\mathbb N$ is our infinite indexing set and $\{A_n\}_{n\in \mathbb N}$ are $K$-algebras, then $\prod_{n\in \mathbb N}A_n$ is the set of tuples $(x_1,x_2,\ldots,x_i,\ldots)$ such that $x_n\in A_n$. However, we define $\bigoplus_{n\in N}A_n$ to be the set of tuples $(x_1,x_2,\ldots,x_i,\ldots)$ such that $x_n\in A_n$ and all but finitely many $x_n=0$. Thus $\bigoplus_{n\in\mathbb N}A_n\subsetneq \prod_{n\in \mathbb N}A_n$.
